diff options
author | Chris Lattner <sabre@nondot.org> | 2007-02-11 01:08:35 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-02-11 01:08:35 +0000 |
commit | 046800a7125cd497613efc0e1ea15cb595666585 (patch) | |
tree | d786e1415ddb69b8a0d8f8b8f71856081f10aea4 /lib/Transforms/IPO/ExtractFunction.cpp | |
parent | f41916e75dc9c622fa81b91eb6a5e0a36fa13754 (diff) |
simplify name juggling through the use of Value::takeName.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34175 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO/ExtractFunction.cpp')
-rw-r--r-- | lib/Transforms/IPO/ExtractFunction.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Transforms/IPO/ExtractFunction.cpp b/lib/Transforms/IPO/ExtractFunction.cpp index ae1eb22478..afaf38d280 100644 --- a/lib/Transforms/IPO/ExtractFunction.cpp +++ b/lib/Transforms/IPO/ExtractFunction.cpp @@ -90,16 +90,15 @@ namespace { for (Module::iterator I = M.begin(); ; ++I) { if (&*I != Named) { Function *New = new Function(I->getFunctionType(), - GlobalValue::ExternalLinkage, - I->getName()); + GlobalValue::ExternalLinkage); New->setCallingConv(I->getCallingConv()); - I->setName(""); // Remove Old name // If it's not the named function, delete the body of the function I->dropAllReferences(); M.getFunctionList().push_back(New); NewFunctions.push_back(New); + New->takeName(I); } if (&*I == Last) break; // Stop after processing the last function |