Insert module constructors in a module pass
authorVitaly Buka <vitalybuka@google.com>
Fri, 11 Oct 2019 08:47:03 +0000 (08:47 +0000)
committerVitaly Buka <vitalybuka@google.com>
Fri, 11 Oct 2019 08:47:03 +0000 (08:47 +0000)
commitb46dd6e92af7496130f6c648ae46f7dbb80ca53c
tree55343f57b223700a98e0dd4f4a512eef520b0462
parent4778f40f782f4df6bdd0fb40e4c3fe8b5f3b571e
Insert module constructors in a module pass

Summary:
If we insert them from function pass some analysis may be missing or invalid.
Fixes PR42877.

Reviewers: eugenis, leonardchan

Reviewed By: leonardchan

Subscribers: hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D68832

> llvm-svn: 374481
Signed-off-by: Vitaly Buka <vitalybuka@google.com>
llvm-svn: 374527
clang/lib/CodeGen/BackendUtil.cpp
clang/test/CodeGen/sanitizer-module-constructor.c [new file with mode: 0644]
llvm/include/llvm/Transforms/Instrumentation/MemorySanitizer.h
llvm/include/llvm/Transforms/Instrumentation/ThreadSanitizer.h
llvm/lib/Passes/PassRegistry.def
llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp
llvm/test/Instrumentation/MemorySanitizer/msan_basic.ll
llvm/test/Instrumentation/ThreadSanitizer/tsan_basic.ll