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
This commit is contained in:
Kostya Serebryany
2013-02-26 06:58:09 +00:00
parent ce522ee0a2
commit 8eec41fc77
25 changed files with 127 additions and 127 deletions
+12 -12
View File
@@ -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);