Move SanitizerBlacklist object from CodeGenModule to ASTContext.
Soon we'll need to have access to blacklist before the CodeGen phase (see http://reviews.llvm.org/D5687), so parse and construct the blacklist earlier. llvm-svn: 219857
This commit is contained in:
@@ -89,9 +89,7 @@ CodeGenModule::CodeGenModule(ASTContext &C, const CodeGenOptions &CGO,
|
||||
NSConcreteStackBlock(nullptr), BlockObjectAssign(nullptr),
|
||||
BlockObjectDispose(nullptr), BlockDescriptorType(nullptr),
|
||||
GenericBlockLiteralType(nullptr), LifetimeStartFn(nullptr),
|
||||
LifetimeEndFn(nullptr), SanitizerBL(llvm::SpecialCaseList::createOrDie(
|
||||
LangOpts.Sanitize.BlacklistFile)),
|
||||
SanitizerMD(new SanitizerMetadata(*this)) {
|
||||
LifetimeEndFn(nullptr), SanitizerMD(new SanitizerMetadata(*this)) {
|
||||
|
||||
// Initialize the type cache.
|
||||
llvm::LLVMContext &LLVMContext = M.getContext();
|
||||
@@ -743,7 +741,7 @@ void CodeGenModule::SetLLVMFunctionAttributesForDefinition(const Decl *D,
|
||||
B.addAttribute(llvm::Attribute::StackProtectReq);
|
||||
|
||||
// Add sanitizer attributes if function is not blacklisted.
|
||||
if (!SanitizerBL.isIn(*F)) {
|
||||
if (!getSanitizerBlacklist().isIn(*F)) {
|
||||
// When AddressSanitizer is enabled, set SanitizeAddress attribute
|
||||
// unless __attribute__((no_sanitize_address)) is used.
|
||||
if (LangOpts.Sanitize.Address && !D->hasAttr<NoSanitizeAddressAttr>())
|
||||
|
||||
Reference in New Issue
Block a user