[asan] Delay creation of asan ctor.
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Thu, 6 Apr 2017 19:55:09 +0000 (19:55 +0000)
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Thu, 6 Apr 2017 19:55:09 +0000 (19:55 +0000)
commit039af609f163c0c38d1557fbb2f79077374ba911
treea2cf31a554786937aba3b2308da2cc9004ea82df
parentdb4cafa6c40a4ea99643642dd5f2532bc0745eea
[asan] Delay creation of asan ctor.

Create the constructor in the module pass.
This in needed for the GC-friendly globals change, where the constructor can be
put in a comdat  in some cases, but we don't know about that in the function
pass.

This is a rebase of r298731 which was reverted due to a false alarm.

llvm-svn: 299695
llvm/include/llvm/Transforms/Utils/ModuleUtils.h
llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
llvm/lib/Transforms/Utils/ModuleUtils.cpp
llvm/test/Instrumentation/AddressSanitizer/instrument_load_then_store.ll