[llvm-commits] [llvm] r65184 - in /llvm/branches/Apple/Dib: include/llvm/CodeGen/DebugLoc.h utils/TableGen/AsmWriterEmitter.cpp

Bill Wendling isanbard at gmail.com
Fri Feb 20 14:30:26 PST 2009


Author: void
Date: Fri Feb 20 16:30:26 2009
New Revision: 65184

URL: http://llvm.org/viewvc/llvm-project?rev=65184&view=rev
Log:
Pull r65039 into Dib:

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.

Modified:
    llvm/branches/Apple/Dib/include/llvm/CodeGen/DebugLoc.h
    llvm/branches/Apple/Dib/utils/TableGen/AsmWriterEmitter.cpp

Modified: llvm/branches/Apple/Dib/include/llvm/CodeGen/DebugLoc.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/include/llvm/CodeGen/DebugLoc.h?rev=65184&r1=65183&r2=65184&view=diff

==============================================================================
--- llvm/branches/Apple/Dib/include/llvm/CodeGen/DebugLoc.h (original)
+++ llvm/branches/Apple/Dib/include/llvm/CodeGen/DebugLoc.h Fri Feb 20 16:30:26 2009
@@ -27,6 +27,13 @@
 
     DebugLocTuple(unsigned s, unsigned l, unsigned c)
       : Src(s), Line(l), Col(c) {};
+
+    bool operator==(const DebugLocTuple &DLT) const {
+      return Src == DLT.Src && Line == DLT.Line && Col == DLT.Col;
+    }
+    bool operator!=(const DebugLocTuple &DLT) const {
+      return !(*this == DLT);
+    }
   };
 
   /// DebugLoc - Debug location id. This is carried by SDNode and MachineInstr

Modified: llvm/branches/Apple/Dib/utils/TableGen/AsmWriterEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/utils/TableGen/AsmWriterEmitter.cpp?rev=65184&r1=65183&r2=65184&view=diff

==============================================================================
--- llvm/branches/Apple/Dib/utils/TableGen/AsmWriterEmitter.cpp (original)
+++ llvm/branches/Apple/Dib/utils/TableGen/AsmWriterEmitter.cpp Fri Feb 20 16:30:26 2009
@@ -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"





More information about the llvm-commits mailing list