From 8d4c36bb4086e34efadb812a7a87de1e07ff5d98 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 11 Feb 2007 01:08:35 +0000 Subject: simplify name juggling through the use of Value::takeName. llvm-svn: 34175 --- llvm/lib/Transforms/IPO/ExtractFunction.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'llvm/lib/Transforms/IPO/ExtractFunction.cpp') 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 -- cgit v1.2.3