mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-03 14:31:10 +00:00
Utils/LoopUnroll.cpp: Tweak (StringRef)OldName to be valid until it is used, since r194601.
eraseFromParent() invalidates OldName. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194970 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c8dc96be28
commit
80ccd9ea59
@ -90,6 +90,7 @@ static BasicBlock *FoldBlockIntoPredecessor(BasicBlock *BB, LoopInfo* LI,
|
||||
// Move all definitions in the successor to the predecessor...
|
||||
OnlyPred->getInstList().splice(OnlyPred->end(), BB->getInstList());
|
||||
|
||||
// OldName will be valid until erased.
|
||||
StringRef OldName = BB->getName();
|
||||
|
||||
// Erase basic block from the function...
|
||||
@ -102,12 +103,13 @@ static BasicBlock *FoldBlockIntoPredecessor(BasicBlock *BB, LoopInfo* LI,
|
||||
}
|
||||
}
|
||||
LI->removeBlock(BB);
|
||||
BB->eraseFromParent();
|
||||
|
||||
// Inherit predecessor's name if it exists...
|
||||
if (!OldName.empty() && !OnlyPred->hasName())
|
||||
OnlyPred->setName(OldName);
|
||||
|
||||
BB->eraseFromParent();
|
||||
|
||||
return OnlyPred;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user