[llvm-commits] [llvm-gcc-4.2] r92229 - in /llvm-gcc-4.2/trunk/gcc: llvm-abi.h llvm-debug.cpp

Chris Lattner sabre at nondot.org
Mon Dec 28 13:44:56 PST 2009


Author: lattner
Date: Mon Dec 28 15:44:56 2009
New Revision: 92229

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


Modified:
    llvm-gcc-4.2/trunk/gcc/llvm-abi.h
    llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp

Modified: llvm-gcc-4.2/trunk/gcc/llvm-abi.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-abi.h?rev=92229&r1=92228&r2=92229&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-abi.h (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-abi.h Mon Dec 28 15:44:56 2009
@@ -35,6 +35,7 @@
 #include "llvm/CallingConv.h"
 #include "llvm/Constants.h"
 #include "llvm/DerivedTypes.h"
+#include "llvm/LLVMContext.h"
 #include "llvm/Target/TargetData.h"
 
 namespace llvm {

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=92229&r1=92228&r2=92229&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Mon Dec 28 15:44:56 2009
@@ -351,8 +351,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)
@@ -382,7 +381,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);
 }
 
 





More information about the llvm-commits mailing list