[llvm-commits] [llvm] r146110 - /llvm/trunk/include/llvm/PassSupport.h
Nick Lewycky
nicholas at mxc.ca
Wed Dec 7 16:15:41 PST 2011
Author: nicholas
Date: Wed Dec 7 18:15:41 2011
New Revision: 146110
URL: http://llvm.org/viewvc/llvm-project?rev=146110&view=rev
Log:
Add Tsan annotations to the pass system.
Perhaps once(&func) should be hoisted into lib/Support.
Modified:
llvm/trunk/include/llvm/PassSupport.h
Modified: llvm/trunk/include/llvm/PassSupport.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/PassSupport.h?rev=146110&r1=146109&r2=146110&view=diff
==============================================================================
--- llvm/trunk/include/llvm/PassSupport.h (original)
+++ llvm/trunk/include/llvm/PassSupport.h Wed Dec 7 18:15:41 2011
@@ -25,6 +25,7 @@
#include "llvm/PassRegistry.h"
#include "llvm/InitializePasses.h"
#include "llvm/Support/Atomic.h"
+#include "llvm/Support/Valgrind.h"
#include <vector>
namespace llvm {
@@ -135,7 +136,10 @@
if (old_val == 0) { \
function(Registry); \
sys::MemoryFence(); \
+ TsanIgnoreWritesBegin(); \
+ TsanHappensBefore(&initialized); \
initialized = 2; \
+ TsanIgnoreWritesEnd(); \
} else { \
sys::cas_flag tmp = initialized; \
sys::MemoryFence(); \
@@ -143,7 +147,8 @@
tmp = initialized; \
sys::MemoryFence(); \
} \
- }
+ } \
+ TsanHappensAfter(&initialized);
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis) \
static void* initialize##passName##PassOnce(PassRegistry &Registry) { \
More information about the llvm-commits
mailing list