OSDN Git Service

[NewPM][TSan] Reiterate the TSan port
authorPhilip Pfaffe <philip.pfaffe@gmail.com>
Wed, 16 Jan 2019 09:28:01 +0000 (09:28 +0000)
committerPhilip Pfaffe <philip.pfaffe@gmail.com>
Wed, 16 Jan 2019 09:28:01 +0000 (09:28 +0000)
commit6dbe225afee23c2c19fb4ae5ee688d9824be525d
treec760625f6686215a87ee2c1761ec0e7b56528300
parentb95047e99028adf0ee8e09b2e84283747fef9d55
[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/llvm/trunk@351314 91177308-0d34-0410-b5e6-96231b3b80d8
bindings/go/llvm/InstrumentationBindings.cpp
include/llvm/InitializePasses.h
include/llvm/Transforms/Instrumentation.h
include/llvm/Transforms/Instrumentation/ThreadSanitizer.h [new file with mode: 0644]
include/llvm/Transforms/Utils/ModuleUtils.h
lib/Passes/PassBuilder.cpp
lib/Passes/PassRegistry.def
lib/Transforms/Instrumentation/Instrumentation.cpp
lib/Transforms/Instrumentation/ThreadSanitizer.cpp
lib/Transforms/Utils/ModuleUtils.cpp
test/Instrumentation/ThreadSanitizer/tsan_basic.ll