Disengage DEBUG_LOC from non-PPC targets.
authorJim Laskey <jlaskey@mac.com>
Wed, 21 Dec 2005 20:51:37 +0000 (20:51 +0000)
committerJim Laskey <jlaskey@mac.com>
Wed, 21 Dec 2005 20:51:37 +0000 (20:51 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24919 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
lib/Target/Alpha/AlphaISelLowering.cpp
lib/Target/IA64/IA64ISelLowering.cpp
lib/Target/IA64/IA64ISelPattern.cpp
lib/Target/Sparc/SparcISelDAGToDAG.cpp
lib/Target/SparcV8/SparcV8ISelDAGToDAG.cpp
lib/Target/X86/X86ISelLowering.cpp

index d76a89df8fe9a1305e3a83cfecd6a059f4692275..6d6aab6946c3058813890c3ae6b1e3528fd02cd4 100644 (file)
@@ -622,18 +622,22 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
     case TargetLowering::Promote:
     default: assert(0 && "This action is not supported yet!");
     case TargetLowering::Expand: {
-      MachineDebugInfo &DebugInfo = DAG.getMachineFunction().getDebugInfo();
-      std::vector<SDOperand> Ops;
-      Ops.push_back(Tmp1);  // chain
-      Ops.push_back(Node->getOperand(1));  // line #
-      Ops.push_back(Node->getOperand(2));  // col #
-      const std::string &fname =
-        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
-      Result = DAG.getNode(ISD::DEBUG_LOC, MVT::Other, Ops);
+      if (TLI.isOperationLegal(ISD::DEBUG_LOC, MVT::Other)) {
+        MachineDebugInfo &DebugInfo = DAG.getMachineFunction().getDebugInfo();
+        std::vector<SDOperand> Ops;
+        Ops.push_back(Tmp1);  // chain
+        Ops.push_back(Node->getOperand(1));  // line #
+        Ops.push_back(Node->getOperand(2));  // col #
+        const std::string &fname =
+          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
+        Result = DAG.getNode(ISD::DEBUG_LOC, MVT::Other, Ops);
+      } else {
+        Result = Tmp1;  // chain
+      }
       Result = LegalizeOp(Result);  // Relegalize new nodes.
       break;
     }
index 49977b24f7c774a8f578dbaad896eb19da3a1ec0..c39f0cd5614f26f5538da5d4fda9ac1dc8bd2bcf 100644 (file)
@@ -691,7 +691,7 @@ void SimpleSched::VisitAll() {
   } else {
     Ordering.push_back(NI);
   }
-  
+
   // Iterate through all nodes that have been added
   for (unsigned i = 0; i < Ordering.size(); i++) { // note: size() varies
     // Visit all operands
index e86e25bf772d07327de5e0e828aa2304589b9c89..9b2fce2c1a9623f45129f98e317d03193d914f38 100644 (file)
@@ -102,6 +102,7 @@ AlphaTargetLowering::AlphaTargetLowering(TargetMachine &TM) : TargetLowering(TM)
 
   // We don't have line number support yet.
   setOperationAction(ISD::LOCATION, MVT::Other, Expand);
+  setOperationAction(ISD::DEBUG_LOC, MVT::Other, Expand);
   
   addLegalFPImmediate(+0.0); //F31
   addLegalFPImmediate(-0.0); //-F31
index e7276d4698ce2e8c0fc89e0dbc685bdb29cd36a3..6bfa79319887228bc945b74f1f2046f15751eadc 100644 (file)
@@ -74,6 +74,7 @@ IA64TargetLowering::IA64TargetLowering(TargetMachine &TM)
 
       // We don't have line number support yet.
       setOperationAction(ISD::LOCATION, MVT::Other, Expand);
+      setOperationAction(ISD::DEBUG_LOC, MVT::Other, Expand);
 
       //IA64 has these, but they are not implemented
       setOperationAction(ISD::CTTZ , MVT::i64  , Expand);
index b071a0894d57e9816df6262513a6e80b70de591c..7c2b38c51b9d83e282159588beb7827f176aca97 100644 (file)
@@ -102,6 +102,7 @@ namespace {
 
       // We don't have line number support yet.
       setOperationAction(ISD::LOCATION, MVT::Other, Expand);
+      setOperationAction(ISD::DEBUG_LOC, MVT::Other, Expand);
 
       computeRegisterProperties();
 
index a4e826478cc62b9e487e8263bde5af3253519130..6f444d4e2a9df96115cb1fd6854c4108d1f31cfd 100644 (file)
@@ -147,6 +147,11 @@ SparcV8TargetLowering::SparcV8TargetLowering(TargetMachine &TM)
   setOperationAction(ISD::SHL_PARTS, MVT::i32, Expand);
   setOperationAction(ISD::SRA_PARTS, MVT::i32, Expand);
   setOperationAction(ISD::SRL_PARTS, MVT::i32, Expand);
+
+  // We don't have line number support yet.
+  setOperationAction(ISD::LOCATION, MVT::Other, Expand);
+  setOperationAction(ISD::DEBUG_LOC, MVT::Other, Expand);
+
   computeRegisterProperties();
 }
 
index a4e826478cc62b9e487e8263bde5af3253519130..6f444d4e2a9df96115cb1fd6854c4108d1f31cfd 100644 (file)
@@ -147,6 +147,11 @@ SparcV8TargetLowering::SparcV8TargetLowering(TargetMachine &TM)
   setOperationAction(ISD::SHL_PARTS, MVT::i32, Expand);
   setOperationAction(ISD::SRA_PARTS, MVT::i32, Expand);
   setOperationAction(ISD::SRL_PARTS, MVT::i32, Expand);
+
+  // We don't have line number support yet.
+  setOperationAction(ISD::LOCATION, MVT::Other, Expand);
+  setOperationAction(ISD::DEBUG_LOC, MVT::Other, Expand);
+
   computeRegisterProperties();
 }
 
index 5e4fb412f1947fd4fbbe46d4ee6750de639c3c9b..61d3aeeedb95c405828b076172e44ef191be87eb 100644 (file)
@@ -126,6 +126,7 @@ X86TargetLowering::X86TargetLowering(TargetMachine &TM)
 
   // We don't have line number support yet.
   setOperationAction(ISD::LOCATION, MVT::Other, Expand);
+  setOperationAction(ISD::DEBUG_LOC, MVT::Other, Expand);
 
   if (X86ScalarSSE) {
     // Set up the FP register classes.