diff options
Diffstat (limited to 'lib/Transforms/IPO/DeadArgumentElimination.cpp')
-rw-r--r-- | lib/Transforms/IPO/DeadArgumentElimination.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/Transforms/IPO/DeadArgumentElimination.cpp b/lib/Transforms/IPO/DeadArgumentElimination.cpp index 9b3efe0962..2dab695224 100644 --- a/lib/Transforms/IPO/DeadArgumentElimination.cpp +++ b/lib/Transforms/IPO/DeadArgumentElimination.cpp @@ -163,10 +163,7 @@ bool DAE::DeleteDeadVarargs(Function &Fn) { // Create the new function body and insert it into the module... Function *NF = Function::Create(NFTy, Fn.getLinkage()); - NF->setCallingConv(Fn.getCallingConv()); - NF->setParamAttrs(Fn.getParamAttrs()); - if (Fn.hasCollector()) - NF->setCollector(Fn.getCollector()); + NF->copyAttributesFrom(&Fn); Fn.getParent()->getFunctionList().insert(&Fn, NF); NF->takeName(&Fn); @@ -556,10 +553,8 @@ void DAE::RemoveDeadArgumentsFromFunction(Function *F) { // Create the new function body and insert it into the module... Function *NF = Function::Create(NFTy, F->getLinkage()); - NF->setCallingConv(F->getCallingConv()); + NF->copyAttributesFrom(F); NF->setParamAttrs(NewPAL); - if (F->hasCollector()) - NF->setCollector(F->getCollector()); F->getParent()->getFunctionList().insert(F, NF); NF->takeName(F); |