From 5450fc15cb5de674d4e5203ab9ace59d3d6c38e5 Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Tue, 6 Oct 2009 02:19:11 +0000 Subject: Update processDebugLoc() so that it can be used to process debug info before and after printing an instruction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83363 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'lib/CodeGen/AsmPrinter/AsmPrinter.cpp') diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index 5006939..00f3980 100644 --- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -1353,18 +1353,20 @@ void AsmPrinter::PrintSpecial(const MachineInstr *MI, const char *Code) const { /// processDebugLoc - Processes the debug information of each machine /// instruction's DebugLoc. -void AsmPrinter::processDebugLoc(const MachineInstr *MI) { +void AsmPrinter::processDebugLoc(const MachineInstr *MI, + bool BeforePrintingInsn) { if (!MAI || !DW) return; DebugLoc DL = MI->getDebugLoc(); if (MAI->doesSupportDebugInformation() && DW->ShouldEmitDwarfDebug()) { if (!DL.isUnknown()) { DebugLocTuple CurDLT = MF->getDebugLocTuple(DL); - - if (CurDLT.CompileUnit != 0 && PrevDLT != CurDLT) { - printLabel(DW->RecordSourceLine(CurDLT.Line, CurDLT.Col, - CurDLT.CompileUnit)); - O << '\n'; + if (BeforePrintingInsn) { + if (CurDLT.CompileUnit != 0 && PrevDLT != CurDLT) { + printLabel(DW->RecordSourceLine(CurDLT.Line, CurDLT.Col, + CurDLT.CompileUnit)); + O << '\n'; + } } PrevDLT = CurDLT; -- cgit v1.1