diff options
author | Alexey Samsonov <vonosmas@gmail.com> | 2014-07-09 19:40:08 +0000 |
---|---|---|
committer | Alexey Samsonov <vonosmas@gmail.com> | 2014-07-09 19:40:08 +0000 |
commit | b7dd329f2f3ffdb8a1e5ec31e87e94a6038c2073 (patch) | |
tree | 8149a3e123456b9a6743ebb67dfdfbfd6fa8e8ca /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | cd0a4aaba3925d8b243c82bcaa885e121576c9ae (diff) | |
download | llvm-b7dd329f2f3ffdb8a1e5ec31e87e94a6038c2073.zip llvm-b7dd329f2f3ffdb8a1e5ec31e87e94a6038c2073.tar.gz llvm-b7dd329f2f3ffdb8a1e5ec31e87e94a6038c2073.tar.bz2 |
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
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index e5d7224..d0563b2 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -87,9 +87,8 @@ CodeGenModule::CodeGenModule(ASTContext &C, const CodeGenOptions &CGO, NSConcreteStackBlock(nullptr), BlockObjectAssign(nullptr), BlockObjectDispose(nullptr), BlockDescriptorType(nullptr), GenericBlockLiteralType(nullptr), LifetimeStartFn(nullptr), - LifetimeEndFn(nullptr), - SanitizerBlacklist( - llvm::SpecialCaseList::createOrDie(CGO.SanitizerBlacklistFile)) { + LifetimeEndFn(nullptr), SanitizerBL(llvm::SpecialCaseList::createOrDie( + CGO.SanitizerBlacklistFile)) { // Initialize the type cache. llvm::LLVMContext &LLVMContext = M.getContext(); @@ -730,7 +729,7 @@ void CodeGenModule::SetLLVMFunctionAttributesForDefinition(const Decl *D, B.addAttribute(llvm::Attribute::StackProtectReq); // Add sanitizer attributes if function is not blacklisted. - if (!SanitizerBlacklist->isIn(*F)) { + if (!SanitizerBL.isIn(*F)) { // When AddressSanitizer is enabled, set SanitizeAddress attribute // unless __attribute__((no_sanitize_address)) is used. if (LangOpts.Sanitize.Address && !D->hasAttr<NoSanitizeAddressAttr>()) @@ -1965,8 +1964,8 @@ void CodeGenModule::reportGlobalToASan(llvm::GlobalVariable *GV, SourceLocation Loc, bool IsDynInit) { if (!LangOpts.Sanitize.Address) return; - IsDynInit &= !SanitizerBlacklist->isIn(*GV, "init"); - bool IsBlacklisted = SanitizerBlacklist->isIn(*GV); + IsDynInit &= !SanitizerBL.isIn(*GV, "init"); + bool IsBlacklisted = SanitizerBL.isIn(*GV); llvm::LLVMContext &LLVMCtx = TheModule.getContext(); |