X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=blobdiff_plain;f=lib%2FCodeGen%2FStackProtector.cpp;h=d1fae9558b26649e692ac0e23435836a4e1e0710;hp=2663fecf4aecd79d0e4a62631c625ea51880bd5c;hb=9de77c7eca3bfc58f0efbb49152f375a0e2a7895;hpb=6a50342499a17efe67677fb4094bc4cd5df0768a diff --git a/lib/CodeGen/StackProtector.cpp b/lib/CodeGen/StackProtector.cpp index 2663fecf4ae..d1fae9558b2 100644 --- a/lib/CodeGen/StackProtector.cpp +++ b/lib/CodeGen/StackProtector.cpp @@ -90,8 +90,7 @@ bool StackProtector::runOnFunction(Function &Fn) { DT = DTWP ? &DTWP->getDomTree() : nullptr; TLI = TM->getSubtargetImpl(Fn)->getTargetLowering(); - Attribute Attr = Fn.getAttributes().getAttribute( - AttributeSet::FunctionIndex, "stack-protector-buffer-size"); + Attribute Attr = Fn.getFnAttribute("stack-protector-buffer-size"); if (Attr.isStringAttribute() && Attr.getValueAsString().getAsInteger(10, SSPBufferSize)) return false; // Invalid integer string @@ -201,15 +200,12 @@ bool StackProtector::HasAddressTaken(const Instruction *AI) { bool StackProtector::RequiresStackProtector() { bool Strong = false; bool NeedsProtector = false; - if (F->getAttributes().hasAttribute(AttributeSet::FunctionIndex, - Attribute::StackProtectReq)) { + if (F->hasFnAttribute(Attribute::StackProtectReq)) { NeedsProtector = true; Strong = true; // Use the same heuristic as strong to determine SSPLayout - } else if (F->getAttributes().hasAttribute(AttributeSet::FunctionIndex, - Attribute::StackProtectStrong)) + } else if (F->hasFnAttribute(Attribute::StackProtectStrong)) Strong = true; - else if (!F->getAttributes().hasAttribute(AttributeSet::FunctionIndex, - Attribute::StackProtect)) + else if (!F->hasFnAttribute(Attribute::StackProtect)) return false; for (const BasicBlock &BB : *F) {