summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms/IPO/ArgumentPromotion.cpp')
-rw-r--r--llvm/lib/Transforms/IPO/ArgumentPromotion.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
index c5b17dba515..39062e676c1 100644
--- a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
+++ b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
@@ -519,7 +519,8 @@ CallGraphNode *ArgPromotion::DoPromotion(Function *F,
// Add any return attributes.
if (PAL.hasAttributes(AttributeSet::ReturnIndex))
- AttributesVec.push_back(AttributeWithIndex::get(AttributeSet::ReturnIndex,
+ AttributesVec.push_back(AttributeWithIndex::get(F->getContext(),
+ AttributeSet::ReturnIndex,
PAL.getRetAttributes()));
// First, determine the new argument list
@@ -639,7 +640,8 @@ CallGraphNode *ArgPromotion::DoPromotion(Function *F,
// Add any return attributes.
if (CallPAL.hasAttributes(AttributeSet::ReturnIndex))
- AttributesVec.push_back(AttributeWithIndex::get(AttributeSet::ReturnIndex,
+ AttributesVec.push_back(AttributeWithIndex::get(F->getContext(),
+ AttributeSet::ReturnIndex,
CallPAL.getRetAttributes()));
// Loop over the operands, inserting GEP and loads in the caller as
OpenPOWER on IntegriCloud