diff options
| author | Bill Wendling <isanbard@gmail.com> | 2009-02-13 02:16:35 +0000 |
|---|---|---|
| committer | Bill Wendling <isanbard@gmail.com> | 2009-02-13 02:16:35 +0000 |
| commit | 65c0fd4c44d2a76acc92b3d68f11d513459ad9c3 (patch) | |
| tree | ee90d0fedbe2b42d23be557950a18f096217d73f /llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | |
| parent | 1c21ac3066225937c2e2deed4869e4b6902c7d0a (diff) | |
| download | bcm5719-llvm-65c0fd4c44d2a76acc92b3d68f11d513459ad9c3.tar.gz bcm5719-llvm-65c0fd4c44d2a76acc92b3d68f11d513459ad9c3.zip | |
Revert this. It was breaking stuff.
llvm-svn: 64428
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 8cba55fdb0f..e5a30c88be1 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -1274,9 +1274,38 @@ SDValue SelectionDAGLegalize::LegalizeOp(SDValue Op) { switch (TLI.getOperationAction(ISD::DBG_STOPPOINT, MVT::Other)) { case TargetLowering::Promote: default: assert(0 && "This action is not supported yet!"); - case TargetLowering::Expand: - Result = Tmp1; // chain + case TargetLowering::Expand: { + DwarfWriter *DW = DAG.getDwarfWriter(); + bool useDEBUG_LOC = TLI.isOperationLegalOrCustom(ISD::DEBUG_LOC, + MVT::Other); + bool useLABEL = TLI.isOperationLegalOrCustom(ISD::DBG_LABEL, MVT::Other); + + const DbgStopPointSDNode *DSP = cast<DbgStopPointSDNode>(Node); + GlobalVariable *CU_GV = cast<GlobalVariable>(DSP->getCompileUnit()); + if (DW && (useDEBUG_LOC || useLABEL) && !CU_GV->isDeclaration()) { + DICompileUnit CU(cast<GlobalVariable>(DSP->getCompileUnit())); + unsigned SrcFile = DW->RecordSource(CU.getDirectory(), + CU.getFilename()); + + unsigned Line = DSP->getLine(); + unsigned Col = DSP->getColumn(); + + // A bit self-referential to have DebugLoc on Debug_Loc nodes, but + // it won't hurt anything. + if (useDEBUG_LOC) { + SDValue Ops[] = { Tmp1, DAG.getConstant(Line, MVT::i32), + DAG.getConstant(Col, MVT::i32), + DAG.getConstant(SrcFile, MVT::i32) }; + Result = DAG.getNode(ISD::DEBUG_LOC, dl, MVT::Other, Ops, 4); + } else { + unsigned ID = DW->RecordSourceLine(Line, Col, SrcFile); + Result = DAG.getLabel(ISD::DBG_LABEL, dl, Tmp1, ID); + } + } else { + Result = Tmp1; // chain + } break; + } case TargetLowering::Legal: { LegalizeAction Action = getTypeAction(Node->getOperand(1).getValueType()); if (Action == Legal && Tmp1 == Node->getOperand(0)) |

