aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp')
-rw-r--r--lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp b/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
index 9e0afc8..847355c 100644
--- a/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
+++ b/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
@@ -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);
}