mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-23 17:24:48 +00:00
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
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user