[llvm-commits] [dragonegg] r88784 - in /dragonegg/trunk: llvm-convert.cpp llvm-debug.cpp llvm-debug.h

Duncan Sands baldrick at free.fr
Sat Nov 14 04:33:30 PST 2009


Author: baldrick
Date: Sat Nov 14 06:33:29 2009
New Revision: 88784

URL: http://llvm.org/viewvc/llvm-project?rev=88784&view=rev
Log:
Port commit 86749 (dpatel) from llvm-gcc:
Attach locatin info with llvm.dbg.declare.

Modified:
    dragonegg/trunk/llvm-convert.cpp
    dragonegg/trunk/llvm-debug.cpp
    dragonegg/trunk/llvm-debug.h

Modified: dragonegg/trunk/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-convert.cpp?rev=88784&r1=88783&r2=88784&view=diff

==============================================================================
--- dragonegg/trunk/llvm-convert.cpp (original)
+++ dragonegg/trunk/llvm-convert.cpp Sat Nov 14 06:33:29 2009
@@ -403,7 +403,7 @@
         TheDebugInfo->EmitDeclare(ResultDecl,
                                   dwarf::DW_TAG_return_variable,
                                   "agg.result", RetTy, Tmp,
-                                  Builder.GetInsertBlock());
+                                  Builder);
       }
       ++AI;
     }
@@ -709,7 +709,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
@@ -721,7 +721,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
@@ -755,6 +755,9 @@
     // Not supported yet.
   }
 
+  if (TheDebugInfo)
+    TheDebugInfo->EmitStopPoint(Fn, Builder.GetInsertBlock(), Builder);
+
   // Create a new block for the return node, but don't insert it yet.
   ReturnBB = BasicBlock::Create(Context, "return");
 }
@@ -1825,11 +1828,11 @@
     if (DECL_NAME(decl)) {
       TheDebugInfo->EmitDeclare(decl, dwarf::DW_TAG_auto_variable,
                                 AI->getName(), TREE_TYPE(decl), AI,
-                                Builder.GetInsertBlock());
+                                Builder);
     } else if (TREE_CODE(decl) == RESULT_DECL) {
       TheDebugInfo->EmitDeclare(decl, dwarf::DW_TAG_return_variable,
                                 AI->getName(), TREE_TYPE(decl), AI,
-                                Builder.GetInsertBlock());
+                                Builder);
     }
   }
 }

Modified: dragonegg/trunk/llvm-debug.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-debug.cpp?rev=88784&r1=88783&r2=88784&view=diff

==============================================================================
--- dragonegg/trunk/llvm-debug.cpp (original)
+++ dragonegg/trunk/llvm-debug.cpp Sat Nov 14 06:33:29 2009
@@ -302,7 +302,8 @@
 /// EmitDeclare - Constructs the debug code for allocation of a new variable.
 /// region - "llvm.dbg.declare."
 void DebugInfo::EmitDeclare(tree decl, unsigned Tag, StringRef Name,
-                            tree type, Value *AI, BasicBlock *CurBB) {
+                            tree type, Value *AI,
+                            LLVMBuilder &Builder) {
 
   // Do not emit variable declaration info, for now.
   if (optimize)
@@ -323,7 +324,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);
 }
 
 /// EmitStopPoint - Emit a call to llvm.dbg.stoppoint to indicate a change of 

Modified: dragonegg/trunk/llvm-debug.h
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-debug.h?rev=88784&r1=88783&r2=88784&view=diff

==============================================================================
--- dragonegg/trunk/llvm-debug.h (original)
+++ dragonegg/trunk/llvm-debug.h Sat Nov 14 06:33:29 2009
@@ -88,8 +88,7 @@
   /// EmitDeclare - Constructs the debug code for allocation of a new variable.
   /// region - "llvm.dbg.declare."
   void EmitDeclare(tree_node *decl, unsigned Tag, StringRef 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