[llvm-commits] [llvm-gcc-4.2] r86749 - in /llvm-gcc-4.2/trunk/gcc: llvm-convert.cpp llvm-debug.cpp llvm-debug.h
Devang Patel
dpatel at apple.com
Tue Nov 10 15:07:00 PST 2009
Author: dpatel
Date: Tue Nov 10 17:07:00 2009
New Revision: 86749
URL: http://llvm.org/viewvc/llvm-project?rev=86749&view=rev
Log:
Attach locatin info with llvm.dbg.declare.
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp
llvm-gcc-4.2/trunk/gcc/llvm-debug.h
Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=86749&r1=86748&r2=86749&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Tue Nov 10 17:07:00 2009
@@ -304,7 +304,7 @@
TheDebugInfo->EmitDeclare(ResultDecl,
dwarf::DW_TAG_return_variable,
"agg.result", RetTy, Tmp,
- Builder.GetInsertBlock());
+ Builder);
}
++AI;
}
@@ -602,7 +602,7 @@
if (!isInvRef && TheDebugInfo)
TheDebugInfo->EmitDeclare(Args, dwarf::DW_TAG_arg_variable,
Name, TREE_TYPE(Args),
- AI, Builder.GetInsertBlock());
+ AI, Builder);
++AI;
} else {
// Otherwise, we create an alloca to hold the argument value and provide
@@ -614,7 +614,7 @@
if (TheDebugInfo) {
TheDebugInfo->EmitDeclare(Args, dwarf::DW_TAG_arg_variable,
Name, TREE_TYPE(Args), Tmp,
- Builder.GetInsertBlock());
+ Builder);
}
// Emit annotate intrinsic if arg has annotate attr
@@ -646,6 +646,9 @@
// Not supported yet.
}
+ if (TheDebugInfo)
+ TheDebugInfo->EmitStopPoint(Fn, Builder.GetInsertBlock(), Builder);
+
// As it turns out, not all temporaries are associated with blocks. For those
// that aren't, emit them now.
for (tree t = cfun->unexpanded_var_list; t; t = TREE_CHAIN(t)) {
@@ -1656,11 +1659,11 @@
if (DECL_NAME(decl)) {
TheDebugInfo->EmitDeclare(decl, dwarf::DW_TAG_auto_variable,
Name, TREE_TYPE(decl), AI,
- Builder.GetInsertBlock());
+ Builder);
} else if (TREE_CODE(decl) == RESULT_DECL) {
TheDebugInfo->EmitDeclare(decl, dwarf::DW_TAG_return_variable,
Name, TREE_TYPE(decl), AI,
- Builder.GetInsertBlock());
+ Builder);
}
}
}
Modified: llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp?rev=86749&r1=86748&r2=86749&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Tue Nov 10 17:07:00 2009
@@ -309,7 +309,8 @@
/// EmitDeclare - Constructs the debug code for allocation of a new variable.
/// region - "llvm.dbg.declare."
void DebugInfo::EmitDeclare(tree decl, unsigned Tag, const char *Name,
- tree type, Value *AI, BasicBlock *CurBB) {
+ tree type, Value *AI,
+ LLVMBuilder &Builder) {
// Do not emit variable declaration info, for now.
if (optimize)
@@ -330,7 +331,9 @@
Loc.line, getOrCreateType(type));
// Insert an llvm.dbg.declare into the current block.
- DebugFactory.InsertDeclare(AI, D, CurBB);
+ Instruction *Call = DebugFactory.InsertDeclare(AI, D,
+ Builder.GetInsertBlock());
+ Builder.SetDebugLocation(Call);
}
Modified: llvm-gcc-4.2/trunk/gcc/llvm-debug.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-debug.h?rev=86749&r1=86748&r2=86749&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-debug.h (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-debug.h Tue Nov 10 17:07:00 2009
@@ -92,8 +92,7 @@
/// EmitDeclare - Constructs the debug code for allocation of a new variable.
/// region - "llvm.dbg.declare."
void EmitDeclare(tree_node *decl, unsigned Tag, const char *Name,
- tree_node *type, Value *AI,
- BasicBlock *CurBB);
+ tree_node *type, Value *AI, LLVMBuilder &Builder);
/// EmitStopPoint - Emit a call to llvm.dbg.stoppoint to indicate a change of
/// source line.
More information about the llvm-commits
mailing list