diff options
author | Jim Laskey <jlaskey@mac.com> | 2006-01-04 15:04:11 +0000 |
---|---|---|
committer | Jim Laskey <jlaskey@mac.com> | 2006-01-04 15:04:11 +0000 |
commit | 5bf6f25b4a888afaf3e37acd18c43186d45cac2e (patch) | |
tree | b2007705505661cae56a30ea0e6910d5dd5b0774 /lib/CodeGen | |
parent | 7d78a2ab7e3575561a15abd5bd386ea4a0301b23 (diff) |
Add unique id to debug location for debug label use (work in progress.)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25096 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/MachineDebugInfo.cpp | 1 | ||||
-rw-r--r-- | lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 3 | ||||
-rw-r--r-- | lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 35 |
3 files changed, 24 insertions, 15 deletions
diff --git a/lib/CodeGen/MachineDebugInfo.cpp b/lib/CodeGen/MachineDebugInfo.cpp index 2cd30fad18..fc88b8ca00 100644 --- a/lib/CodeGen/MachineDebugInfo.cpp +++ b/lib/CodeGen/MachineDebugInfo.cpp @@ -50,6 +50,7 @@ namespace llvm { /// doFinalization - Tear down the debug state after completion of a module. /// bool MachineDebugInfo::doFinalization() { + return true; } diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 30a4c9f637..1cfa305d85 100644 --- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -2117,7 +2117,8 @@ SDOperand DAGCombiner::visitDEBUGLOC(SDNode *N) { 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(); diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index af2c4ba139..bd8c50a53d 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -628,8 +628,10 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) { 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 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) { 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; } |