mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-12 03:32:10 +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) {
|
bool X86ATTAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
|
||||||
const Function *F = MF.getFunction();
|
const Function *F = MF.getFunction();
|
||||||
|
this->MF = &MF;
|
||||||
unsigned CC = F->getCallingConv();
|
unsigned CC = F->getCallingConv();
|
||||||
|
|
||||||
SetupMachineFunction(MF);
|
SetupMachineFunction(MF);
|
||||||
@ -718,12 +719,24 @@ bool X86ATTAsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// printMachineInstruction -- Print out a single X86 LLVM instruction
|
/// printMachineInstruction -- Print out a single X86 LLVM instruction MI in
|
||||||
/// MI in AT&T syntax to the current output stream.
|
/// AT&T syntax to the current output stream.
|
||||||
///
|
///
|
||||||
void X86ATTAsmPrinter::printMachineInstruction(const MachineInstr *MI) {
|
void X86ATTAsmPrinter::printMachineInstruction(const MachineInstr *MI) {
|
||||||
++EmittedInsts;
|
++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.
|
// Call the autogenerated instruction printer routines.
|
||||||
printInstruction(MI);
|
printInstruction(MI);
|
||||||
}
|
}
|
||||||
|
@ -29,6 +29,7 @@ namespace llvm {
|
|||||||
struct MachineJumpTableInfo;
|
struct MachineJumpTableInfo;
|
||||||
|
|
||||||
struct VISIBILITY_HIDDEN X86ATTAsmPrinter : public AsmPrinter {
|
struct VISIBILITY_HIDDEN X86ATTAsmPrinter : public AsmPrinter {
|
||||||
|
MachineFunction *MF;
|
||||||
DwarfWriter *DW;
|
DwarfWriter *DW;
|
||||||
MachineModuleInfo *MMI;
|
MachineModuleInfo *MMI;
|
||||||
const X86Subtarget *Subtarget;
|
const X86Subtarget *Subtarget;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user