diff options
author | Alexey Samsonov <vonosmas@gmail.com> | 2014-10-17 22:37:33 +0000 |
---|---|---|
committer | Alexey Samsonov <vonosmas@gmail.com> | 2014-10-17 22:37:33 +0000 |
commit | 87d48052c99c5988278f275ba94d2eb50f6f0a2a (patch) | |
tree | de203f18637fab479b28d40db4153d123ea5b228 /include/clang/Basic/SanitizerBlacklist.h | |
parent | a4de584195b308145f7ad189b5dd0303de5fb4f7 (diff) | |
download | clang-87d48052c99c5988278f275ba94d2eb50f6f0a2a.tar.gz |
[ASan] Improve blacklisting of global variables.
This commit changes the way we blacklist global variables in ASan.
Now the global is excluded from instrumentation (either regular
bounds checking, or initialization-order checking) if:
1) Global is explicitly blacklisted by its mangled name.
This part is left unchanged.
2) SourceLocation of a global is in blacklisted source file.
This changes the old behavior, where instead of looking at the
SourceLocation of a variable we simply considered llvm::Module
identifier. This was wrong, as identifier may not correspond to
the file name, and we incorrectly disabled instrumentation
for globals coming from #include'd files.
3) Global is blacklisted by type.
Now we build the type of a global variable using Clang machinery
(QualType::getAsString()), instead of llvm::StructType::getName().
After this commit, the active users of ASan blacklist files
may have to revisit them (this is a backwards-incompatible change).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220097 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/SanitizerBlacklist.h')
-rw-r--r-- | include/clang/Basic/SanitizerBlacklist.h | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/include/clang/Basic/SanitizerBlacklist.h b/include/clang/Basic/SanitizerBlacklist.h index 79bb75acca..2ce268aa0a 100644 --- a/include/clang/Basic/SanitizerBlacklist.h +++ b/include/clang/Basic/SanitizerBlacklist.h @@ -21,10 +21,6 @@ #include "llvm/Support/SpecialCaseList.h" #include <memory> -namespace llvm { -class GlobalVariable; -} - namespace clang { class SanitizerBlacklist { @@ -33,8 +29,8 @@ class SanitizerBlacklist { public: SanitizerBlacklist(StringRef BlacklistPath, SourceManager &SM); - bool isIn(const llvm::GlobalVariable &G, - StringRef Category = StringRef()) const; + bool isBlacklistedGlobal(StringRef GlobalName, + StringRef Category = StringRef()) const; bool isBlacklistedType(StringRef MangledTypeName, StringRef Category = StringRef()) const; bool isBlacklistedFunction(StringRef FunctionName) const; |