[llvm-commits] [llvm] r136916 -	/llvm/trunk/lib/CodeGen/MachineInstr.cpp
    Devang Patel 
    dpatel at apple.com
       
    Thu Aug  4 13:44:26 PDT 2011
    
    
  
Author: dpatel
Date: Thu Aug  4 15:44:26 2011
New Revision: 136916
URL: http://llvm.org/viewvc/llvm-project?rev=136916&view=rev
Log:
Print DBG_VALUE variable's location info as a comment.
Modified:
    llvm/trunk/lib/CodeGen/MachineInstr.cpp
Modified: llvm/trunk/lib/CodeGen/MachineInstr.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineInstr.cpp?rev=136916&r1=136915&r2=136916&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineInstr.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineInstr.cpp Thu Aug  4 15:44:26 2011
@@ -1516,7 +1516,19 @@
   }
 
   // Print debug location information.
-  if (!debugLoc.isUnknown() && MF) {
+  if (isDebugValue() && getOperand(e - 1).isMetadata()) {
+    if (!HaveSemi) OS << ";"; HaveSemi = true;
+    DIVariable DV(getOperand(e - 1).getMetadata());
+    OS << " line no:" <<  DV.getLineNumber();
+    if (MDNode *InlinedAt = DV.getInlinedAt()) {
+      DebugLoc InlinedAtDL = DebugLoc::getFromDILocation(InlinedAt);
+      if (!InlinedAtDL.isUnknown()) {
+        OS << " inlined @[ ";
+        printDebugLoc(InlinedAtDL, MF, OS);
+        OS << " ]";
+      }
+    }
+  } else if (!debugLoc.isUnknown() && MF) {
     if (!HaveSemi) OS << ";"; HaveSemi = true;
     OS << " dbg:";
     printDebugLoc(debugLoc, MF, OS);
    
    
More information about the llvm-commits
mailing list