Decouple llvm::SpecialCaseList text representation and its LLVM IR semantics.
Turn llvm::SpecialCaseList into a simple class that parses text files in
a specified format and knows nothing about LLVM IR. Move this class into
LLVMSupport library. Implement two users of this class:
* DFSanABIList in DFSan instrumentation pass.
* SanitizerBlacklist in Clang CodeGen library.
The latter will be modified to use actual source-level information from frontend
(source file names) instead of unstable LLVM IR things (LLVM Module identifier).
Remove dependency edge from ClangCodeGen/ClangDriver to LLVMTransformUtils.
No functionality change.
llvm-svn: 212643
diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h
index bb4c010..649b0e5 100644
--- a/clang/lib/CodeGen/CodeGenModule.h
+++ b/clang/lib/CodeGen/CodeGenModule.h
@@ -16,6 +16,7 @@
#include "CGVTables.h"
#include "CodeGenTypes.h"
+#include "SanitizerBlacklist.h"
#include "clang/AST/Attr.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclObjC.h"
@@ -31,7 +32,6 @@
#include "llvm/IR/CallingConv.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/ValueHandle.h"
-#include "llvm/Transforms/Utils/SpecialCaseList.h"
namespace llvm {
class Module;
@@ -473,7 +473,7 @@
GlobalDecl initializedGlobalDecl;
- std::unique_ptr<llvm::SpecialCaseList> SanitizerBlacklist;
+ SanitizerBlacklist SanitizerBL;
/// @}
public:
@@ -1008,8 +1008,8 @@
/// annotations are emitted during finalization of the LLVM code.
void AddGlobalAnnotations(const ValueDecl *D, llvm::GlobalValue *GV);
- const llvm::SpecialCaseList &getSanitizerBlacklist() const {
- return *SanitizerBlacklist;
+ const SanitizerBlacklist &getSanitizerBlacklist() const {
+ return SanitizerBL;
}
void reportGlobalToASan(llvm::GlobalVariable *GV, SourceLocation Loc,