summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO/ExtractFunction.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-02-11 01:08:35 +0000
committerChris Lattner <sabre@nondot.org>2007-02-11 01:08:35 +0000
commit8d4c36bb4086e34efadb812a7a87de1e07ff5d98 (patch)
tree7dccb9ab6e438fbd691c1c1b45fa91f00e14391f /llvm/lib/Transforms/IPO/ExtractFunction.cpp
parentcba18e3a0127b621085af39f9e7f13fed07f1c7e (diff)
downloadbcm5719-llvm-8d4c36bb4086e34efadb812a7a87de1e07ff5d98.tar.gz
bcm5719-llvm-8d4c36bb4086e34efadb812a7a87de1e07ff5d98.zip
simplify name juggling through the use of Value::takeName.
llvm-svn: 34175
Diffstat (limited to 'llvm/lib/Transforms/IPO/ExtractFunction.cpp')
-rw-r--r--llvm/lib/Transforms/IPO/ExtractFunction.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/IPO/ExtractFunction.cpp b/llvm/lib/Transforms/IPO/ExtractFunction.cpp
index ae1eb224783..afaf38d2808 100644
--- a/llvm/lib/Transforms/IPO/ExtractFunction.cpp
+++ b/llvm/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
OpenPOWER on IntegriCloud