Perhaps once(&func) should be hoisted into lib/Support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146110
91177308-0d34-0410-b5e6-
96231b3b80d8
#include "llvm/PassRegistry.h"
#include "llvm/InitializePasses.h"
#include "llvm/Support/Atomic.h"
#include "llvm/PassRegistry.h"
#include "llvm/InitializePasses.h"
#include "llvm/Support/Atomic.h"
+#include "llvm/Support/Valgrind.h"
#include <vector>
namespace llvm {
#include <vector>
namespace llvm {
if (old_val == 0) { \
function(Registry); \
sys::MemoryFence(); \
if (old_val == 0) { \
function(Registry); \
sys::MemoryFence(); \
+ TsanIgnoreWritesBegin(); \
+ TsanHappensBefore(&initialized); \
+ TsanIgnoreWritesEnd(); \
} else { \
sys::cas_flag tmp = initialized; \
sys::MemoryFence(); \
} else { \
sys::cas_flag tmp = initialized; \
sys::MemoryFence(); \
tmp = initialized; \
sys::MemoryFence(); \
} \
tmp = initialized; \
sys::MemoryFence(); \
} \
+ } \
+ TsanHappensAfter(&initialized);
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis) \
static void* initialize##passName##PassOnce(PassRegistry &Registry) { \
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis) \
static void* initialize##passName##PassOnce(PassRegistry &Registry) { \