diff options
author | Kostya Serebryany <kcc@google.com> | 2013-02-26 06:58:09 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2013-02-26 06:58:09 +0000 |
commit | cf880b94434ddfcba2d5c7b0deb588591b0d8a08 (patch) | |
tree | a23d9b1988adc2fa2e0b4c98a21670c7ca929688 /llvm/lib/IR/Attributes.cpp | |
parent | d9450f778ec4db7ba10698fcf335b361b736fa47 (diff) | |
download | bcm5719-llvm-cf880b94434ddfcba2d5c7b0deb588591b0d8a08.tar.gz bcm5719-llvm-cf880b94434ddfcba2d5c7b0deb588591b0d8a08.zip |
Unify clang/llvm attributes for asan/tsan/msan (LLVM 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: 176075
Diffstat (limited to 'llvm/lib/IR/Attributes.cpp')
-rw-r--r-- | llvm/lib/IR/Attributes.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/llvm/lib/IR/Attributes.cpp b/llvm/lib/IR/Attributes.cpp index 11ed82d7955..6eb51f0edcb 100644 --- a/llvm/lib/IR/Attributes.cpp +++ b/llvm/lib/IR/Attributes.cpp @@ -153,8 +153,8 @@ unsigned Attribute::getStackAlignment() const { std::string Attribute::getAsString(bool InAttrGrp) const { if (!pImpl) return ""; - if (hasAttribute(Attribute::AddressSafety)) - return "address_safety"; + if (hasAttribute(Attribute::SanitizeAddress)) + return "sanitize_address"; if (hasAttribute(Attribute::AlwaysInline)) return "alwaysinline"; if (hasAttribute(Attribute::ByVal)) @@ -207,10 +207,10 @@ std::string Attribute::getAsString(bool InAttrGrp) const { return "sspstrong"; if (hasAttribute(Attribute::StructRet)) return "sret"; - if (hasAttribute(Attribute::ThreadSafety)) - return "thread_safety"; - if (hasAttribute(Attribute::UninitializedChecks)) - return "uninitialized_checks"; + if (hasAttribute(Attribute::SanitizeThread)) + return "sanitize_thread"; + if (hasAttribute(Attribute::SanitizeMemory)) + return "sanitize_memory"; if (hasAttribute(Attribute::UWTable)) return "uwtable"; if (hasAttribute(Attribute::ZExt)) @@ -386,12 +386,12 @@ uint64_t AttributeImpl::getAttrMask(Attribute::AttrKind Val) { case Attribute::ReturnsTwice: return 1 << 29; case Attribute::UWTable: return 1 << 30; case Attribute::NonLazyBind: return 1U << 31; - case Attribute::AddressSafety: return 1ULL << 32; + case Attribute::SanitizeAddress: return 1ULL << 32; case Attribute::MinSize: return 1ULL << 33; case Attribute::NoDuplicate: return 1ULL << 34; case Attribute::StackProtectStrong: return 1ULL << 35; - case Attribute::ThreadSafety: return 1ULL << 36; - case Attribute::UninitializedChecks: return 1ULL << 37; + case Attribute::SanitizeThread: return 1ULL << 36; + case Attribute::SanitizeMemory: return 1ULL << 37; case Attribute::NoBuiltin: return 1ULL << 38; } llvm_unreachable("Unsupported attribute type"); @@ -1119,9 +1119,9 @@ void AttrBuilder::removeFunctionOnlyAttrs() { .removeAttribute(Attribute::UWTable) .removeAttribute(Attribute::NonLazyBind) .removeAttribute(Attribute::ReturnsTwice) - .removeAttribute(Attribute::AddressSafety) - .removeAttribute(Attribute::ThreadSafety) - .removeAttribute(Attribute::UninitializedChecks) + .removeAttribute(Attribute::SanitizeAddress) + .removeAttribute(Attribute::SanitizeThread) + .removeAttribute(Attribute::SanitizeMemory) .removeAttribute(Attribute::MinSize) .removeAttribute(Attribute::NoDuplicate) .removeAttribute(Attribute::NoBuiltin); |