mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-26 18:20:39 +00:00
Preserve line number information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130450 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -217,6 +217,7 @@ static Instruction *LowerNegateToMultiply(Instruction *Neg,
|
|||||||
ValueRankMap.erase(Neg);
|
ValueRankMap.erase(Neg);
|
||||||
Res->takeName(Neg);
|
Res->takeName(Neg);
|
||||||
Neg->replaceAllUsesWith(Res);
|
Neg->replaceAllUsesWith(Res);
|
||||||
|
Res->setDebugLoc(Neg->getDebugLoc());
|
||||||
Neg->eraseFromParent();
|
Neg->eraseFromParent();
|
||||||
return Res;
|
return Res;
|
||||||
}
|
}
|
||||||
@@ -506,6 +507,7 @@ static Instruction *BreakUpSubtract(Instruction *Sub,
|
|||||||
// Everyone now refers to the add instruction.
|
// Everyone now refers to the add instruction.
|
||||||
ValueRankMap.erase(Sub);
|
ValueRankMap.erase(Sub);
|
||||||
Sub->replaceAllUsesWith(New);
|
Sub->replaceAllUsesWith(New);
|
||||||
|
New->setDebugLoc(Sub->getDebugLoc());
|
||||||
Sub->eraseFromParent();
|
Sub->eraseFromParent();
|
||||||
|
|
||||||
DEBUG(dbgs() << "Negated: " << *New << '\n');
|
DEBUG(dbgs() << "Negated: " << *New << '\n');
|
||||||
@@ -531,6 +533,7 @@ static Instruction *ConvertShiftToMul(Instruction *Shl,
|
|||||||
ValueRankMap.erase(Shl);
|
ValueRankMap.erase(Shl);
|
||||||
Mul->takeName(Shl);
|
Mul->takeName(Shl);
|
||||||
Shl->replaceAllUsesWith(Mul);
|
Shl->replaceAllUsesWith(Mul);
|
||||||
|
Mul->setDebugLoc(Shl->getDebugLoc());
|
||||||
Shl->eraseFromParent();
|
Shl->eraseFromParent();
|
||||||
return Mul;
|
return Mul;
|
||||||
}
|
}
|
||||||
@@ -1052,6 +1055,8 @@ Value *Reassociate::ReassociateExpression(BinaryOperator *I) {
|
|||||||
// eliminate it.
|
// eliminate it.
|
||||||
DEBUG(dbgs() << "Reassoc to scalar: " << *V << '\n');
|
DEBUG(dbgs() << "Reassoc to scalar: " << *V << '\n');
|
||||||
I->replaceAllUsesWith(V);
|
I->replaceAllUsesWith(V);
|
||||||
|
if (Instruction *VI = dyn_cast<Instruction>(V))
|
||||||
|
VI->setDebugLoc(I->getDebugLoc());
|
||||||
RemoveDeadBinaryOp(I);
|
RemoveDeadBinaryOp(I);
|
||||||
++NumAnnihil;
|
++NumAnnihil;
|
||||||
return V;
|
return V;
|
||||||
@@ -1075,6 +1080,8 @@ Value *Reassociate::ReassociateExpression(BinaryOperator *I) {
|
|||||||
// This expression tree simplified to something that isn't a tree,
|
// This expression tree simplified to something that isn't a tree,
|
||||||
// eliminate it.
|
// eliminate it.
|
||||||
I->replaceAllUsesWith(Ops[0].Op);
|
I->replaceAllUsesWith(Ops[0].Op);
|
||||||
|
if (Instruction *OI = dyn_cast<Instruction>(Ops[0].Op))
|
||||||
|
OI->setDebugLoc(I->getDebugLoc());
|
||||||
RemoveDeadBinaryOp(I);
|
RemoveDeadBinaryOp(I);
|
||||||
return Ops[0].Op;
|
return Ops[0].Op;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user