mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Add a DebugLoc parameter to TargetInstrInfo::InsertBranch(). This
addresses a longstanding deficiency noted in many FIXMEs scattered across all the targets. This effectively moves the problem up one level, replacing eleven FIXMEs in the targets with eight FIXMEs in CodeGen, plus one path through FastISel where we actually supply a DebugLoc, fixing Radar 7421831. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106243 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -110,9 +110,8 @@ static bool isAlphaIntCondCode(unsigned Opcode) {
|
||||
unsigned AlphaInstrInfo::InsertBranch(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock *TBB,
|
||||
MachineBasicBlock *FBB,
|
||||
const SmallVectorImpl<MachineOperand> &Cond) const {
|
||||
// FIXME this should probably have a DebugLoc argument
|
||||
DebugLoc dl;
|
||||
const SmallVectorImpl<MachineOperand> &Cond,
|
||||
DebugLoc DL) const {
|
||||
assert(TBB && "InsertBranch must not be told to insert a fallthrough");
|
||||
assert((Cond.size() == 2 || Cond.size() == 0) &&
|
||||
"Alpha branch conditions have two components!");
|
||||
@@ -120,25 +119,25 @@ unsigned AlphaInstrInfo::InsertBranch(MachineBasicBlock &MBB,
|
||||
// One-way branch.
|
||||
if (FBB == 0) {
|
||||
if (Cond.empty()) // Unconditional branch
|
||||
BuildMI(&MBB, dl, get(Alpha::BR)).addMBB(TBB);
|
||||
BuildMI(&MBB, DL, get(Alpha::BR)).addMBB(TBB);
|
||||
else // Conditional branch
|
||||
if (isAlphaIntCondCode(Cond[0].getImm()))
|
||||
BuildMI(&MBB, dl, get(Alpha::COND_BRANCH_I))
|
||||
BuildMI(&MBB, DL, get(Alpha::COND_BRANCH_I))
|
||||
.addImm(Cond[0].getImm()).addReg(Cond[1].getReg()).addMBB(TBB);
|
||||
else
|
||||
BuildMI(&MBB, dl, get(Alpha::COND_BRANCH_F))
|
||||
BuildMI(&MBB, DL, get(Alpha::COND_BRANCH_F))
|
||||
.addImm(Cond[0].getImm()).addReg(Cond[1].getReg()).addMBB(TBB);
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Two-way Conditional Branch.
|
||||
if (isAlphaIntCondCode(Cond[0].getImm()))
|
||||
BuildMI(&MBB, dl, get(Alpha::COND_BRANCH_I))
|
||||
BuildMI(&MBB, DL, get(Alpha::COND_BRANCH_I))
|
||||
.addImm(Cond[0].getImm()).addReg(Cond[1].getReg()).addMBB(TBB);
|
||||
else
|
||||
BuildMI(&MBB, dl, get(Alpha::COND_BRANCH_F))
|
||||
BuildMI(&MBB, DL, get(Alpha::COND_BRANCH_F))
|
||||
.addImm(Cond[0].getImm()).addReg(Cond[1].getReg()).addMBB(TBB);
|
||||
BuildMI(&MBB, dl, get(Alpha::BR)).addMBB(FBB);
|
||||
BuildMI(&MBB, DL, get(Alpha::BR)).addMBB(FBB);
|
||||
return 2;
|
||||
}
|
||||
|
||||
|
@@ -42,8 +42,9 @@ public:
|
||||
int &FrameIndex) const;
|
||||
|
||||
virtual unsigned InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
|
||||
MachineBasicBlock *FBB,
|
||||
const SmallVectorImpl<MachineOperand> &Cond) const;
|
||||
MachineBasicBlock *FBB,
|
||||
const SmallVectorImpl<MachineOperand> &Cond,
|
||||
DebugLoc DL) const;
|
||||
virtual bool copyRegToReg(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MI,
|
||||
unsigned DestReg, unsigned SrcReg,
|
||||
|
Reference in New Issue
Block a user