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:
Chris Lattner
2007-02-11 01:08:35 +00:00
parent f41916e75d
commit 046800a712
6 changed files with 23 additions and 34 deletions
+2 -4
View File
@@ -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()) {