Move SanitizerBlacklist to clangBasic. NFC.
authorAlexey Samsonov <vonosmas@gmail.com>
Wed, 15 Oct 2014 19:57:45 +0000 (19:57 +0000)
committerAlexey Samsonov <vonosmas@gmail.com>
Wed, 15 Oct 2014 19:57:45 +0000 (19:57 +0000)
This change moves SanitizerBlacklist.h from lib/CodeGen
to public Clang headers in include/clang/Basic. SanitizerBlacklist
is currently only used in CodeGen to decide which functions/modules
should be instrumented, but this will soon change as ASan will
optionally modify class layouts during AST construction
(http://reviews.llvm.org/D5687). We need blacklist machinery
to be available at this point.

llvm-svn: 219840

clang/include/clang/Basic/SanitizerBlacklist.h [moved from clang/lib/CodeGen/SanitizerBlacklist.h with 89% similarity]
clang/lib/Basic/CMakeLists.txt
clang/lib/Basic/SanitizerBlacklist.cpp [moved from clang/lib/CodeGen/SanitizerBlacklist.cpp with 96% similarity]
clang/lib/CodeGen/CMakeLists.txt
clang/lib/CodeGen/CodeGenModule.h

similarity index 89%
rename from clang/lib/CodeGen/SanitizerBlacklist.h
rename to clang/include/clang/Basic/SanitizerBlacklist.h
index b7c1fa9..82d88f6 100644 (file)
@@ -11,8 +11,8 @@
 // sanitizers.
 //
 //===----------------------------------------------------------------------===//
-#ifndef LLVM_CLANG_LIB_CODEGEN_SANITIZERBLACKLIST_H
-#define LLVM_CLANG_LIB_CODEGEN_SANITIZERBLACKLIST_H
+#ifndef LLVM_CLANG_BASIC_SANITIZERBLACKLIST_H
+#define LLVM_CLANG_BASIC_SANITIZERBLACKLIST_H
 
 #include "clang/Basic/LLVM.h"
 #include "llvm/ADT/StringRef.h"
@@ -26,7 +26,6 @@ class Module;
 }
 
 namespace clang {
-namespace CodeGen {
 
 class SanitizerBlacklist {
   std::unique_ptr<llvm::SpecialCaseList> SCL;
@@ -41,7 +40,7 @@ public:
             StringRef Category = StringRef()) const;
   bool isBlacklistedType(StringRef MangledTypeName) const;
 };
-}  // end namespace CodeGen
+
 }  // end namespace clang
 
 #endif
index 0df82b3..e04417d 100644 (file)
@@ -17,6 +17,7 @@ add_clang_library(clangBasic
   ObjCRuntime.cpp
   OpenMPKinds.cpp
   OperatorPrecedence.cpp
+  SanitizerBlacklist.cpp
   SourceLocation.cpp
   SourceManager.cpp
   TargetInfo.cpp
similarity index 96%
rename from clang/lib/CodeGen/SanitizerBlacklist.cpp
rename to clang/lib/Basic/SanitizerBlacklist.cpp
index 9882a6d..f96ebc0 100644 (file)
 // sanitizers.
 //
 //===----------------------------------------------------------------------===//
-#include "SanitizerBlacklist.h"
+#include "clang/Basic/SanitizerBlacklist.h"
 #include "llvm/IR/Function.h"
 #include "llvm/IR/GlobalValue.h"
 #include "llvm/IR/Module.h"
 
 using namespace clang;
-using namespace CodeGen;
 
 static StringRef GetGlobalTypeString(const llvm::GlobalValue &G) {
   // Types of GlobalVariables are always pointer types.
index 836f507..2c38c24 100644 (file)
@@ -61,7 +61,6 @@ add_clang_library(clangCodeGen
   ItaniumCXXABI.cpp
   MicrosoftCXXABI.cpp
   ModuleBuilder.cpp
-  SanitizerBlacklist.cpp
   SanitizerMetadata.cpp
   TargetInfo.cpp
 
index 665a7a5..47ff8cd 100644 (file)
@@ -16,7 +16,6 @@
 
 #include "CGVTables.h"
 #include "CodeGenTypes.h"
-#include "SanitizerBlacklist.h"
 #include "SanitizerMetadata.h"
 #include "clang/AST/Attr.h"
 #include "clang/AST/DeclCXX.h"
@@ -26,6 +25,7 @@
 #include "clang/Basic/ABI.h"
 #include "clang/Basic/LangOptions.h"
 #include "clang/Basic/Module.h"
+#include "clang/Basic/SanitizerBlacklist.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/SetVector.h"
 #include "llvm/ADT/SmallPtrSet.h"