diff options
author | Jim Laskey <jlaskey@mac.com> | 2005-12-21 20:51:37 +0000 |
---|---|---|
committer | Jim Laskey <jlaskey@mac.com> | 2005-12-21 20:51:37 +0000 |
commit | 9e296bee9ab21c9719229ddb913537d812fcc5ca (patch) | |
tree | 096f2ad02626bb4c579a264ba6f96fd924bbfac2 /llvm/lib/CodeGen | |
parent | 67ff29c095183e7c25e3d016e3368c94d0e2ce49 (diff) | |
download | bcm5719-llvm-9e296bee9ab21c9719229ddb913537d812fcc5ca.tar.gz bcm5719-llvm-9e296bee9ab21c9719229ddb913537d812fcc5ca.zip |
Disengage DEBUG_LOC from non-PPC targets.
llvm-svn: 24919
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 28 | ||||
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp | 2 |
2 files changed, 17 insertions, 13 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index d76a89df8fe..6d6aab6946c 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -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; } diff --git a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp index 49977b24f7c..c39f0cd5614 100644 --- a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp @@ -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 |