Unify clang/llvm attributes for asan/tsan/msan (LLVM part)
authorKostya Serebryany <kcc@google.com>
Tue, 26 Feb 2013 06:58:09 +0000 (06:58 +0000)
committerKostya Serebryany <kcc@google.com>
Tue, 26 Feb 2013 06:58:09 +0000 (06:58 +0000)
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

25 files changed:
docs/LangRef.rst
include/llvm/IR/Attributes.h
lib/Analysis/MemoryDependenceAnalysis.cpp
lib/AsmParser/LLLexer.cpp
lib/AsmParser/LLParser.cpp
lib/AsmParser/LLToken.h
lib/IR/Attributes.cpp
lib/IR/Verifier.cpp
lib/Transforms/Instrumentation/AddressSanitizer.cpp
test/Bitcode/attributes.ll
test/CodeGen/X86/crash.ll
test/Instrumentation/AddressSanitizer/X86/bug_11395.ll
test/Instrumentation/AddressSanitizer/asan-vs-gvn.ll
test/Instrumentation/AddressSanitizer/basic.ll
test/Instrumentation/AddressSanitizer/debug_info.ll
test/Instrumentation/AddressSanitizer/different_scale_and_offset.ll
test/Instrumentation/AddressSanitizer/do-not-instrument-internal-globals.ll
test/Instrumentation/AddressSanitizer/instrument-no-return.ll
test/Instrumentation/AddressSanitizer/instrument_initializer_metadata.ll
test/Instrumentation/AddressSanitizer/instrument_load_then_store.ll
test/Instrumentation/AddressSanitizer/lifetime.ll
test/Instrumentation/AddressSanitizer/test64.ll
test/Instrumentation/ThreadSanitizer/tsan-vs-gvn.ll
utils/llvm.grm
utils/vim/llvm.vim

index 84680df731a984be35b2e56ef932a3852f88e7d7..c08cee1dbd85e6e340a345dd0d25c77d870cee9d 100644 (file)
@@ -793,9 +793,6 @@ example:
     define void @f() alwaysinline optsize { ... }
     define void @f() optsize { ... }
 
     define void @f() alwaysinline optsize { ... }
     define void @f() optsize { ... }
 
-``address_safety``
-    This attribute indicates that the address safety analysis is enabled
-    for this function.
 ``alignstack(<n>)``
     This attribute indicates that, when emitting the prologue and
     epilogue, the backend should forcibly align the stack pointer.
 ``alignstack(<n>)``
     This attribute indicates that, when emitting the prologue and
     epilogue, the backend should forcibly align the stack pointer.
@@ -873,6 +870,15 @@ example:
     ``setjmp`` is an example of such a function. The compiler disables
     some optimizations (like tail calls) in the caller of these
     functions.
     ``setjmp`` is an example of such a function. The compiler disables
     some optimizations (like tail calls) in the caller of these
     functions.
+``sanitize_address``
+    This attribute indicates that AddressSanitizer checks
+    (dynamic address safety analysis) are enabled for this function.
+``sanitize_memory``
+    This attribute indicates that MemorySanitizer checks (dynamic detection
+    of accesses to uninitialized memory) are enabled for this function.
+``sanitize_thread``
+    This attribute indicates that ThreadSanitizer checks
+    (dynamic thread safety analysis) are enabled for this function.
 ``ssp``
     This attribute indicates that the function should emit a stack
     smashing protector. It is in the form of a "canary" --- a random value
 ``ssp``
     This attribute indicates that the function should emit a stack
     smashing protector. It is in the form of a "canary" --- a random value
@@ -914,12 +920,6 @@ example:
     If a function that has an ``sspstrong`` attribute is inlined into a
     function that doesn't have an ``sspstrong`` attribute, then the
     resulting function will have an ``sspstrong`` attribute.
     If a function that has an ``sspstrong`` attribute is inlined into a
     function that doesn't have an ``sspstrong`` attribute, then the
     resulting function will have an ``sspstrong`` attribute.
-``thread_safety``
-    This attribute indicates that the thread safety analysis is enabled
-    for this function.
-``uninitialized_checks``
-    This attribute indicates that the checks for uses of uninitialized
-    memory are enabled.
 ``uwtable``
     This attribute indicates that the ABI being targeted requires that
     an unwind table entry be produce for this function even if we can
 ``uwtable``
     This attribute indicates that the ABI being targeted requires that
     an unwind table entry be produce for this function even if we can
index f207ad6f751e4c3c4e0aba8339c4d483b52890bb..30c096533774424f7e9865b7230986adc6950e5d 100644 (file)
@@ -63,7 +63,6 @@ public:
   enum AttrKind {
     // IR-Level Attributes
     None,                  ///< No attributes have been set
   enum AttrKind {
     // IR-Level Attributes
     None,                  ///< No attributes have been set
-    AddressSafety,         ///< Address safety checking is on.
     Alignment,             ///< Alignment of parameter (5 bits)
                            ///< stored as log2 of alignment with +1 bias
                            ///< 0 means unaligned (different from align(1))
     Alignment,             ///< Alignment of parameter (5 bits)
                            ///< stored as log2 of alignment with +1 bias
                            ///< 0 means unaligned (different from align(1))
@@ -98,8 +97,9 @@ public:
     StackProtectReq,       ///< Stack protection required.
     StackProtectStrong,    ///< Strong Stack protection.
     StructRet,             ///< Hidden pointer to structure to return
     StackProtectReq,       ///< Stack protection required.
     StackProtectStrong,    ///< Strong Stack protection.
     StructRet,             ///< Hidden pointer to structure to return
-    ThreadSafety,          ///< Thread safety checking is on.
-    UninitializedChecks,   ///< Checking for uses of uninitialized memory is on.
+    SanitizeAddress,       ///< AddressSanitizer is on.
+    SanitizeThread,        ///< ThreadSanitizer is on.
+    SanitizeMemory,        ///< MemorySanitizer is on.
     UWTable,               ///< Function must be in a unwind table
     ZExt,                  ///< Zero extended before/after call
 
     UWTable,               ///< Function must be in a unwind table
     ZExt,                  ///< Zero extended before/after call
 
index 9a1edc763f18f62302ceab86eb37aa9cacf323e6..38bf5dde39f9baca603113455e680eedb64b405c 100644 (file)
@@ -287,7 +287,7 @@ getLoadLoadClobberFullWidthSize(const Value *MemLocBase, int64_t MemLocOffs,
   // Load widening is hostile to ThreadSanitizer: it may cause false positives
   // or make the reports more cryptic (access sizes are wrong).
   if (LI->getParent()->getParent()->getAttributes().
   // Load widening is hostile to ThreadSanitizer: it may cause false positives
   // or make the reports more cryptic (access sizes are wrong).
   if (LI->getParent()->getParent()->getAttributes().
-      hasAttribute(AttributeSet::FunctionIndex, Attribute::ThreadSafety))
+      hasAttribute(AttributeSet::FunctionIndex, Attribute::SanitizeThread))
     return 0;
   
   // Get the base of this load.
     return 0;
   
   // Get the base of this load.
@@ -334,7 +334,7 @@ getLoadLoadClobberFullWidthSize(const Value *MemLocBase, int64_t MemLocOffs,
 
     if (LIOffs+NewLoadByteSize > MemLocEnd &&
         LI->getParent()->getParent()->getAttributes().
 
     if (LIOffs+NewLoadByteSize > MemLocEnd &&
         LI->getParent()->getParent()->getAttributes().
-          hasAttribute(AttributeSet::FunctionIndex, Attribute::AddressSafety))
+          hasAttribute(AttributeSet::FunctionIndex, Attribute::SanitizeAddress))
       // We will be reading past the location accessed by the original program.
       // While this is safe in a regular build, Address Safety analysis tools
       // may start reporting false warnings. So, don't do widening.
       // We will be reading past the location accessed by the original program.
       // While this is safe in a regular build, Address Safety analysis tools
       // may start reporting false warnings. So, don't do widening.
index 2b14559f3e5a849d84d1cc610da4d50b30a2e3e3..f46383be7e4681499b1a8ef24aa3e63678d4b799 100644 (file)
@@ -562,7 +562,6 @@ lltok::Kind LLLexer::LexIdentifier() {
 
   KEYWORD(attributes);
 
 
   KEYWORD(attributes);
 
-  KEYWORD(address_safety);
   KEYWORD(alwaysinline);
   KEYWORD(byval);
   KEYWORD(inlinehint);
   KEYWORD(alwaysinline);
   KEYWORD(byval);
   KEYWORD(inlinehint);
@@ -589,8 +588,9 @@ lltok::Kind LLLexer::LexIdentifier() {
   KEYWORD(ssp);
   KEYWORD(sspreq);
   KEYWORD(sspstrong);
   KEYWORD(ssp);
   KEYWORD(sspreq);
   KEYWORD(sspstrong);
-  KEYWORD(thread_safety);
-  KEYWORD(uninitialized_checks);
+  KEYWORD(sanitize_address);
+  KEYWORD(sanitize_thread);
+  KEYWORD(sanitize_memory);
   KEYWORD(uwtable);
   KEYWORD(zeroext);
 
   KEYWORD(uwtable);
   KEYWORD(zeroext);
 
index bde18cd9fcc6a095471d0871f72fd4f6c8f7b06d..c8da1f8bc661dd9186d04c57fff8149b575ac964 100644 (file)
@@ -907,29 +907,29 @@ bool LLParser::ParseFnAttributeValuePairs(AttrBuilder &B,
       B.addStackAlignmentAttr(Alignment);
       continue;
     }
       B.addStackAlignmentAttr(Alignment);
       continue;
     }
-    case lltok::kw_address_safety:  B.addAttribute(Attribute::AddressSafety); break;
-    case lltok::kw_alwaysinline:    B.addAttribute(Attribute::AlwaysInline); break;
-    case lltok::kw_inlinehint:      B.addAttribute(Attribute::InlineHint); break;
-    case lltok::kw_minsize:         B.addAttribute(Attribute::MinSize); break;
-    case lltok::kw_naked:           B.addAttribute(Attribute::Naked); break;
-    case lltok::kw_nobuiltin:       B.addAttribute(Attribute::NoBuiltin); break;
-    case lltok::kw_noduplicate:     B.addAttribute(Attribute::NoDuplicate); break;
-    case lltok::kw_noimplicitfloat: B.addAttribute(Attribute::NoImplicitFloat); break;
-    case lltok::kw_noinline:        B.addAttribute(Attribute::NoInline); break;
-    case lltok::kw_nonlazybind:     B.addAttribute(Attribute::NonLazyBind); break;
-    case lltok::kw_noredzone:       B.addAttribute(Attribute::NoRedZone); break;
-    case lltok::kw_noreturn:        B.addAttribute(Attribute::NoReturn); break;
-    case lltok::kw_nounwind:        B.addAttribute(Attribute::NoUnwind); break;
-    case lltok::kw_optsize:         B.addAttribute(Attribute::OptimizeForSize); break;
-    case lltok::kw_readnone:        B.addAttribute(Attribute::ReadNone); break;
-    case lltok::kw_readonly:        B.addAttribute(Attribute::ReadOnly); break;
-    case lltok::kw_returns_twice:   B.addAttribute(Attribute::ReturnsTwice); break;
-    case lltok::kw_ssp:             B.addAttribute(Attribute::StackProtect); break;
-    case lltok::kw_sspreq:          B.addAttribute(Attribute::StackProtectReq); break;
-    case lltok::kw_sspstrong:       B.addAttribute(Attribute::StackProtectStrong); break;
-    case lltok::kw_thread_safety:   B.addAttribute(Attribute::ThreadSafety); break;
-    case lltok::kw_uninitialized_checks: B.addAttribute(Attribute::UninitializedChecks); break;
-    case lltok::kw_uwtable:         B.addAttribute(Attribute::UWTable); break;
+    case lltok::kw_alwaysinline:      B.addAttribute(Attribute::AlwaysInline); break;
+    case lltok::kw_inlinehint:        B.addAttribute(Attribute::InlineHint); break;
+    case lltok::kw_minsize:           B.addAttribute(Attribute::MinSize); break;
+    case lltok::kw_naked:             B.addAttribute(Attribute::Naked); break;
+    case lltok::kw_nobuiltin:         B.addAttribute(Attribute::NoBuiltin); break;
+    case lltok::kw_noduplicate:       B.addAttribute(Attribute::NoDuplicate); break;
+    case lltok::kw_noimplicitfloat:   B.addAttribute(Attribute::NoImplicitFloat); break;
+    case lltok::kw_noinline:          B.addAttribute(Attribute::NoInline); break;
+    case lltok::kw_nonlazybind:       B.addAttribute(Attribute::NonLazyBind); break;
+    case lltok::kw_noredzone:         B.addAttribute(Attribute::NoRedZone); break;
+    case lltok::kw_noreturn:          B.addAttribute(Attribute::NoReturn); break;
+    case lltok::kw_nounwind:          B.addAttribute(Attribute::NoUnwind); break;
+    case lltok::kw_optsize:           B.addAttribute(Attribute::OptimizeForSize); break;
+    case lltok::kw_readnone:          B.addAttribute(Attribute::ReadNone); break;
+    case lltok::kw_readonly:          B.addAttribute(Attribute::ReadOnly); break;
+    case lltok::kw_returns_twice:     B.addAttribute(Attribute::ReturnsTwice); break;
+    case lltok::kw_ssp:               B.addAttribute(Attribute::StackProtect); break;
+    case lltok::kw_sspreq:            B.addAttribute(Attribute::StackProtectReq); break;
+    case lltok::kw_sspstrong:         B.addAttribute(Attribute::StackProtectStrong); break;
+    case lltok::kw_sanitize_address:  B.addAttribute(Attribute::SanitizeAddress); break;
+    case lltok::kw_sanitize_thread:   B.addAttribute(Attribute::SanitizeThread); break;
+    case lltok::kw_sanitize_memory:   B.addAttribute(Attribute::SanitizeMemory); break;
+    case lltok::kw_uwtable:           B.addAttribute(Attribute::UWTable); break;
 
     // Error handling.
     case lltok::kw_inreg:
 
     // Error handling.
     case lltok::kw_inreg:
@@ -1159,17 +1159,17 @@ bool LLParser::ParseOptionalParamAttrs(AttrBuilder &B) {
     case lltok::kw_sret:            B.addAttribute(Attribute::StructRet); break;
     case lltok::kw_zeroext:         B.addAttribute(Attribute::ZExt); break;
 
     case lltok::kw_sret:            B.addAttribute(Attribute::StructRet); break;
     case lltok::kw_zeroext:         B.addAttribute(Attribute::ZExt); break;
 
-    case lltok::kw_noreturn:       case lltok::kw_nounwind:
-    case lltok::kw_uwtable:        case lltok::kw_returns_twice:
-    case lltok::kw_noinline:       case lltok::kw_readnone:
-    case lltok::kw_readonly:       case lltok::kw_inlinehint:
-    case lltok::kw_alwaysinline:   case lltok::kw_optsize:
-    case lltok::kw_ssp:            case lltok::kw_sspreq:
-    case lltok::kw_noredzone:      case lltok::kw_noimplicitfloat:
-    case lltok::kw_naked:          case lltok::kw_nonlazybind:
-    case lltok::kw_address_safety: case lltok::kw_minsize:
-    case lltok::kw_alignstack:     case lltok::kw_thread_safety:
-    case lltok::kw_nobuiltin:      case lltok::kw_uninitialized_checks:
+    case lltok::kw_alignstack:      case lltok::kw_nounwind:
+    case lltok::kw_alwaysinline:    case lltok::kw_optsize:
+    case lltok::kw_inlinehint:      case lltok::kw_readnone:
+    case lltok::kw_minsize:         case lltok::kw_readonly:
+    case lltok::kw_naked:           case lltok::kw_returns_twice:
+    case lltok::kw_nobuiltin:       case lltok::kw_sanitize_address:
+    case lltok::kw_noimplicitfloat: case lltok::kw_sanitize_memory:
+    case lltok::kw_noinline:        case lltok::kw_sanitize_thread:
+    case lltok::kw_nonlazybind:     case lltok::kw_ssp:
+    case lltok::kw_noredzone:       case lltok::kw_sspreq:
+    case lltok::kw_noreturn:        case lltok::kw_uwtable:
       HaveError |= Error(Lex.getLoc(), "invalid use of function-only attribute");
       break;
     }
       HaveError |= Error(Lex.getLoc(), "invalid use of function-only attribute");
       break;
     }
@@ -1200,19 +1200,19 @@ bool LLParser::ParseOptionalReturnAttrs(AttrBuilder &B) {
       HaveError |= Error(Lex.getLoc(), "invalid use of parameter-only attribute");
       break;
 
       HaveError |= Error(Lex.getLoc(), "invalid use of parameter-only attribute");
       break;
 
-    case lltok::kw_noreturn:       case lltok::kw_nounwind:
-    case lltok::kw_uwtable:        case lltok::kw_returns_twice:
-    case lltok::kw_noinline:       case lltok::kw_readnone:
-    case lltok::kw_readonly:       case lltok::kw_inlinehint:
-    case lltok::kw_alwaysinline:   case lltok::kw_optsize:
-    case lltok::kw_ssp:            case lltok::kw_sspreq:
-    case lltok::kw_sspstrong:      case lltok::kw_noimplicitfloat:
-    case lltok::kw_noredzone:      case lltok::kw_naked:
-    case lltok::kw_nonlazybind:    case lltok::kw_address_safety:
-    case lltok::kw_minsize:        case lltok::kw_alignstack:
-    case lltok::kw_align:          case lltok::kw_noduplicate:
-    case lltok::kw_thread_safety:  case lltok::kw_uninitialized_checks:
-    case lltok::kw_nobuiltin:
+    case lltok::kw_align:                 case lltok::kw_noreturn:
+    case lltok::kw_alignstack:            case lltok::kw_nounwind:
+    case lltok::kw_alwaysinline:          case lltok::kw_optsize:
+    case lltok::kw_inlinehint:            case lltok::kw_readnone:
+    case lltok::kw_minsize:               case lltok::kw_readonly:
+    case lltok::kw_naked:                 case lltok::kw_returns_twice:
+    case lltok::kw_nobuiltin:             case lltok::kw_sanitize_address:
+    case lltok::kw_noduplicate:           case lltok::kw_sanitize_memory:
+    case lltok::kw_noimplicitfloat:       case lltok::kw_sanitize_thread:
+    case lltok::kw_noinline:              case lltok::kw_ssp:
+    case lltok::kw_nonlazybind:           case lltok::kw_sspreq:
+    case lltok::kw_noredzone:             case lltok::kw_sspstrong:
+                                          case lltok::kw_uwtable:
       HaveError |= Error(Lex.getLoc(), "invalid use of function-only attribute");
       break;
     }
       HaveError |= Error(Lex.getLoc(), "invalid use of function-only attribute");
       break;
     }
index a51dadacf06701d907fe8fd24a4a5558770c8d86..cd25ba30008fdc6b3532a1e14317773ccbbeb358 100644 (file)
@@ -94,7 +94,7 @@ namespace lltok {
     // Attributes:
     kw_attributes,
     kw_alwaysinline,
     // Attributes:
     kw_attributes,
     kw_alwaysinline,
-    kw_address_safety,
+    kw_sanitize_address,
     kw_byval,
     kw_inlinehint,
     kw_inreg,
     kw_byval,
     kw_inlinehint,
     kw_inreg,
@@ -120,8 +120,8 @@ namespace lltok {
     kw_sspreq,
     kw_sspstrong,
     kw_sret,
     kw_sspreq,
     kw_sspstrong,
     kw_sret,
-    kw_thread_safety,
-    kw_uninitialized_checks,
+    kw_sanitize_thread,
+    kw_sanitize_memory,
     kw_uwtable,
     kw_zeroext,
 
     kw_uwtable,
     kw_zeroext,
 
index 11ed82d7955726a836afc137b1f62706e83c2dbe..6eb51f0edcb078506d0918f4cd53faea743b3aa2 100644 (file)
@@ -153,8 +153,8 @@ unsigned Attribute::getStackAlignment() const {
 std::string Attribute::getAsString(bool InAttrGrp) const {
   if (!pImpl) return "";
 
 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))
   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";
     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))
   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::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::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");
   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::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);
     .removeAttribute(Attribute::MinSize)
     .removeAttribute(Attribute::NoDuplicate)
     .removeAttribute(Attribute::NoBuiltin);
index 33e8ec651dd4f87fac06116937985fcb5c75ade3..8bfbb322cf4c4551eb9cefdfc274221a8b71c7cd 100644 (file)
@@ -650,9 +650,9 @@ void Verifier::VerifyParameterAttrs(AttributeSet Attrs, uint64_t Idx, Type *Ty,
           !Attrs.hasAttribute(Idx, Attribute::UWTable) &&
           !Attrs.hasAttribute(Idx, Attribute::NonLazyBind) &&
           !Attrs.hasAttribute(Idx, Attribute::ReturnsTwice) &&
           !Attrs.hasAttribute(Idx, Attribute::UWTable) &&
           !Attrs.hasAttribute(Idx, Attribute::NonLazyBind) &&
           !Attrs.hasAttribute(Idx, Attribute::ReturnsTwice) &&
-          !Attrs.hasAttribute(Idx, Attribute::AddressSafety) &&
-          !Attrs.hasAttribute(Idx, Attribute::ThreadSafety) &&
-          !Attrs.hasAttribute(Idx, Attribute::UninitializedChecks) &&
+          !Attrs.hasAttribute(Idx, Attribute::SanitizeAddress) &&
+          !Attrs.hasAttribute(Idx, Attribute::SanitizeThread) &&
+          !Attrs.hasAttribute(Idx, Attribute::SanitizeMemory) &&
           !Attrs.hasAttribute(Idx, Attribute::MinSize) &&
           !Attrs.hasAttribute(Idx, Attribute::NoBuiltin),
           "Some attributes in '" + Attrs.getAsString(Idx) +
           !Attrs.hasAttribute(Idx, Attribute::MinSize) &&
           !Attrs.hasAttribute(Idx, Attribute::NoBuiltin),
           "Some attributes in '" + Attrs.getAsString(Idx) +
index f116657192b22a63ed2af8843737c93776bb656b..6877475b1d574b318b7b2188096d920d5e1f8f16 100644 (file)
@@ -1098,11 +1098,11 @@ bool AddressSanitizer::runOnFunction(Function &F) {
   DEBUG(dbgs() << "ASAN instrumenting:\n" << F << "\n");
   initializeCallbacks(*F.getParent());
 
   DEBUG(dbgs() << "ASAN instrumenting:\n" << F << "\n");
   initializeCallbacks(*F.getParent());
 
-  // If needed, insert __asan_init before checking for AddressSafety attr.
+  // If needed, insert __asan_init before checking for SanitizeAddress attr.
   maybeInsertAsanInitAtFunctionEntry(F);
 
   if (!F.getAttributes().hasAttribute(AttributeSet::FunctionIndex,
   maybeInsertAsanInitAtFunctionEntry(F);
 
   if (!F.getAttributes().hasAttribute(AttributeSet::FunctionIndex,
-                                      Attribute::AddressSafety))
+                                      Attribute::SanitizeAddress))
     return false;
 
   if (!ClDebugFunc.empty() && ClDebugFunc != F.getName())
     return false;
 
   if (!ClDebugFunc.empty() && ClDebugFunc != F.getName())
index 764dc3f6ea913acd613566c9086ddfc61f043fe4..6c46e94012a5e9238bbd3356d6ba1c95ee7d5cce 100644 (file)
@@ -157,17 +157,17 @@ define void @f26() nonlazybind
         ret void;
 }
 
         ret void;
 }
 
-define void @f27() address_safety
+define void @f27() sanitize_address
 ; CHECK: define void @f27() #17
 {
         ret void;
 }
 ; CHECK: define void @f27() #17
 {
         ret void;
 }
-define void @f28() thread_safety
+define void @f28() sanitize_thread
 ; CHECK: define void @f28() #18
 {
         ret void;
 }
 ; CHECK: define void @f28() #18
 {
         ret void;
 }
-define void @f29() uninitialized_checks
+define void @f29() sanitize_memory
 ; CHECK: define void @f29() #19
 {
         ret void;
 ; CHECK: define void @f29() #19
 {
         ret void;
@@ -196,7 +196,7 @@ define void @f30() "cpu"="cortex-a8"
 ; CHECK: attributes #14 = { returns_twice }
 ; CHECK: attributes #15 = { uwtable }
 ; CHECK: attributes #16 = { nonlazybind }
 ; CHECK: attributes #14 = { returns_twice }
 ; CHECK: attributes #15 = { uwtable }
 ; CHECK: attributes #16 = { nonlazybind }
-; CHECK: attributes #17 = { address_safety }
-; CHECK: attributes #18 = { thread_safety }
-; CHECK: attributes #19 = { uninitialized_checks }
+; CHECK: attributes #17 = { sanitize_address }
+; CHECK: attributes #18 = { sanitize_thread }
+; CHECK: attributes #19 = { sanitize_memory }
 ; CHECK: attributes #20 = { "cpu"="cortex-a8" }
 ; CHECK: attributes #20 = { "cpu"="cortex-a8" }
index 276d0db9a4f3a52b803081bb553d19511346e040..6d2196206e7c0a93db5ea454ce4325a1c0b64dad 100644 (file)
@@ -431,7 +431,7 @@ return:                                           ; preds = %entry
 ; uitofp expands to an FCMOV instruction which splits the basic block.
 ; Make sure the live range of %AL isn't split.
 @.str = private unnamed_addr constant { [1 x i8], [63 x i8] } zeroinitializer, align 32
 ; uitofp expands to an FCMOV instruction which splits the basic block.
 ; Make sure the live range of %AL isn't split.
 @.str = private unnamed_addr constant { [1 x i8], [63 x i8] } zeroinitializer, align 32
-define void @pr13188(i64* nocapture %this) uwtable ssp address_safety align 2 {
+define void @pr13188(i64* nocapture %this) uwtable ssp sanitize_address align 2 {
 entry:
   %x7 = load i64* %this, align 8
   %sub = add i64 %x7, -1
 entry:
   %x7 = load i64* %this, align 8
   %sub = add i64 %x7, -1
index 35c5c4a0bba4e470bb5b8f43c1a8b85cfdd88064..38168fc2d68da95d5e78cf19ad39fb2172de47f5 100644 (file)
@@ -36,14 +36,14 @@ target triple = "i386-unknown-linux-gnu"
 @ff_mlp_firorder_7 = external global i8
 @ff_mlp_firorder_8 = external global i8
 
 @ff_mlp_firorder_7 = external global i8
 @ff_mlp_firorder_8 = external global i8
 
-define void @ff_mlp_init_x86(%struct.DSPContext* nocapture %c, %struct.AVCodecContext* nocapture %avctx) nounwind address_safety {
+define void @ff_mlp_init_x86(%struct.DSPContext* nocapture %c, %struct.AVCodecContext* nocapture %avctx) nounwind sanitize_address {
 entry:
   %mlp_filter_channel = getelementptr inbounds %struct.DSPContext* %c, i32 0, i32 131
   store void (i32*, i32*, i32, i32, i32, i32, i32, i32*)* @mlp_filter_channel_x86, void (i32*, i32*, i32, i32, i32, i32, i32, i32*)** %mlp_filter_channel, align 4, !tbaa !0
   ret void
 }
 
 entry:
   %mlp_filter_channel = getelementptr inbounds %struct.DSPContext* %c, i32 0, i32 131
   store void (i32*, i32*, i32, i32, i32, i32, i32, i32*)* @mlp_filter_channel_x86, void (i32*, i32*, i32, i32, i32, i32, i32, i32*)** %mlp_filter_channel, align 4, !tbaa !0
   ret void
 }
 
-define internal void @mlp_filter_channel_x86(i32* %state, i32* %coeff, i32 %firorder, i32 %iirorder, i32 %filter_shift, i32 %mask, i32 %blocksize, i32* %sample_buffer) nounwind address_safety {
+define internal void @mlp_filter_channel_x86(i32* %state, i32* %coeff, i32 %firorder, i32 %iirorder, i32 %filter_shift, i32 %mask, i32 %blocksize, i32* %sample_buffer) nounwind sanitize_address {
 entry:
   %filter_shift.addr = alloca i32, align 4
   %mask.addr = alloca i32, align 4
 entry:
   %filter_shift.addr = alloca i32, align 4
   %mask.addr = alloca i32, align 4
index c0fe15e9fcecb99667ad2599d3fe148661703ad4..da8f54137598ed2b72214139190944eff76e7090 100644 (file)
@@ -11,9 +11,9 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3
 
 @f = global %struct_of_7_bytes_4_aligned zeroinitializer, align 4
 
 
 @f = global %struct_of_7_bytes_4_aligned zeroinitializer, align 4
 
-; Accessing bytes 4 and 6, not ok to widen to i32 if address_safety is set.
+; Accessing bytes 4 and 6, not ok to widen to i32 if sanitize_address is set.
 
 
-define i32 @test_widening_bad(i8* %P) nounwind ssp noredzone address_safety {
+define i32 @test_widening_bad(i8* %P) nounwind ssp noredzone sanitize_address {
 entry:
   %tmp = load i8* getelementptr inbounds (%struct_of_7_bytes_4_aligned* @f, i64 0, i32 1), align 4
   %conv = zext i8 %tmp to i32
 entry:
   %tmp = load i8* getelementptr inbounds (%struct_of_7_bytes_4_aligned* @f, i64 0, i32 1), align 4
   %conv = zext i8 %tmp to i32
@@ -36,7 +36,7 @@ define void @end_test_widening_bad() {
 
 ;; Accessing bytes 4 and 5. Ok to widen to i16.
 
 
 ;; Accessing bytes 4 and 5. Ok to widen to i16.
 
-define i32 @test_widening_ok(i8* %P) nounwind ssp noredzone address_safety {
+define i32 @test_widening_ok(i8* %P) nounwind ssp noredzone sanitize_address {
 entry:
   %tmp = load i8* getelementptr inbounds (%struct_of_7_bytes_4_aligned* @f, i64 0, i32 1), align 4
   %conv = zext i8 %tmp to i32
 entry:
   %tmp = load i8* getelementptr inbounds (%struct_of_7_bytes_4_aligned* @f, i64 0, i32 1), align 4
   %conv = zext i8 %tmp to i32
index 2f1b79e50417cb6204932f047bbb0664cc3d4bab..c477b199046f7ae878e932d15ac5605cde30afd0 100644 (file)
@@ -5,7 +5,7 @@
 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
 target triple = "x86_64-unknown-linux-gnu"
 
 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
 target triple = "x86_64-unknown-linux-gnu"
 
-define i32 @test_load(i32* %a) address_safety {
+define i32 @test_load(i32* %a) sanitize_address {
 ; CHECK: @test_load
 ; CHECK-NOT: load
 ; CHECK:   %[[LOAD_ADDR:[^ ]*]] = ptrtoint i32* %a to i64
 ; CHECK: @test_load
 ; CHECK-NOT: load
 ; CHECK:   %[[LOAD_ADDR:[^ ]*]] = ptrtoint i32* %a to i64
@@ -38,7 +38,7 @@ entry:
   ret i32 %tmp1
 }
 
   ret i32 %tmp1
 }
 
-define void @test_store(i32* %a) address_safety {
+define void @test_store(i32* %a) sanitize_address {
 ; CHECK: @test_store
 ; CHECK-NOT: store
 ; CHECK:   %[[STORE_ADDR:[^ ]*]] = ptrtoint i32* %a to i64
 ; CHECK: @test_store
 ; CHECK-NOT: store
 ; CHECK:   %[[STORE_ADDR:[^ ]*]] = ptrtoint i32* %a to i64
@@ -73,7 +73,7 @@ entry:
 ; Check that asan leaves just one alloca.
 
 declare void @alloca_test_use([10 x i8]*)
 ; Check that asan leaves just one alloca.
 
 declare void @alloca_test_use([10 x i8]*)
-define void @alloca_test() address_safety {
+define void @alloca_test() sanitize_address {
 entry:
   %x = alloca [10 x i8], align 1
   %y = alloca [10 x i8], align 1
 entry:
   %x = alloca [10 x i8], align 1
   %y = alloca [10 x i8], align 1
@@ -89,7 +89,7 @@ entry:
 ; CHECK-NOT: = alloca
 ; CHECK: ret void
 
 ; CHECK-NOT: = alloca
 ; CHECK: ret void
 
-define void @LongDoubleTest(x86_fp80* nocapture %a) nounwind uwtable address_safety {
+define void @LongDoubleTest(x86_fp80* nocapture %a) nounwind uwtable sanitize_address {
 entry:
     store x86_fp80 0xK3FFF8000000000000000, x86_fp80* %a, align 16
     ret void
 entry:
     store x86_fp80 0xK3FFF8000000000000000, x86_fp80* %a, align 16
     ret void
@@ -101,7 +101,7 @@ entry:
 ; CHECK: ret void
 
 
 ; CHECK: ret void
 
 
-define void @i40test(i40* %a, i40* %b) nounwind uwtable address_safety {
+define void @i40test(i40* %a, i40* %b) nounwind uwtable sanitize_address {
   entry:
   %t = load i40* %a
   store i40 %t, i40* %b, align 8
   entry:
   %t = load i40* %a
   store i40 %t, i40* %b, align 8
@@ -115,7 +115,7 @@ define void @i40test(i40* %a, i40* %b) nounwind uwtable address_safety {
 ; CHECK: __asan_report_store_n{{.*}}, i64 5)
 ; CHECK: ret void
 
 ; CHECK: __asan_report_store_n{{.*}}, i64 5)
 ; CHECK: ret void
 
-define void @i80test(i80* %a, i80* %b) nounwind uwtable address_safety {
+define void @i80test(i80* %a, i80* %b) nounwind uwtable sanitize_address {
   entry:
   %t = load i80* %a
   store i80 %t, i80* %b, align 8
   entry:
   %t = load i80* %a
   store i80 %t, i80* %b, align 8
index f686ac1c52bd8046beec4b5bdf137b70453aff9e..7822fd06ab317a4d8d993c340abb659fad8f9372 100644 (file)
@@ -6,7 +6,7 @@
 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
 target triple = "x86_64-unknown-linux-gnu"
 
 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
 target triple = "x86_64-unknown-linux-gnu"
 
-define i32 @_Z3zzzi(i32 %p) nounwind uwtable address_safety {
+define i32 @_Z3zzzi(i32 %p) nounwind uwtable sanitize_address {
 entry:
   %p.addr = alloca i32, align 4
   %r = alloca i32, align 4
 entry:
   %p.addr = alloca i32, align 4
   %r = alloca i32, align 4
index c07069c2dcb6a73929c64d1f123fbce0d91a1cf9..b0371769be05a3d2c9af488902f527717f37fef9 100644 (file)
@@ -9,7 +9,7 @@ target triple = "x86_64-unknown-linux-gnu"
 ; CHECK: @__asan_mapping_offset = linkonce_odr constant i64 0
 ; CHECK: @__asan_mapping_scale = linkonce_odr constant i64 2
 
 ; CHECK: @__asan_mapping_offset = linkonce_odr constant i64 0
 ; CHECK: @__asan_mapping_scale = linkonce_odr constant i64 2
 
-define i32 @test_load(i32* %a) address_safety {
+define i32 @test_load(i32* %a) sanitize_address {
 ; CHECK: @test_load
 ; CHECK-NOT: load
 ; CHECK:   %[[LOAD_ADDR:[^ ]*]] = ptrtoint i32* %a to i64
 ; CHECK: @test_load
 ; CHECK-NOT: load
 ; CHECK:   %[[LOAD_ADDR:[^ ]*]] = ptrtoint i32* %a to i64
index 28d4ac0c0f589c699b4ffbeb96ecc891cb525876..2efd6b1e0d128e134d613ab97300ee51d9266ca9 100644 (file)
@@ -5,7 +5,7 @@
 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
 target triple = "x86_64-unknown-linux-gnu"
 
 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
 target triple = "x86_64-unknown-linux-gnu"
 
-define void @_Z3barv() uwtable address_safety {
+define void @_Z3barv() uwtable sanitize_address {
 entry:
   %a = alloca i32, align 4
   call void @_Z3fooPi(i32* %a)
 entry:
   %a = alloca i32, align 4
   call void @_Z3fooPi(i32* %a)
index 59654cbf208849fe99c79f92ea3caf87d8ace645..2d835a34080a1959ab70bb5e6623036ea6e625a9 100644 (file)
@@ -7,7 +7,7 @@ target triple = "x86_64-unknown-linux-gnu"
 
 declare void @MyNoReturnFunc(i32) noreturn
 
 
 declare void @MyNoReturnFunc(i32) noreturn
 
-define i32 @Call1(i8* nocapture %arg) uwtable address_safety {
+define i32 @Call1(i8* nocapture %arg) uwtable sanitize_address {
 entry:
   call void @MyNoReturnFunc(i32 1) noreturn  ; The call insn has noreturn attr.
 ; CHECK:        @Call1
 entry:
   call void @MyNoReturnFunc(i32 1) noreturn  ; The call insn has noreturn attr.
 ; CHECK:        @Call1
@@ -17,7 +17,7 @@ entry:
   unreachable
 }
 
   unreachable
 }
 
-define i32 @Call2(i8* nocapture %arg) uwtable address_safety {
+define i32 @Call2(i8* nocapture %arg) uwtable sanitize_address {
 entry:
   call void @MyNoReturnFunc(i32 1)  ; No noreturn attribure on the call.
 ; CHECK:        @Call2
 entry:
   call void @MyNoReturnFunc(i32 1)  ; No noreturn attribure on the call.
 ; CHECK:        @Call2
@@ -29,7 +29,7 @@ entry:
 
 declare i32 @__gxx_personality_v0(...)
 
 
 declare i32 @__gxx_personality_v0(...)
 
-define i64 @Invoke1(i8** %esc) nounwind uwtable ssp address_safety {
+define i64 @Invoke1(i8** %esc) nounwind uwtable ssp sanitize_address {
 entry:
   invoke void @MyNoReturnFunc(i32 1)
           to label %invoke.cont unwind label %lpad
 entry:
   invoke void @MyNoReturnFunc(i32 1)
           to label %invoke.cont unwind label %lpad
index 042c06ba969215f8845d5ba1e82d2a416c485d38..584db3762baed059088fa5a7b96a3fa59e0fa0c4 100644 (file)
@@ -23,7 +23,7 @@ entry:
   ret void
 }
 
   ret void
 }
 
-define internal void @_GLOBAL__I_a() address_safety section ".text.startup" {
+define internal void @_GLOBAL__I_a() sanitize_address section ".text.startup" {
 entry:
   call void @__cxx_global_var_init()
   ret void
 entry:
   call void @__cxx_global_var_init()
   ret void
@@ -40,7 +40,7 @@ entry:
 ; CHECK: ret
 
 ; Check that xxx is instrumented.
 ; CHECK: ret
 
 ; Check that xxx is instrumented.
-define void @touch_xxx() address_safety {
+define void @touch_xxx() sanitize_address {
   store i32 0, i32 *@xxx, align 4
   ret void
 ; CHECK: define void @touch_xxx
   store i32 0, i32 *@xxx, align 4
   ret void
 ; CHECK: define void @touch_xxx
@@ -49,7 +49,7 @@ define void @touch_xxx() address_safety {
 }
 
 ; Check that XXX is instrumented.
 }
 
 ; Check that XXX is instrumented.
-define void @touch_XXX() address_safety {
+define void @touch_XXX() sanitize_address {
   store i32 0, i32 *@XXX, align 4
   ret void
 ; CHECK: define void @touch_XXX
   store i32 0, i32 *@XXX, align 4
   ret void
 ; CHECK: define void @touch_XXX
@@ -59,7 +59,7 @@ define void @touch_XXX() address_safety {
 
 
 ; Check that yyy is NOT instrumented (as it does not have dynamic initializer).
 
 
 ; Check that yyy is NOT instrumented (as it does not have dynamic initializer).
-define void @touch_yyy() address_safety {
+define void @touch_yyy() sanitize_address {
   store i32 0, i32 *@yyy, align 4
   ret void
 ; CHECK: define void @touch_yyy
   store i32 0, i32 *@yyy, align 4
   ret void
 ; CHECK: define void @touch_yyy
@@ -68,7 +68,7 @@ define void @touch_yyy() address_safety {
 }
 
 ; Check that YYY is NOT instrumented (as it does not have dynamic initializer).
 }
 
 ; Check that YYY is NOT instrumented (as it does not have dynamic initializer).
-define void @touch_YYY() address_safety {
+define void @touch_YYY() sanitize_address {
   store i32 0, i32 *@YYY, align 4
   ret void
 ; CHECK: define void @touch_YYY
   store i32 0, i32 *@YYY, align 4
   ret void
 ; CHECK: define void @touch_YYY
index 633bf9ae78c02d81660f97125caa3ead95d6288a..23cf6d28ec6cd2409c6f0e038292f09fb17b6031 100644 (file)
@@ -4,7 +4,7 @@
 
 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
 target triple = "x86_64-unknown-linux-gnu"
 
 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
 target triple = "x86_64-unknown-linux-gnu"
-define void @IncrementMe(i32* %a) address_safety {
+define void @IncrementMe(i32* %a) sanitize_address {
 entry:
   %tmp1 = load i32* %a, align 4
   %tmp2 = add i32 %tmp1,  1
 entry:
   %tmp1 = load i32* %a, align 4
   %tmp2 = add i32 %tmp1,  1
index 982ad085ec671948d9d99ad671cb4e5b0ba86503..334872865f1a060496ab91d96a795d0b55459381 100644 (file)
@@ -7,7 +7,7 @@ target triple = "x86_64-unknown-linux-gnu"
 declare void @llvm.lifetime.start(i64, i8* nocapture) nounwind
 declare void @llvm.lifetime.end(i64, i8* nocapture) nounwind
 
 declare void @llvm.lifetime.start(i64, i8* nocapture) nounwind
 declare void @llvm.lifetime.end(i64, i8* nocapture) nounwind
 
-define void @lifetime_no_size() address_safety {
+define void @lifetime_no_size() sanitize_address {
 entry:
   %i = alloca i32, align 4
   %i.ptr = bitcast i32* %i to i8*
 entry:
   %i = alloca i32, align 4
   %i.ptr = bitcast i32* %i to i8*
@@ -23,7 +23,7 @@ entry:
 }
 
 ; Generic case of lifetime analysis.
 }
 
 ; Generic case of lifetime analysis.
-define void @lifetime() address_safety {
+define void @lifetime() sanitize_address {
   ; CHECK: @lifetime
 
   ; Regular variable lifetime intrinsics.
   ; CHECK: @lifetime
 
   ; Regular variable lifetime intrinsics.
@@ -61,7 +61,7 @@ define void @lifetime() address_safety {
 }
 
 ; Check that arguments of lifetime may come from phi nodes.
 }
 
 ; Check that arguments of lifetime may come from phi nodes.
-define void @phi_args(i1 %x) address_safety {
+define void @phi_args(i1 %x) sanitize_address {
   ; CHECK: @phi_args
 
 entry:
   ; CHECK: @phi_args
 
 entry:
index b77869b6f05b01f473c3f5d4edc9321e746e2017..6aa5c2885099412943a407ff2318d1b197e2dcc1 100644 (file)
@@ -1,7 +1,7 @@
 ; RUN: opt < %s -asan -S | FileCheck %s
 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
 target triple = "x86_64-unknown-linux-gnu"
 ; RUN: opt < %s -asan -S | FileCheck %s
 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
 target triple = "x86_64-unknown-linux-gnu"
-define i32 @read_4_bytes(i32* %a) address_safety {
+define i32 @read_4_bytes(i32* %a) sanitize_address {
 entry:
   %tmp1 = load i32* %a, align 4
   ret i32 %tmp1
 entry:
   %tmp1 = load i32* %a, align 4
   ret i32 %tmp1
@@ -13,7 +13,7 @@ entry:
 ; CHECK-NEXT: {{17592186044416|2147450880}}
 ; CHECK: ret
 
 ; CHECK-NEXT: {{17592186044416|2147450880}}
 ; CHECK: ret
 
-define void @example_atomicrmw(i64* %ptr) nounwind uwtable address_safety {
+define void @example_atomicrmw(i64* %ptr) nounwind uwtable sanitize_address {
 entry:
   %0 = atomicrmw add i64* %ptr, i64 1 seq_cst
   ret void
 entry:
   %0 = atomicrmw add i64* %ptr, i64 1 seq_cst
   ret void
@@ -24,7 +24,7 @@ entry:
 ; CHECK: atomicrmw
 ; CHECK: ret
 
 ; CHECK: atomicrmw
 ; CHECK: ret
 
-define void @example_cmpxchg(i64* %ptr, i64 %compare_to, i64 %new_value) nounwind uwtable address_safety {
+define void @example_cmpxchg(i64* %ptr, i64 %compare_to, i64 %new_value) nounwind uwtable sanitize_address {
 entry:
   %0 = cmpxchg i64* %ptr, i64 %compare_to, i64 %new_value seq_cst
   ret void
 entry:
   %0 = cmpxchg i64* %ptr, i64 %compare_to, i64 %new_value seq_cst
   ret void
index 2eee6a5e73007821b6b54abdb3062d86d1eee42e..a83a274bcf6e38f235f750608a36e2e408f935b9 100644 (file)
@@ -8,9 +8,9 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3
 
 @f = global %struct_of_8_bytes_4_aligned zeroinitializer, align 4
 
 
 @f = global %struct_of_8_bytes_4_aligned zeroinitializer, align 4
 
-; Accessing bytes 4 and 6, not ok to widen to i32 if thread_safety is set.
+; Accessing bytes 4 and 6, not ok to widen to i32 if sanitize_thread is set.
 
 
-define i32 @test_widening_bad(i8* %P) nounwind ssp noredzone thread_safety {
+define i32 @test_widening_bad(i8* %P) nounwind ssp noredzone sanitize_thread {
 entry:
   %tmp = load i8* getelementptr inbounds (%struct_of_8_bytes_4_aligned* @f, i64 0, i32 1), align 4
   %conv = zext i8 %tmp to i32
 entry:
   %tmp = load i8* getelementptr inbounds (%struct_of_8_bytes_4_aligned* @f, i64 0, i32 1), align 4
   %conv = zext i8 %tmp to i32
index c550434054fcd3332f6a8ffe82dcac91706250c5..d65f075076cf8ef8eb4c064a8cece328c5d40acf 100644 (file)
@@ -174,9 +174,9 @@ FuncAttr      ::= noreturn
  | sspreq
  | returns_twice
  | nonlazybind
  | sspreq
  | returns_twice
  | nonlazybind
- | address_safety
- | thread_safety
- | uninitialized_checks
+ | sanitize_address
+ | sanitize_thread
+ | sanitize_memory
  ;
 
 OptFuncAttrs  ::= + _ | OptFuncAttrs FuncAttr ;
  ;
 
 OptFuncAttrs  ::= + _ | OptFuncAttrs FuncAttr ;
index 256ef150ed685b138ec3bc84de7631f5f3fc4faa..830476f158b62adcf943db9703739dbaf836b443 100644 (file)
@@ -35,7 +35,7 @@ syn keyword llvmStatement uitofp ule ult umax umin une uno unreachable unwind
 syn keyword llvmStatement urem va_arg xchg xor zext
 
 " Keywords.
 syn keyword llvmStatement urem va_arg xchg xor zext
 
 " Keywords.
-syn keyword llvmKeyword acq_rel acquire address_safety addrspace alias align
+syn keyword llvmKeyword acq_rel acquire sanitize_address addrspace alias align
 syn keyword llvmKeyword alignstack alwaysinline appending arm_aapcs_vfpcc
 syn keyword llvmKeyword arm_aapcscc arm_apcscc asm atomic available_externally
 syn keyword llvmKeyword blockaddress byval c catch cc ccc cleanup coldcc common
 syn keyword llvmKeyword alignstack alwaysinline appending arm_aapcs_vfpcc
 syn keyword llvmKeyword arm_aapcscc arm_apcscc asm atomic available_externally
 syn keyword llvmKeyword blockaddress byval c catch cc ccc cleanup coldcc common
@@ -55,7 +55,7 @@ syn keyword llvmKeyword singlethread spir_func spir_kernel sret ssp sspreq
 syn keyword llvmKeyword sspstrong tail target thread_local to triple
 syn keyword llvmKeyword unnamed_addr unordered uwtable volatile weak weak_odr
 syn keyword llvmKeyword x86_fastcallcc x86_stdcallcc x86_thiscallcc zeroext
 syn keyword llvmKeyword sspstrong tail target thread_local to triple
 syn keyword llvmKeyword unnamed_addr unordered uwtable volatile weak weak_odr
 syn keyword llvmKeyword x86_fastcallcc x86_stdcallcc x86_thiscallcc zeroext
-syn keyword llvmKeyword thread_safety uninitialized_checks
+syn keyword llvmKeyword sanitize_thread sanitize_memory
 
 " Obsolete keywords.
 syn keyword llvmError  getresult begin end
 
 " Obsolete keywords.
 syn keyword llvmError  getresult begin end