diff options
author | Matthijs Kooijman <matthijs@stdin.nl> | 2008-08-07 16:01:23 +0000 |
---|---|---|
committer | Matthijs Kooijman <matthijs@stdin.nl> | 2008-08-07 16:01:23 +0000 |
commit | 7d942001fa4384c02b991f997e3862067d4f4a62 (patch) | |
tree | 6d966f0ddfdc16c8db2682545372615ad2a2f0df /lib/Transforms/IPO | |
parent | a7bab2c81c2b7340d210b9cf9221c5157d60b969 (diff) | |
download | external_llvm-7d942001fa4384c02b991f997e3862067d4f4a62.zip external_llvm-7d942001fa4384c02b991f997e3862067d4f4a62.tar.gz external_llvm-7d942001fa4384c02b991f997e3862067d4f4a62.tar.bz2 |
Let SRETPromotion properly preserve the function name instead of (implicitly)
postfixing it with a number.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54468 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO')
-rw-r--r-- | lib/Transforms/IPO/StructRetPromotion.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Transforms/IPO/StructRetPromotion.cpp b/lib/Transforms/IPO/StructRetPromotion.cpp index ae6d55f..1db7446 100644 --- a/lib/Transforms/IPO/StructRetPromotion.cpp +++ b/lib/Transforms/IPO/StructRetPromotion.cpp @@ -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); |