mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 11:13:28 +01:00
Add Tsan annotations to the pass system.
Perhaps once(&func) should be hoisted into lib/Support. llvm-svn: 146110
This commit is contained in:
parent
84833a551a
commit
fc10724777
@ -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 @@ private:
|
||||
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 @@ private:
|
||||
tmp = initialized; \
|
||||
sys::MemoryFence(); \
|
||||
} \
|
||||
}
|
||||
} \
|
||||
TsanHappensAfter(&initialized);
|
||||
|
||||
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis) \
|
||||
static void* initialize##passName##PassOnce(PassRegistry &Registry) { \
|
||||
|
Loading…
Reference in New Issue
Block a user