aboutsummaryrefslogtreecommitdiff
path: root/lib/IR/Attributes.cpp
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2013-02-26 06:58:09 +0000
committerKostya Serebryany <kcc@google.com>2013-02-26 06:58:09 +0000
commit8eec41fc778e99d42172a7f6de76faa43a6d8847 (patch)
treea6b89a9fb83eab1457104a996ea7798c9068ec10 /lib/IR/Attributes.cpp
parentce522ee0a27062390f13e7ccb53fcff4fc36c473 (diff)
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176075 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/IR/Attributes.cpp')
-rw-r--r--lib/IR/Attributes.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/IR/Attributes.cpp b/lib/IR/Attributes.cpp
index 11ed82d795..6eb51f0edc 100644
--- a/lib/IR/Attributes.cpp
+++ b/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);