mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-07 14:33:15 +00:00
Record debug location information in the Dwarf writer.
A simple test program shows that debugging works. :-) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63968 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8fcf170a66
commit
ac06d004a0
@ -207,6 +207,7 @@ void X86ATTAsmPrinter::emitFunctionHeader(const MachineFunction &MF) {
|
||||
///
|
||||
bool X86ATTAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
|
||||
const Function *F = MF.getFunction();
|
||||
this->MF = &MF;
|
||||
unsigned CC = F->getCallingConv();
|
||||
|
||||
SetupMachineFunction(MF);
|
||||
@ -718,12 +719,24 @@ bool X86ATTAsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI,
|
||||
return false;
|
||||
}
|
||||
|
||||
/// printMachineInstruction -- Print out a single X86 LLVM instruction
|
||||
/// MI in AT&T syntax to the current output stream.
|
||||
/// printMachineInstruction -- Print out a single X86 LLVM instruction MI in
|
||||
/// AT&T syntax to the current output stream.
|
||||
///
|
||||
void X86ATTAsmPrinter::printMachineInstruction(const MachineInstr *MI) {
|
||||
++EmittedInsts;
|
||||
|
||||
if (TAI->doesSupportDebugInformation()) {
|
||||
static DebugLoc PrevDL = DebugLoc::getUnknownLoc();
|
||||
DebugLoc CurDL = MI->getDebugLoc();
|
||||
|
||||
if (!CurDL.isInvalid() && !CurDL.isUnknown() && PrevDL != CurDL) {
|
||||
DebugLocTuple DLT = MF->getDebugLocTuple(CurDL);
|
||||
printLabel(DW->RecordSourceLine(DLT.Line, DLT.Col, DLT.Src));
|
||||
}
|
||||
|
||||
PrevDL = CurDL;
|
||||
}
|
||||
|
||||
// Call the autogenerated instruction printer routines.
|
||||
printInstruction(MI);
|
||||
}
|
||||
|
@ -29,6 +29,7 @@ namespace llvm {
|
||||
struct MachineJumpTableInfo;
|
||||
|
||||
struct VISIBILITY_HIDDEN X86ATTAsmPrinter : public AsmPrinter {
|
||||
MachineFunction *MF;
|
||||
DwarfWriter *DW;
|
||||
MachineModuleInfo *MMI;
|
||||
const X86Subtarget *Subtarget;
|
||||
|
Loading…
x
Reference in New Issue
Block a user