summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2009-02-13 02:16:35 +0000
committerBill Wendling <isanbard@gmail.com>2009-02-13 02:16:35 +0000
commit65c0fd4c44d2a76acc92b3d68f11d513459ad9c3 (patch)
treeee90d0fedbe2b42d23be557950a18f096217d73f /llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
parent1c21ac3066225937c2e2deed4869e4b6902c7d0a (diff)
downloadbcm5719-llvm-65c0fd4c44d2a76acc92b3d68f11d513459ad9c3.tar.gz
bcm5719-llvm-65c0fd4c44d2a76acc92b3d68f11d513459ad9c3.zip
Revert this. It was breaking stuff.
llvm-svn: 64428
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp36
1 files changed, 27 insertions, 9 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
index 0918e6c3ad5..47335d3f9a2 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
+++ b/llvm/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()) {
OpenPOWER on IntegriCloud