[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp LegalizeDAG.cpp

Jim Laskey jlaskey at apple.com
Wed Jan 4 07:04:25 PST 2006



Changes in directory llvm/lib/CodeGen/SelectionDAG:

DAGCombiner.cpp updated: 1.75 -> 1.76
LegalizeDAG.cpp updated: 1.250 -> 1.251
---
Log message:

Add unique id to debug location for debug label use (work in progress.)


---
Diffs of the changes:  (+23 -15)

 DAGCombiner.cpp |    3 ++-
 LegalizeDAG.cpp |   35 +++++++++++++++++++++--------------
 2 files changed, 23 insertions(+), 15 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.75 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.76
--- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.75	Fri Dec 23 14:08:28 2005
+++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp	Wed Jan  4 09:04:11 2006
@@ -2117,7 +2117,8 @@
     return DAG.getNode(ISD::DEBUG_LOC, MVT::Other, Chain.getOperand(0),
                                                    N->getOperand(1),
                                                    N->getOperand(2),
-                                                   N->getOperand(3));
+                                                   N->getOperand(3),
+                                                   N->getOperand(4));
   }
   
   return SDOperand();


Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.250 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.251
--- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.250	Wed Jan  4 07:42:59 2006
+++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp	Wed Jan  4 09:04:11 2006
@@ -628,8 +628,10 @@
           cast<StringSDNode>(Node->getOperand(3))->getValue();
         const std::string &dirname = 
           cast<StringSDNode>(Node->getOperand(4))->getValue();
-        unsigned id = DebugInfo.RecordSource(fname, dirname);
-        Ops.push_back(DAG.getConstant(id, MVT::i32));  // source file id
+        unsigned srcfile = DebugInfo.RecordSource(fname, dirname);
+        Ops.push_back(DAG.getConstant(srcfile, MVT::i32));  // source file id
+        unsigned id = DebugInfo.NextUniqueID();
+        Ops.push_back(DAG.getConstant(id, MVT::i32));  // label id
         Result = DAG.getNode(ISD::DEBUG_LOC, MVT::Other, Ops);
       } else {
         Result = Tmp1;  // chain
@@ -659,22 +661,27 @@
     break;
     
   case ISD::DEBUG_LOC:
-    assert(Node->getNumOperands() == 4 && "Invalid DEBUG_LOC node!");
+    assert(Node->getNumOperands() == 5 && "Invalid DEBUG_LOC node!");
     switch (TLI.getOperationAction(ISD::DEBUG_LOC, MVT::Other)) {
     case TargetLowering::Promote:
     case TargetLowering::Expand:
     default: assert(0 && "This action is not supported yet!");
-    case TargetLowering::Legal:
-      Tmp1 = LegalizeOp(Node->getOperand(0));  // Legalize the chain.
-      Tmp2 = LegalizeOp(Node->getOperand(1));  // Legalize the line #.
-      Tmp3 = LegalizeOp(Node->getOperand(2));  // Legalize the col #.
-      Tmp4 = LegalizeOp(Node->getOperand(3));  // Legalize the source file id.
-      
-      if (Tmp1 != Node->getOperand(0) ||
-          Tmp2 != Node->getOperand(1) ||
-          Tmp3 != Node->getOperand(2) ||
-          Tmp4 != Node->getOperand(3)) {
-        Result = DAG.getNode(ISD::DEBUG_LOC,MVT::Other, Tmp1, Tmp2, Tmp3, Tmp4);
+    case TargetLowering::Legal: {
+        SDOperand Tmp5;
+        Tmp1 = LegalizeOp(Node->getOperand(0));  // Legalize the chain.
+        Tmp2 = LegalizeOp(Node->getOperand(1));  // Legalize the line #.
+        Tmp3 = LegalizeOp(Node->getOperand(2));  // Legalize the col #.
+        Tmp4 = LegalizeOp(Node->getOperand(3));  // Legalize the source file id.
+        Tmp5 = LegalizeOp(Node->getOperand(4));  // Legalize the label id.
+        
+        if (Tmp1 != Node->getOperand(0) ||
+            Tmp2 != Node->getOperand(1) ||
+            Tmp3 != Node->getOperand(2) ||
+            Tmp4 != Node->getOperand(3) ||
+            Tmp5 != Node->getOperand(4)) {
+          Result =
+           DAG.getNode(ISD::DEBUG_LOC,MVT::Other, Tmp1, Tmp2, Tmp3, Tmp4, Tmp5);
+        }
       }
       break;
     }






More information about the llvm-commits mailing list