diff options
author | Alexey Samsonov <vonosmas@gmail.com> | 2014-10-16 17:10:38 +0000 |
---|---|---|
committer | Alexey Samsonov <vonosmas@gmail.com> | 2014-10-16 17:10:38 +0000 |
commit | a41df172134ce75a2e1d27e9ee2ed711df2dfd53 (patch) | |
tree | fe01eca31e6d700703d61d36fefd66cdc004455f /lib/Basic | |
parent | 26a8b763afff1f4e70f03fdf256012a753b99009 (diff) |
Remove one of SanitizerBlacklist::isIn() overloads. NFC.
The final goal is to get rid of all the rest overloads that
accept LLVM objects (llvm::Function and llvm::GlobalVariable),
and pass in source-level entities instead.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219937 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic')
-rw-r--r-- | lib/Basic/SanitizerBlacklist.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/lib/Basic/SanitizerBlacklist.cpp b/lib/Basic/SanitizerBlacklist.cpp index 05dec8b5b8..7627bd0299 100644 --- a/lib/Basic/SanitizerBlacklist.cpp +++ b/lib/Basic/SanitizerBlacklist.cpp @@ -32,19 +32,14 @@ static StringRef GetGlobalTypeString(const llvm::GlobalValue &G) { SanitizerBlacklist::SanitizerBlacklist(const std::string &BlacklistPath) : SCL(llvm::SpecialCaseList::createOrDie(BlacklistPath)) {} -bool SanitizerBlacklist::isIn(const llvm::Module &M, - StringRef Category) const { - return SCL->inSection("src", M.getModuleIdentifier(), Category); -} - bool SanitizerBlacklist::isIn(const llvm::Function &F) const { - return isIn(*F.getParent()) || - SCL->inSection("fun", F.getName(), ""); + return isBlacklistedFile(F.getParent()->getModuleIdentifier()) || + isBlacklistedFunction(F.getName()); } bool SanitizerBlacklist::isIn(const llvm::GlobalVariable &G, StringRef Category) const { - return isIn(*G.getParent(), Category) || + return isBlacklistedFile(G.getParent()->getModuleIdentifier(), Category) || SCL->inSection("global", G.getName(), Category) || SCL->inSection("type", GetGlobalTypeString(G), Category); } @@ -52,3 +47,12 @@ bool SanitizerBlacklist::isIn(const llvm::GlobalVariable &G, bool SanitizerBlacklist::isBlacklistedType(StringRef MangledTypeName) const { return SCL->inSection("type", MangledTypeName); } + +bool SanitizerBlacklist::isBlacklistedFunction(StringRef FunctionName) const { + return SCL->inSection("fun", FunctionName); +} + +bool SanitizerBlacklist::isBlacklistedFile(StringRef FileName, + StringRef Category) const { + return SCL->inSection("src", FileName, Category); +} |