Print out a new label only if the debug location *tuple* is different. The debug
locations may change, but the tuples may be the same.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65039 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/utils/TableGen/AsmWriterEmitter.cpp b/utils/TableGen/AsmWriterEmitter.cpp
index 6d2fa55..4f810c1 100644
--- a/utils/TableGen/AsmWriterEmitter.cpp
+++ b/utils/TableGen/AsmWriterEmitter.cpp
@@ -642,13 +642,16 @@
O << " if (TAI->doesSupportDebugInformation()) {\n"
<< " const MachineFunction *MF = MI->getParent()->getParent();\n"
- << " static DebugLoc PrevDL = DebugLoc::getUnknownLoc();\n"
<< " DebugLoc CurDL = MI->getDebugLoc();\n\n"
- << " if (!CurDL.isUnknown() && PrevDL != CurDL) {\n"
- << " DebugLocTuple DLT = MF->getDebugLocTuple(CurDL);\n"
- << " printLabel(DW->RecordSourceLine(DLT.Line, DLT.Col, DLT.Src));\n"
- << " }\n\n"
- << " PrevDL = CurDL;\n"
+ << " if (!CurDL.isUnknown()) {\n"
+ << " static DebugLocTuple PrevDLT(~0U, ~0U, ~0U);\n"
+ << " DebugLocTuple CurDLT = MF->getDebugLocTuple(CurDL);\n\n"
+ << " if (PrevDLT != CurDLT) {\n"
+ << " printLabel(DW->RecordSourceLine(CurDLT.Line, CurDLT.Col,\n"
+ << " CurDLT.Src));\n"
+ << " PrevDLT = CurDLT;\n"
+ << " }\n"
+ << " }\n"
<< " }\n\n";
O << " if (MI->getOpcode() == TargetInstrInfo::INLINEASM) {\n"