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 | 92c1e126473dfa93eeb4c9a124af4fedb40f0d5b (patch) | |
tree | 3fe4d37e609073b439fec8149bc69306177c8f95 /lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp | |
parent | 54fc7d67146b2b95ae2d1c93ed59008d4338d8c8 (diff) |
Revert this. It was breaking stuff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64428 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp | 36 |
1 files changed, 27 insertions, 9 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp index 0918e6c3ad..47335d3f9a 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp @@ -3912,18 +3912,24 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) { case Intrinsic::dbg_region_start: { DwarfWriter *DW = DAG.getDwarfWriter(); DbgRegionStartInst &RSI = cast<DbgRegionStartInst>(I); - - if (DW && DW->ValidDebugInfo(RSI.getContext())) - DW->RecordRegionStart(cast<GlobalVariable>(RSI.getContext())); + if (DW && DW->ValidDebugInfo(RSI.getContext())) { + unsigned LabelID = + DW->RecordRegionStart(cast<GlobalVariable>(RSI.getContext())); + DAG.setRoot(DAG.getLabel(ISD::DBG_LABEL, getCurDebugLoc(), + getRoot(), LabelID)); + } return 0; } case Intrinsic::dbg_region_end: { DwarfWriter *DW = DAG.getDwarfWriter(); DbgRegionEndInst &REI = cast<DbgRegionEndInst>(I); - - if (DW && DW->ValidDebugInfo(REI.getContext())) - DW->RecordRegionEnd(cast<GlobalVariable>(REI.getContext())); + if (DW && DW->ValidDebugInfo(REI.getContext())) { + unsigned LabelID = + DW->RecordRegionEnd(cast<GlobalVariable>(REI.getContext())); + DAG.setRoot(DAG.getLabel(ISD::DBG_LABEL, getCurDebugLoc(), + getRoot(), LabelID)); + } return 0; } @@ -3944,15 +3950,27 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) { // function start. It will be emitted at asm emission time. However, // create a label if this is a beginning of inlined function. unsigned Line = Subprogram.getLineNumber(); + unsigned LabelID = DW->RecordSourceLine(Line, 0, SrcFile); + + if (DW->getRecordSourceLineCount() != 1) + DAG.setRoot(DAG.getLabel(ISD::DBG_LABEL, getCurDebugLoc(), + getRoot(), LabelID)); + setCurDebugLoc(DebugLoc::get(DAG.getMachineFunction(). - getOrCreateDebugLocID(SrcFile, Line, 0))); + getOrCreateDebugLocID(SrcFile, Line, 0))); } return 0; } - case Intrinsic::dbg_declare: - // FIXME: Do something correct here when declare stuff is working again. + case Intrinsic::dbg_declare: { + DwarfWriter *DW = DAG.getDwarfWriter(); + DbgDeclareInst &DI = cast<DbgDeclareInst>(I); + Value *Variable = DI.getVariable(); + if (DW && DW->ValidDebugInfo(Variable)) + DAG.setRoot(DAG.getNode(ISD::DECLARE, dl, MVT::Other, getRoot(), + getValue(DI.getAddress()), getValue(Variable))); return 0; + } case Intrinsic::eh_exception: { if (!CurMBB->isLandingPad()) { |