r219937 - Remove one of SanitizerBlacklist::isIn() overloads. NFC.

Alexey Samsonov vonosmas at gmail.com
Thu Oct 16 10:10:39 PDT 2014


Author: samsonov
Date: Thu Oct 16 12:10:38 2014
New Revision: 219937

URL: http://llvm.org/viewvc/llvm-project?rev=219937&view=rev
Log:
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.

Modified:
    cfe/trunk/include/clang/Basic/SanitizerBlacklist.h
    cfe/trunk/lib/Basic/SanitizerBlacklist.cpp

Modified: cfe/trunk/include/clang/Basic/SanitizerBlacklist.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/SanitizerBlacklist.h?rev=219937&r1=219936&r2=219937&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/SanitizerBlacklist.h (original)
+++ cfe/trunk/include/clang/Basic/SanitizerBlacklist.h Thu Oct 16 12:10:38 2014
@@ -23,7 +23,6 @@
 namespace llvm {
 class GlobalVariable;
 class Function;
-class Module;
 }
 
 namespace clang {
@@ -33,12 +32,13 @@ class SanitizerBlacklist {
 
 public:
   SanitizerBlacklist(const std::string &BlacklistPath);
-  bool isIn(const llvm::Module &M,
-            StringRef Category = StringRef()) const;
   bool isIn(const llvm::Function &F) const;
   bool isIn(const llvm::GlobalVariable &G,
             StringRef Category = StringRef()) const;
   bool isBlacklistedType(StringRef MangledTypeName) const;
+  bool isBlacklistedFunction(StringRef FunctionName) const;
+  bool isBlacklistedFile(StringRef FileName,
+                         StringRef Category = StringRef()) const;
 };
 
 }  // end namespace clang

Modified: cfe/trunk/lib/Basic/SanitizerBlacklist.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/SanitizerBlacklist.cpp?rev=219937&r1=219936&r2=219937&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/SanitizerBlacklist.cpp (original)
+++ cfe/trunk/lib/Basic/SanitizerBlacklist.cpp Thu Oct 16 12:10:38 2014
@@ -32,19 +32,14 @@ static StringRef GetGlobalTypeString(con
 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
 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);
+}





More information about the cfe-commits mailing list