mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-12 13:38:21 +00:00
simplify code by using Value::takeName
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34177 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -29,14 +29,12 @@ void llvm::ReplaceInstWithValue(BasicBlock::InstListType &BIL,
|
||||
// Replaces all of the uses of the instruction with uses of the value
|
||||
I.replaceAllUsesWith(V);
|
||||
|
||||
std::string OldName = I.getName();
|
||||
// Make sure to propagate a name if there is one already.
|
||||
if (I.hasName() && !V->hasName())
|
||||
V->takeName(&I);
|
||||
|
||||
// Delete the unnecessary instruction now...
|
||||
BI = BIL.erase(BI);
|
||||
|
||||
// Make sure to propagate a name if there is one already.
|
||||
if (!OldName.empty() && !V->hasName())
|
||||
V->setName(OldName);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user