summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-11-11 19:10:19 +0000
committerDevang Patel <dpatel@apple.com>2009-11-11 19:10:19 +0000
commit5348515193d93987ad2aca404ef736859e0df1b1 (patch)
tree830b5735573d68b7e9284e88db1b15c504afd216 /clang/lib
parentaddf8b1ac655855cfa1f2300d2100fe284bf14ff (diff)
downloadbcm5719-llvm-5348515193d93987ad2aca404ef736859e0df1b1.tar.gz
bcm5719-llvm-5348515193d93987ad2aca404ef736859e0df1b1.zip
Do not eagerly set stop point for arguments. This misleads the debugger in identifying beginning of function body. Instead, create new location to attach with llvm.dbg.declare. This location is only used to find the context of the variable by the code generator, and it is not used to emit line number info.
llvm-svn: 86862
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp23
1 files changed, 19 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index ce43d4f38a6..97754728ca2 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -941,7 +941,6 @@ void CGDebugInfo::EmitFunctionStart(const char *Name, QualType FnType,
// Push function on region stack.
RegionStack.push_back(SP);
- EmitStopPoint(Fn, Builder);
}
@@ -1166,9 +1165,16 @@ void CGDebugInfo::EmitDeclare(const VarDecl *Decl, unsigned Tag,
DebugFactory.CreateVariable(Tag, RegionStack.back(),Decl->getNameAsString(),
Unit, Line, Ty);
// Insert an llvm.dbg.declare into the current block.
- llvm::Instruction *Call =
+ llvm::Instruction *Call =
DebugFactory.InsertDeclare(Storage, D, Builder.GetInsertBlock());
- Builder.SetDebugLocation(Call);
+#ifdef ATTACH_DEBUG_INFO_TO_AN_INSN
+ llvm::DIDescriptor DR = RegionStack.back();
+ llvm::DIScope DS = llvm::DIScope(DR.getNode());
+ llvm::DILocation DO(NULL);
+ llvm::DILocation DL =
+ DebugFactory.CreateLocation(Line, PLoc.getColumn(), DS, DO);
+ Builder.SetDebugLocation(Call, DL.getNode());
+#endif
}
/// EmitDeclare - Emit local variable declaration debug info.
@@ -1363,7 +1369,16 @@ void CGDebugInfo::EmitDeclare(const BlockDeclRefExpr *BDRE, unsigned Tag,
Decl->getNameAsString(), Unit, Line, Ty,
addr);
// Insert an llvm.dbg.declare into the current block.
- DebugFactory.InsertDeclare(Storage, D, Builder.GetInsertPoint());
+ llvm::Instruction *Call =
+ DebugFactory.InsertDeclare(Storage, D, Builder.GetInsertPoint());
+#ifdef ATTACH_DEBUG_INFO_TO_AN_INSN
+ llvm::DIDescriptor DR = RegionStack.back();
+ llvm::DIScope DS = llvm::DIScope(DR.getNode());
+ llvm::DILocation DO(NULL);
+ llvm::DILocation DL =
+ DebugFactory.CreateLocation(Line, PLoc.getColumn(), DS, DO);
+ Builder.SetDebugLocation(Call, DL.getNode());
+#endif
}
void CGDebugInfo::EmitDeclareOfAutoVariable(const VarDecl *Decl,
OpenPOWER on IntegriCloud