diff options
author | Kostya Serebryany <kcc@google.com> | 2013-02-26 06:58:27 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2013-02-26 06:58:27 +0000 |
commit | 4c0fc9931e5af027bee100a26062fe40283727ee (patch) | |
tree | ecf1ed318b3f90b425b5dd7c66ce8a68d61ad862 /clang/lib/CodeGen/CGDeclCXX.cpp | |
parent | cf880b94434ddfcba2d5c7b0deb588591b0d8a08 (diff) | |
download | bcm5719-llvm-4c0fc9931e5af027bee100a26062fe40283727ee.tar.gz bcm5719-llvm-4c0fc9931e5af027bee100a26062fe40283727ee.zip |
Unify clang/llvm attributes for asan/tsan/msan (Clang part)
These are two related changes (one in llvm, one in clang).
LLVM:
- rename address_safety => sanitize_address (the enum value is the same, so we preserve binary compatibility with old bitcode)
- rename thread_safety => sanitize_thread
- rename no_uninitialized_checks -> sanitize_memory
CLANG:
- add __attribute__((no_sanitize_address)) as a synonym for __attribute__((no_address_safety_analysis))
- add __attribute__((no_sanitize_thread))
- add __attribute__((no_sanitize_memory))
for S in address thread memory
If -fsanitize=S is present and __attribute__((no_sanitize_S)) is not
set llvm attribute sanitize_S
llvm-svn: 176076
Diffstat (limited to 'clang/lib/CodeGen/CGDeclCXX.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGDeclCXX.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGDeclCXX.cpp b/clang/lib/CodeGen/CGDeclCXX.cpp index f9d8199bb84..a5884e35db6 100644 --- a/clang/lib/CodeGen/CGDeclCXX.cpp +++ b/clang/lib/CodeGen/CGDeclCXX.cpp @@ -233,7 +233,11 @@ CreateGlobalInitOrDestructFunction(CodeGenModule &CGM, Fn->setDoesNotThrow(); if (CGM.getSanOpts().Address) - Fn->addFnAttr(llvm::Attribute::AddressSafety); + Fn->addFnAttr(llvm::Attribute::SanitizeAddress); + if (CGM.getSanOpts().Thread) + Fn->addFnAttr(llvm::Attribute::SanitizeThread); + if (CGM.getSanOpts().Memory) + Fn->addFnAttr(llvm::Attribute::SanitizeMemory); return Fn; } |