[ASan] Allow disabling init-order checks for globals by source file name.
authorAlexey Samsonov <samsonov@google.com>
Thu, 11 Apr 2013 13:20:00 +0000 (13:20 +0000)
committerAlexey Samsonov <samsonov@google.com>
Thu, 11 Apr 2013 13:20:00 +0000 (13:20 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179280 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Transforms/Utils/BlackList.h
lib/Transforms/Instrumentation/BlackList.cpp

index f19470e19d8aadaa1dc6b1096b866fafac31c10a..316b364845caf753ba0759cb9239843bbc829f41 100644 (file)
@@ -20,6 +20,7 @@
 // global-init:*global_with_initialization_issues*
 // global-init-type:*Namespace::ClassName*
 // src:file_with_tricky_code.cc
+// global-init-src:ignore-global-initializers-issues.cc
 // ---
 // Note that the wild card is in fact an llvm::Regex, but * is automatically
 // replaced with .*
index 927982d2af47c7d79cc34aa79a4a562ba4daafae..39de4b0401cb25903341bc2fa322a5d23bf03d9f 100644 (file)
@@ -110,7 +110,8 @@ static StringRef GetGVTypeString(const GlobalVariable &G) {
 bool BlackList::isInInit(const GlobalVariable &G) const {
   return (isIn(*G.getParent()) ||
           inSection("global-init", G.getName()) ||
-          inSection("global-init-type", GetGVTypeString(G)));
+          inSection("global-init-type", GetGVTypeString(G)) ||
+          inSection("global-init-src", G.getParent()->getModuleIdentifier()));
 }
 
 bool BlackList::inSection(const StringRef Section,