summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDeclCXX.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen/CGDeclCXX.cpp')
-rw-r--r--clang/lib/CodeGen/CGDeclCXX.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/clang/lib/CodeGen/CGDeclCXX.cpp b/clang/lib/CodeGen/CGDeclCXX.cpp
index c2877409f77..6a03e9afe4d 100644
--- a/clang/lib/CodeGen/CGDeclCXX.cpp
+++ b/clang/lib/CodeGen/CGDeclCXX.cpp
@@ -245,12 +245,14 @@ CreateGlobalInitOrDestructFunction(CodeGenModule &CGM,
if (!CGM.getLangOpts().Exceptions)
Fn->setDoesNotThrow();
- if (CGM.getSanOpts().Address)
- Fn->addFnAttr(llvm::Attribute::SanitizeAddress);
- if (CGM.getSanOpts().Thread)
- Fn->addFnAttr(llvm::Attribute::SanitizeThread);
- if (CGM.getSanOpts().Memory)
- Fn->addFnAttr(llvm::Attribute::SanitizeMemory);
+ if (!CGM.getSanitizerBlacklist().isIn(*Fn)) {
+ if (CGM.getLangOpts().Sanitize.Address)
+ Fn->addFnAttr(llvm::Attribute::SanitizeAddress);
+ if (CGM.getLangOpts().Sanitize.Thread)
+ Fn->addFnAttr(llvm::Attribute::SanitizeThread);
+ if (CGM.getLangOpts().Sanitize.Memory)
+ Fn->addFnAttr(llvm::Attribute::SanitizeMemory);
+ }
return Fn;
}
OpenPOWER on IntegriCloud