1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00

Do not insert anything after terminator.

llvm-svn: 132164
This commit is contained in:
Devang Patel 2011-05-26 23:16:48 +00:00
parent b87c4a6945
commit 5e3f883ddf

View File

@ -554,7 +554,8 @@ bool CodeGenPrepare::OptimizeCallInst(CallInst *CI) {
// find a node corresponding to the value.
if (DbgValueInst *DVI = dyn_cast<DbgValueInst>(CI))
if (Instruction *VI = dyn_cast_or_null<Instruction>(DVI->getValue()))
if (DVI->getParent() != VI->getParent() || DT->dominates(DVI, VI)) {
if (!VI->isTerminator() &&
DVI->getParent() != VI->getParent() || DT->dominates(DVI, VI)) {
DEBUG(dbgs() << "Moving Debug Value before :\n" << *DVI << ' ' << *VI);
DVI->removeFromParent();
if (isa<PHINode>(VI))