aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-10-06 02:19:11 +0000
committerDevang Patel <dpatel@apple.com>2009-10-06 02:19:11 +0000
commit5450fc15cb5de674d4e5203ab9ace59d3d6c38e5 (patch)
tree934ac6a9104336db9137327084c44846fd3d6692 /lib/CodeGen/AsmPrinter/AsmPrinter.cpp
parentac35dcf9887f9e7883745876525c2a7dc39bf8d4 (diff)
downloadexternal_llvm-5450fc15cb5de674d4e5203ab9ace59d3d6c38e5.zip
external_llvm-5450fc15cb5de674d4e5203ab9ace59d3d6c38e5.tar.gz
external_llvm-5450fc15cb5de674d4e5203ab9ace59d3d6c38e5.tar.bz2
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
Diffstat (limited to 'lib/CodeGen/AsmPrinter/AsmPrinter.cpp')
-rw-r--r--lib/CodeGen/AsmPrinter/AsmPrinter.cpp14
1 files changed, 8 insertions, 6 deletions
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;