[llvm-commits] [dragonegg] r85713 - in /dragonegg/trunk: llvm-convert.cpp www/index.html

Duncan Sands baldrick at free.fr
Sun Nov 1 01:50:22 PDT 2009


Author: baldrick
Date: Sun Nov  1 02:50:22 2009
New Revision: 85713

URL: http://llvm.org/viewvc/llvm-project?rev=85713&view=rev
Log:
Produce debug location info.  While some info about variables is
produced it is basically useless, since it is for alloca's and
most variables are in registers.

Modified:
    dragonegg/trunk/llvm-convert.cpp
    dragonegg/trunk/www/index.html

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

==============================================================================
--- dragonegg/trunk/llvm-convert.cpp (original)
+++ dragonegg/trunk/llvm-convert.cpp Sun Nov  1 02:50:22 2009
@@ -228,7 +228,7 @@
       TheDebugInfo->setLocationFile(Location.file);
       TheDebugInfo->setLocationLine(Location.line);
     } else {
-      TheDebugInfo->setLocationFile("<unknown file>");
+      TheDebugInfo->setLocationFile("");
       TheDebugInfo->setLocationLine(0);
     }
   }
@@ -1051,6 +1051,17 @@
     gimple stmt = gsi_stmt(gsi);
     ++NumStatements;
 
+    if (TheDebugInfo) {
+      if (gimple_has_location(stmt)) {
+        TheDebugInfo->setLocationFile(gimple_filename(stmt));
+        TheDebugInfo->setLocationLine(gimple_lineno(stmt));
+      } else {
+        TheDebugInfo->setLocationFile("");
+        TheDebugInfo->setLocationLine(0);
+      }
+      TheDebugInfo->EmitStopPoint(Fn, Builder.GetInsertBlock(), Builder);
+    }
+
     switch (gimple_code(stmt)) {
     case GIMPLE_ASM:
       RenderGIMPLE_ASM(stmt);
@@ -1099,6 +1110,12 @@
     }
   }
 
+  if (TheDebugInfo) {
+    TheDebugInfo->setLocationFile("");
+    TheDebugInfo->setLocationLine(0);
+    TheDebugInfo->EmitStopPoint(Fn, Builder.GetInsertBlock(), Builder);
+  }
+
   // Add a branch to the fallthru block.
   edge e;
   edge_iterator ei;
@@ -1139,16 +1156,6 @@
 
   Value *Result = 0;
 
-  if (TheDebugInfo) {
-    if (EXPR_HAS_LOCATION(exp)) {
-      // Set new location on the way up the tree.
-      TheDebugInfo->setLocationFile(EXPR_FILENAME(exp));
-      TheDebugInfo->setLocationLine(EXPR_LINENO(exp));
-    }
-
-    TheDebugInfo->EmitStopPoint(Fn, Builder.GetInsertBlock(), Builder);
-  }
-
   switch (TREE_CODE(exp)) {
   default:
     debug_tree(exp);
@@ -1195,12 +1202,6 @@
     break;
   }
 
-  if (TheDebugInfo && EXPR_HAS_LOCATION(exp)) {
-    // Restore location back down the tree.
-    TheDebugInfo->setLocationFile(EXPR_FILENAME(exp));
-    TheDebugInfo->setLocationLine(EXPR_LINENO(exp));
-  }
-
   assert(((DestLoc && Result == 0) || DestLoc == 0) &&
          "Expected a scalar or aggregate but got the wrong thing!");
   // Check that the type of the result matches that of the tree node.  If the

Modified: dragonegg/trunk/www/index.html
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/www/index.html?rev=85713&r1=85712&r2=85713&view=diff

==============================================================================
--- dragonegg/trunk/www/index.html (original)
+++ dragonegg/trunk/www/index.html Sun Nov  1 02:50:22 2009
@@ -41,7 +41,7 @@
   <li>Java, Obj-C and Obj-C++ are untested</li>
   <li>Exception handling does not work</li>
   <li>Indirect gotos do not always work</li>
-  <li>No debug info worth speaking of</li>
+  <li>Limited debug info</li>
   <li>Requires one gcc patch</li>
   <li>Only supports x86-32 and x86-64</li>
   <li>Only supports linux and darwin</li>





More information about the llvm-commits mailing list