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 -2
View File
@@ -164,8 +164,8 @@ bool RaiseAllocations::runOnModule(Module &M) {
CastInst::createIntegerCast(Source, Type::Int32Ty, false/*ZExt*/,
"MallocAmtCast", I);
std::string Name(I->getName()); I->setName("");
MallocInst *MI = new MallocInst(Type::Int8Ty, Source, Name, I);
MallocInst *MI = new MallocInst(Type::Int8Ty, Source, "", I);
MI->takeName(I);
I->replaceAllUsesWith(MI);
// If the old instruction was an invoke, add an unconditional branch