diff options
Diffstat (limited to 'llvm/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp')
| -rw-r--r-- | llvm/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp | 17 | 
1 files changed, 15 insertions, 2 deletions
| diff --git a/llvm/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp b/llvm/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp index 9e0afc8d6f2..847355c50d7 100644 --- a/llvm/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp +++ b/llvm/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);  } | 

