summaryrefslogtreecommitdiff
path: root/lib/Transforms/IPO/ExtractFunction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms/IPO/ExtractFunction.cpp')
-rw-r--r--lib/Transforms/IPO/ExtractFunction.cpp5
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