summaryrefslogtreecommitdiff
path: root/lib/Transforms/IPO/ArgumentPromotion.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms/IPO/ArgumentPromotion.cpp')
-rw-r--r--lib/Transforms/IPO/ArgumentPromotion.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/Transforms/IPO/ArgumentPromotion.cpp b/lib/Transforms/IPO/ArgumentPromotion.cpp
index b3d783d2ae..7dd94f5bc8 100644
--- a/lib/Transforms/IPO/ArgumentPromotion.cpp
+++ b/lib/Transforms/IPO/ArgumentPromotion.cpp
@@ -478,15 +478,13 @@ Function *ArgPromotion::DoPromotion(Function *F,
// Create the new function body and insert it into the module...
Function *NF = Function::Create(NFTy, F->getLinkage(), F->getName());
- NF->setCallingConv(F->getCallingConv());
+ NF->copyAttributesFrom(F);
// Recompute the parameter attributes list based on the new arguments for
// the function.
NF->setParamAttrs(PAListPtr::get(ParamAttrsVec.begin(), ParamAttrsVec.end()));
ParamAttrsVec.clear();
-
- if (F->hasCollector())
- NF->setCollector(F->getCollector());
+
F->getParent()->getFunctionList().insert(F, NF);
NF->takeName(F);