summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-04-16 17:55:30 +0000
committerDevang Patel <dpatel@apple.com>2009-04-16 17:55:30 +0000
commitdab01f3fd650f3e19753d998f31390346419f950 (patch)
tree90d898e34d87930f1f5f59c61b426d7e1a8a372e /llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
parent1a99f441e64c853f5f7a029c4e159db8209aa685 (diff)
downloadbcm5719-llvm-dab01f3fd650f3e19753d998f31390346419f950.tar.gz
bcm5719-llvm-dab01f3fd650f3e19753d998f31390346419f950.zip
Do not treat beginning of inlined scope as beginning of normal function scope if the location info is missing.
Insetad of doing ... if (inlined_subroutine && known_location) DW_TAG_inline_subroutine else DW_TAG_subprogram do if (inlined_subroutine) { if (known_location) DW_TAG_inline_subroutine } else { DW_TAG_subprogram } llvm-svn: 69300
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
index 832ad7ef5ae..5204113b3aa 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
@@ -3966,6 +3966,10 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) {
if (Fast) {
unsigned ID = DW->RecordInlinedFnEnd(Subprogram);
if (ID != 0)
+ // Returned ID is 0 if this is unbalanced "end of inlined
+ // scope". This could happen if optimizer eats dbg intrinsics
+ // or "beginning of inlined scope" is not recoginized due to
+ // missing location info. In such cases, do ignore this region.end.
DAG.setRoot(DAG.getLabel(ISD::DBG_LABEL, getCurDebugLoc(),
getRoot(), ID));
}
@@ -4000,6 +4004,12 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) {
if (!Subprogram.describes(MF.getFunction())) {
// This is a beginning of an inlined function.
+ // If llvm.dbg.func.start is seen in a new block before any
+ // llvm.dbg.stoppoint intrinsic then the location info is unknown.
+ // FIXME : Why DebugLoc is reset at the beginning of each block ?
+ if (PrevLoc.isUnknown())
+ return 0;
+
// Record the source line.
unsigned Line = Subprogram.getLineNumber();
unsigned LabelID = DW->RecordSourceLine(Line, 0, SrcFile);
OpenPOWER on IntegriCloud