diff options
Diffstat (limited to 'llvm/lib/Transforms')
4 files changed, 7 insertions, 9 deletions
diff --git a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp index 385544af3f1..15a479e90cc 100644 --- a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp +++ b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp @@ -592,7 +592,7 @@ CallGraphNode *ArgPromotion::DoPromotion(Function *F, // Add any function attributes. attrs = PAL.getFnAttributes(); - if (attrs.hasAttributes()) + if (PAL.hasAttributes(AttributeSet::FunctionIndex)) AttributesVec.push_back(AttributeWithIndex::get(AttributeSet::FunctionIndex, attrs)); @@ -722,7 +722,7 @@ CallGraphNode *ArgPromotion::DoPromotion(Function *F, // Add any function attributes. attrs = CallPAL.getFnAttributes(); - if (attrs.hasAttributes()) + if (CallPAL.hasAttributes(AttributeSet::FunctionIndex)) AttributesVec.push_back(AttributeWithIndex::get(AttributeSet::FunctionIndex, attrs)); diff --git a/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp b/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp index 4757ce80931..5b5a0150d9d 100644 --- a/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp +++ b/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp @@ -277,7 +277,7 @@ bool DAE::DeleteDeadVarargs(Function &Fn) { for (unsigned i = 0; PAL.getSlot(i).Index <= NumArgs; ++i) AttributesVec.push_back(PAL.getSlot(i)); Attribute FnAttrs = PAL.getFnAttributes(); - if (FnAttrs.hasAttributes()) + if (PAL.hasAttributes(AttributeSet::FunctionIndex)) AttributesVec.push_back(AttributeWithIndex::get(AttributeSet::FunctionIndex, FnAttrs)); PAL = AttributeSet::get(Fn.getContext(), AttributesVec); diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp index d17879b587b..63e452ba9c8 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp @@ -1176,7 +1176,7 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) { } Attribute FnAttrs = CallerPAL.getFnAttributes(); - if (FnAttrs.hasAttributes()) + if (CallerPAL.hasAttributes(AttributeSet::FunctionIndex)) attrVec.push_back(AttributeWithIndex::get(AttributeSet::FunctionIndex, FnAttrs)); @@ -1320,7 +1320,7 @@ InstCombiner::transformCallThroughTrampoline(CallSite CS, // Add any function attributes. Attr = Attrs.getFnAttributes(); - if (Attr.hasAttributes()) + if (Attrs.hasAttributes(AttributeSet::FunctionIndex)) NewAttrs.push_back(AttributeWithIndex::get(AttributeSet::FunctionIndex, Attr)); diff --git a/llvm/lib/Transforms/Utils/CloneFunction.cpp b/llvm/lib/Transforms/Utils/CloneFunction.cpp index ccc3eae782c..ad753abebac 100644 --- a/llvm/lib/Transforms/Utils/CloneFunction.cpp +++ b/llvm/lib/Transforms/Utils/CloneFunction.cpp @@ -103,10 +103,8 @@ void llvm::CloneFunctionInto(Function *NewFunc, const Function *OldFunc, OldFunc->getAttributes() .getRetAttributes())); NewFunc->setAttributes(NewFunc->getAttributes() - .addAttr(NewFunc->getContext(), - AttributeSet::FunctionIndex, - OldFunc->getAttributes() - .getFnAttributes())); + .addFnAttributes(NewFunc->getContext(), + OldFunc->getAttributes())); } |