mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
Move findDebugLoc somewhere more central. Fix
more cases where debug declarations affect debug line info. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93953 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
cd9e155755
commit
918f0f0bea
@ -367,6 +367,9 @@ private: // Methods used to maintain doubly linked list of blocks...
|
|||||||
void removePredecessor(MachineBasicBlock *pred);
|
void removePredecessor(MachineBasicBlock *pred);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
DebugLoc
|
||||||
|
findDebugLoc(MachineBasicBlock::iterator &MBBI, MachineBasicBlock &MBB);
|
||||||
|
|
||||||
raw_ostream& operator<<(raw_ostream &OS, const MachineBasicBlock &MBB);
|
raw_ostream& operator<<(raw_ostream &OS, const MachineBasicBlock &MBB);
|
||||||
|
|
||||||
void WriteAsOperand(raw_ostream &, const MachineBasicBlock*, bool t);
|
void WriteAsOperand(raw_ostream &, const MachineBasicBlock*, bool t);
|
||||||
|
@ -528,3 +528,20 @@ void llvm::WriteAsOperand(raw_ostream &OS, const MachineBasicBlock *MBB,
|
|||||||
bool t) {
|
bool t) {
|
||||||
OS << "BB#" << MBB->getNumber();
|
OS << "BB#" << MBB->getNumber();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// findDebugLoc - find the next valid DebugLoc starting at MBBI, skipping
|
||||||
|
/// any DEBUG_VALUE instructions. Return UnknownLoc if there is none.
|
||||||
|
DebugLoc
|
||||||
|
llvm::findDebugLoc(MachineBasicBlock::iterator &MBBI, MachineBasicBlock &MBB) {
|
||||||
|
DebugLoc DL;
|
||||||
|
if (MBBI != MBB.end()) {
|
||||||
|
// Skip debug declarations, we don't want a DebugLoc from them.
|
||||||
|
MachineBasicBlock::iterator MBBI2 = MBBI;
|
||||||
|
while (MBBI2 != MBB.end() &&
|
||||||
|
MBBI2->getOpcode()==TargetInstrInfo::DEBUG_VALUE)
|
||||||
|
MBBI2++;
|
||||||
|
if (MBBI2 != MBB.end())
|
||||||
|
DL = MBBI2->getDebugLoc();
|
||||||
|
}
|
||||||
|
return DL;
|
||||||
|
}
|
||||||
|
@ -2200,8 +2200,7 @@ bool X86InstrInfo::spillCalleeSavedRegisters(MachineBasicBlock &MBB,
|
|||||||
if (CSI.empty())
|
if (CSI.empty())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
DebugLoc DL = DebugLoc::getUnknownLoc();
|
DebugLoc DL = findDebugLoc(MI, MBB);
|
||||||
if (MI != MBB.end()) DL = MI->getDebugLoc();
|
|
||||||
|
|
||||||
bool is64Bit = TM.getSubtarget<X86Subtarget>().is64Bit();
|
bool is64Bit = TM.getSubtarget<X86Subtarget>().is64Bit();
|
||||||
bool isWin64 = TM.getSubtarget<X86Subtarget>().isTargetWin64();
|
bool isWin64 = TM.getSubtarget<X86Subtarget>().isTargetWin64();
|
||||||
@ -2239,8 +2238,7 @@ bool X86InstrInfo::restoreCalleeSavedRegisters(MachineBasicBlock &MBB,
|
|||||||
if (CSI.empty())
|
if (CSI.empty())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
DebugLoc DL = DebugLoc::getUnknownLoc();
|
DebugLoc DL = findDebugLoc(MI, MBB);
|
||||||
if (MI != MBB.end()) DL = MI->getDebugLoc();
|
|
||||||
|
|
||||||
MachineFunction &MF = *MBB.getParent();
|
MachineFunction &MF = *MBB.getParent();
|
||||||
unsigned FPReg = RI.getFrameRegister(MF);
|
unsigned FPReg = RI.getFrameRegister(MF);
|
||||||
|
@ -666,23 +666,6 @@ X86RegisterInfo::processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// findDebugLoc - find the next valid DebugLoc starting at MBBI, skipping
|
|
||||||
/// any DEBUG_VALUE instructions. Return UnknownLoc if there is none.
|
|
||||||
static
|
|
||||||
DebugLoc findDebugLoc(MachineBasicBlock::iterator &MBBI, MachineBasicBlock &MBB) {
|
|
||||||
DebugLoc DL;
|
|
||||||
if (MBBI != MBB.end()) {
|
|
||||||
// Skip debug declarations, we don't want a DebugLoc from them.
|
|
||||||
MachineBasicBlock::iterator MBBI2 = MBBI;
|
|
||||||
while (MBBI2 != MBB.end() &&
|
|
||||||
MBBI2->getOpcode()==TargetInstrInfo::DEBUG_VALUE)
|
|
||||||
MBBI2++;
|
|
||||||
if (MBBI2 != MBB.end())
|
|
||||||
DL = MBBI2->getDebugLoc();
|
|
||||||
}
|
|
||||||
return DL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// emitSPUpdate - Emit a series of instructions to increment / decrement the
|
/// emitSPUpdate - Emit a series of instructions to increment / decrement the
|
||||||
/// stack pointer by a constant value.
|
/// stack pointer by a constant value.
|
||||||
static
|
static
|
||||||
|
Loading…
Reference in New Issue
Block a user