Let SRETPromotion properly preserve the function name instead of (implicitly)
authorMatthijs Kooijman <matthijs@stdin.nl>
Thu, 7 Aug 2008 16:01:23 +0000 (16:01 +0000)
committerMatthijs Kooijman <matthijs@stdin.nl>
Thu, 7 Aug 2008 16:01:23 +0000 (16:01 +0000)
postfixing it with a number.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54468 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/IPO/StructRetPromotion.cpp

index ae6d55f06d0234c0ad25709afe7fdb814f44189b..1db7446d2b0482101649d1a7e30b996d8f319d71 100644 (file)
@@ -228,7 +228,8 @@ Function *SRETPromotion::cloneFunctionBody(Function *F,
   }
 
   FunctionType *NFTy = FunctionType::get(STy, Params, FTy->isVarArg());
-  Function *NF = Function::Create(NFTy, F->getLinkage(), F->getName());
+  Function *NF = Function::Create(NFTy, F->getLinkage());
+  NF->takeName(F);
   NF->copyAttributesFrom(F);
   NF->setParamAttrs(PAListPtr::get(ParamAttrsVec.begin(), ParamAttrsVec.end()));
   F->getParent()->getFunctionList().insert(F, NF);