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
This commit is contained in:
Alexey Samsonov
2014-07-09 19:40:08 +00:00
parent cd0a4aaba3
commit b7dd329f2f
17 changed files with 382 additions and 416 deletions

View File

@@ -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 @@ class CodeGenModule : public CodeGenTypeCache {
GlobalDecl initializedGlobalDecl;
std::unique_ptr<llvm::SpecialCaseList> SanitizerBlacklist;
SanitizerBlacklist SanitizerBL;
/// @}
public:
@@ -1008,8 +1008,8 @@ public:
/// 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,