[llvm-commits] [dragonegg] r85711 - /dragonegg/trunk/llvm-debug.cpp

Duncan Sands baldrick at free.fr
Sun Nov 1 01:47:38 PDT 2009


Author: baldrick
Date: Sun Nov  1 02:47:37 2009
New Revision: 85711

URL: http://llvm.org/viewvc/llvm-project?rev=85711&view=rev
Log:
Copy an important part of debug info support from llvm-gcc;
it had somehow been left out.

Modified:
    dragonegg/trunk/llvm-debug.cpp

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

==============================================================================
--- dragonegg/trunk/llvm-debug.cpp (original)
+++ dragonegg/trunk/llvm-debug.cpp Sun Nov  1 02:47:37 2009
@@ -341,10 +341,21 @@
   PrevFullPath = CurFullPath;
   PrevLineNo = CurLineNo;
   PrevBB = CurBB;
-  
-  DebugFactory.InsertStopPoint(getOrCreateCompileUnit(CurFullPath), 
-                               CurLineNo, 0 /*column no. */,
-                               CurBB);
+
+#ifdef ATTACH_DEBUG_INFO_TO_AN_INSN
+    if (RegionStack.empty())
+      return;
+    llvm::DIDescriptor DR = 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());
+#else
+    DebugFactory.InsertStopPoint(getOrCreateCompileUnit(CurFullPath), 
+                                 CurLineNo, 0 /*column no. */,
+                                 CurBB);
+#endif
 }
 
 /// EmitGlobalVariable - Emit information about a global variable.





More information about the llvm-commits mailing list