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 | 8d4c36bb4086e34efadb812a7a87de1e07ff5d98 (patch) | |
tree | 7dccb9ab6e438fbd691c1c1b45fa91f00e14391f /llvm/lib/Transforms/IPO/ExtractFunction.cpp | |
parent | cba18e3a0127b621085af39f9e7f13fed07f1c7e (diff) | |
download | bcm5719-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.cpp | 5 |
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 |