diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Analysis/MemoryDependenceAnalysis.cpp | 4 | ||||
-rw-r--r-- | lib/AsmParser/LLLexer.cpp | 6 | ||||
-rw-r--r-- | lib/AsmParser/LLParser.cpp | 94 | ||||
-rw-r--r-- | lib/AsmParser/LLToken.h | 6 | ||||
-rw-r--r-- | lib/IR/Attributes.cpp | 24 | ||||
-rw-r--r-- | lib/IR/Verifier.cpp | 6 | ||||
-rw-r--r-- | lib/Transforms/Instrumentation/AddressSanitizer.cpp | 4 |
7 files changed, 72 insertions, 72 deletions
diff --git a/lib/Analysis/MemoryDependenceAnalysis.cpp b/lib/Analysis/MemoryDependenceAnalysis.cpp index 9a1edc763f..38bf5dde39 100644 --- a/lib/Analysis/MemoryDependenceAnalysis.cpp +++ b/lib/Analysis/MemoryDependenceAnalysis.cpp @@ -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(). - hasAttribute(AttributeSet::FunctionIndex, Attribute::ThreadSafety)) + hasAttribute(AttributeSet::FunctionIndex, Attribute::SanitizeThread)) 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(). - 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. diff --git a/lib/AsmParser/LLLexer.cpp b/lib/AsmParser/LLLexer.cpp index 2b14559f3e..f46383be7e 100644 --- a/lib/AsmParser/LLLexer.cpp +++ b/lib/AsmParser/LLLexer.cpp @@ -562,7 +562,6 @@ lltok::Kind LLLexer::LexIdentifier() { KEYWORD(attributes); - KEYWORD(address_safety); KEYWORD(alwaysinline); KEYWORD(byval); KEYWORD(inlinehint); @@ -589,8 +588,9 @@ lltok::Kind LLLexer::LexIdentifier() { 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); diff --git a/lib/AsmParser/LLParser.cpp b/lib/AsmParser/LLParser.cpp index bde18cd9fc..c8da1f8bc6 100644 --- a/lib/AsmParser/LLParser.cpp +++ b/lib/AsmParser/LLParser.cpp @@ -907,29 +907,29 @@ bool LLParser::ParseFnAttributeValuePairs(AttrBuilder &B, 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: @@ -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_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; } @@ -1200,19 +1200,19 @@ bool LLParser::ParseOptionalReturnAttrs(AttrBuilder &B) { 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; } diff --git a/lib/AsmParser/LLToken.h b/lib/AsmParser/LLToken.h index a51dadacf0..cd25ba3000 100644 --- a/lib/AsmParser/LLToken.h +++ b/lib/AsmParser/LLToken.h @@ -94,7 +94,7 @@ namespace lltok { // Attributes: kw_attributes, kw_alwaysinline, - kw_address_safety, + kw_sanitize_address, kw_byval, kw_inlinehint, kw_inreg, @@ -120,8 +120,8 @@ namespace lltok { kw_sspreq, kw_sspstrong, kw_sret, - kw_thread_safety, - kw_uninitialized_checks, + kw_sanitize_thread, + kw_sanitize_memory, kw_uwtable, kw_zeroext, 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); diff --git a/lib/IR/Verifier.cpp b/lib/IR/Verifier.cpp index 33e8ec651d..8bfbb322cf 100644 --- a/lib/IR/Verifier.cpp +++ b/lib/IR/Verifier.cpp @@ -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::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) + diff --git a/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/lib/Transforms/Instrumentation/AddressSanitizer.cpp index f116657192..6877475b1d 100644 --- a/lib/Transforms/Instrumentation/AddressSanitizer.cpp +++ b/lib/Transforms/Instrumentation/AddressSanitizer.cpp @@ -1098,11 +1098,11 @@ bool AddressSanitizer::runOnFunction(Function &F) { 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, - Attribute::AddressSafety)) + Attribute::SanitizeAddress)) return false; if (!ClDebugFunc.empty() && ClDebugFunc != F.getName()) |