summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip Pfaffe <philip.pfaffe@gmail.com>2019-01-16 09:28:01 +0000
committerPhilip Pfaffe <philip.pfaffe@gmail.com>2019-01-16 09:28:01 +0000
commitb2a2c16ea136faa51a5307f742dbafe8f7b3861e (patch)
tree48a5d277368cd7d804ed9c61727033d2b79a67ea
parenta026e5071bce34be82f4fe644eed433fda8490ae (diff)
[NewPM][TSan] Reiterate the TSan port
Summary: Second iteration of D56433 which got reverted in rL350719. The problem in the previous version was that we dropped the thunk calling the tsan init function. The new version keeps the thunk which should appease dyld, but is not actually OK wrt. the current semantics of function passes. Hence, add a helper to insert the functions only on the first time. The helper allows hooking into the insertion to be able to append them to the global ctors list. Reviewers: chandlerc, vitalybuka, fedor.sergeev, leonardchan Subscribers: hiraditya, bollu, llvm-commits Differential Revision: https://reviews.llvm.org/D56538 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@351314 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/BackendUtil.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/CodeGen/BackendUtil.cpp b/lib/CodeGen/BackendUtil.cpp
index 3e0651978b..b927acabac 100644
--- a/lib/CodeGen/BackendUtil.cpp
+++ b/lib/CodeGen/BackendUtil.cpp
@@ -53,9 +53,10 @@
#include "llvm/Transforms/IPO/ThinLTOBitcodeWriter.h"
#include "llvm/Transforms/InstCombine/InstCombine.h"
#include "llvm/Transforms/Instrumentation.h"
-#include "llvm/Transforms/Instrumentation/MemorySanitizer.h"
#include "llvm/Transforms/Instrumentation/BoundsChecking.h"
#include "llvm/Transforms/Instrumentation/GCOVProfiler.h"
+#include "llvm/Transforms/Instrumentation/MemorySanitizer.h"
+#include "llvm/Transforms/Instrumentation/ThreadSanitizer.h"
#include "llvm/Transforms/ObjCARC.h"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Transforms/Scalar/GVN.h"
@@ -305,7 +306,7 @@ static void addKernelMemorySanitizerPass(const PassManagerBuilder &Builder,
static void addThreadSanitizerPass(const PassManagerBuilder &Builder,
legacy::PassManagerBase &PM) {
- PM.add(createThreadSanitizerPass());
+ PM.add(createThreadSanitizerLegacyPassPass());
}
static void addDataFlowSanitizerPass(const PassManagerBuilder &Builder,