[llvm-commits] [dragonegg] r101887 - /dragonegg/branches/release_27/llvm-debug.cpp

Duncan Sands baldrick at free.fr
Tue Apr 20 00:43:00 PDT 2010


Author: baldrick
Date: Tue Apr 20 02:43:00 2010
New Revision: 101887

URL: http://llvm.org/viewvc/llvm-project?rev=101887&view=rev
Log:
Undo commits 100103 and 100286, which are incompatible with llvm-2.7:
Port commit 100220 (lattner) from llvm-gcc, fixing the build:
NewDebugLoc -> DebugLoc.

Port commit 100094 (lattner) from llvm-gcc:
adjust to IRBuilder change and use faster DebugLoc apis.


Modified:
    dragonegg/branches/release_27/llvm-debug.cpp

Modified: dragonegg/branches/release_27/llvm-debug.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/branches/release_27/llvm-debug.cpp?rev=101887&r1=101886&r2=101887&view=diff
==============================================================================
--- dragonegg/branches/release_27/llvm-debug.cpp (original)
+++ dragonegg/branches/release_27/llvm-debug.cpp Tue Apr 20 02:43:00 2010
@@ -416,7 +416,12 @@
   // Insert an llvm.dbg.declare into the current block.
   Instruction *Call = DebugFactory.InsertDeclare(AI, D, 
                                                  Builder.GetInsertBlock());
-  Call->setDebugLoc(DebugLoc::get(CurLineNo, 0, VarScope.getNode()));
+
+  llvm::DILocation DO(NULL);
+  llvm::DILocation DL = 
+    DebugFactory.CreateLocation(CurLineNo, 0 /* column */, VarScope, DO);
+  
+  Call->setMetadata("dbg", DL.getNode());
 }
 
 /// EmitStopPoint - Emit a call to llvm.dbg.stoppoint to indicate a change of 
@@ -437,8 +442,12 @@
 
     if (RegionStack.empty())
       return;
-    MDNode *Scope = cast<MDNode>(RegionStack.back());
-    Builder.SetCurrentDebugLocation(DebugLoc::get(CurLineNo,0/*col*/,Scope));
+    llvm::DIDescriptor DR(cast<MDNode>(RegionStack.back()));
+    llvm::DIScope DS = llvm::DIScope(DR.getNode());
+    llvm::DILocation DO(NULL);
+    llvm::DILocation DL = 
+      DebugFactory.CreateLocation(CurLineNo, 0 /* column */, DS, DO);
+    Builder.SetCurrentDebugLocation(DL.getNode());
 }
 
 /// EmitGlobalVariable - Emit information about a global variable.





More information about the llvm-commits mailing list