mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-24 13:18:17 +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:
@@ -455,9 +455,7 @@ Function *ArgPromotion::DoPromotion(Function *F,
|
||||
|
||||
if (!Call->use_empty()) {
|
||||
Call->replaceAllUsesWith(New);
|
||||
std::string Name = Call->getName();
|
||||
Call->setName("");
|
||||
New->setName(Name);
|
||||
New->takeName(Call);
|
||||
}
|
||||
|
||||
// Finally, remove the old call from the program, reducing the use-count of
|
||||
@@ -479,7 +477,7 @@ Function *ArgPromotion::DoPromotion(Function *F,
|
||||
// If this is an unmodified argument, move the name and users over to the
|
||||
// new version.
|
||||
I->replaceAllUsesWith(I2);
|
||||
I2->setName(I->getName());
|
||||
I2->takeName(I);
|
||||
AA.replaceWithNewValue(I, I2);
|
||||
++I2;
|
||||
} else if (I->use_empty()) {
|
||||
|
||||
Reference in New Issue
Block a user