[llvm-commits] [dragonegg] r92719 - in /dragonegg/trunk: llvm-abi.h llvm-debug.cpp

Duncan Sands baldrick at free.fr
Tue Jan 5 00:39:44 PST 2010


Author: baldrick
Date: Tue Jan  5 02:39:44 2010
New Revision: 92719

URL: http://llvm.org/viewvc/llvm-project?rev=92719&view=rev
Log:
Port commit 92229 (lattner) from llvm-gcc:
this form of SetDebugLocation is about to go away, add some #includes that
are about to not come in implicitly.

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

Modified: dragonegg/trunk/llvm-abi.h
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-abi.h?rev=92719&r1=92718&r2=92719&view=diff

==============================================================================
--- dragonegg/trunk/llvm-abi.h (original)
+++ dragonegg/trunk/llvm-abi.h Tue Jan  5 02:39:44 2010
@@ -33,6 +33,7 @@
 #include "llvm/CallingConv.h"
 #include "llvm/Constants.h"
 #include "llvm/DerivedTypes.h"
+#include "llvm/LLVMContext.h"
 #include "llvm/Target/TargetData.h"
 
 // System headers

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

==============================================================================
--- dragonegg/trunk/llvm-debug.cpp (original)
+++ dragonegg/trunk/llvm-debug.cpp Tue Jan  5 02:39:44 2010
@@ -344,8 +344,7 @@
 /// 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,
-                            LLVMBuilder &Builder) {
+                            tree type, Value *AI, LLVMBuilder &Builder) {
 
   // Do not emit variable declaration info, for now.
   if (optimize)
@@ -375,7 +374,10 @@
   llvm::DILocation DO(NULL);
   llvm::DILocation DL = 
     DebugFactory.CreateLocation(CurLineNo, 0 /* column */, VarScope, DO);
-  Builder.SetDebugLocation(Call, DL.getNode());
+  
+  llvm::LLVMContext &Context = Call->getContext();
+  unsigned DbgMDKind = Context.getMetadata().getMDKindID("dbg");
+  Context.getMetadata().addMD(DbgMDKind, DL.getNode(), Call);
 }
 
 /// EmitStopPoint - Emit a call to llvm.dbg.stoppoint to indicate a change of 





More information about the llvm-commits mailing list