summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2013-04-11 13:20:00 +0000
committerAlexey Samsonov <samsonov@google.com>2013-04-11 13:20:00 +0000
commita28f36c2e2e23d642d37e030baefa7953b92366c (patch)
tree00008e62b3dfb4e018af0c2a39c88c7afa1945d9
parentb5739daf2d3704c6862783c2602a89c66619821e (diff)
downloadbcm5719-llvm-a28f36c2e2e23d642d37e030baefa7953b92366c.tar.gz
bcm5719-llvm-a28f36c2e2e23d642d37e030baefa7953b92366c.zip
[ASan] Allow disabling init-order checks for globals by source file name.
llvm-svn: 179280
-rw-r--r--llvm/include/llvm/Transforms/Utils/BlackList.h1
-rw-r--r--llvm/lib/Transforms/Instrumentation/BlackList.cpp3
2 files changed, 3 insertions, 1 deletions
diff --git a/llvm/include/llvm/Transforms/Utils/BlackList.h b/llvm/include/llvm/Transforms/Utils/BlackList.h
index f19470e19d8..316b364845c 100644
--- a/llvm/include/llvm/Transforms/Utils/BlackList.h
+++ b/llvm/include/llvm/Transforms/Utils/BlackList.h
@@ -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 .*
diff --git a/llvm/lib/Transforms/Instrumentation/BlackList.cpp b/llvm/lib/Transforms/Instrumentation/BlackList.cpp
index 927982d2af4..39de4b0401c 100644
--- a/llvm/lib/Transforms/Instrumentation/BlackList.cpp
+++ b/llvm/lib/Transforms/Instrumentation/BlackList.cpp
@@ -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,
OpenPOWER on IntegriCloud