[tsan,msan] Insert module constructors in a module pass
authorVitaly Buka <vitalybuka@google.com>
Thu, 10 Oct 2019 23:49:10 +0000 (23:49 +0000)
committerVitaly Buka <vitalybuka@google.com>
Thu, 10 Oct 2019 23:49:10 +0000 (23:49 +0000)
commitd70fe33b97b2d608ffff64b5a45a5db81181cacd
tree8cddb2721a7288d1ad428c9982558fb9a8597238
parente4a195cf1a256ffd6a60e3256e84e551a303c708
[tsan,msan] 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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@374481 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/BackendUtil.cpp
test/CodeGen/sanitizer-module-constructor.c [new file with mode: 0644]