[llvm-branch-commits] [llvm-gcc-branch] r106307 - in /llvm-gcc-4.2/branches/Apple/Morbo: ./ gcc/llvm-convert.cpp

Stuart Hastings stuart at apple.com
Fri Jun 18 13:24:03 PDT 2010


Author: stuart
Date: Fri Jun 18 15:24:03 2010
New Revision: 106307

URL: http://llvm.org/viewvc/llvm-project?rev=106307&view=rev
Log:
Morbonize r106243, r106244, r106270.  Radar 7421831.

Modified:
    llvm-gcc-4.2/branches/Apple/Morbo/   (props changed)
    llvm-gcc-4.2/branches/Apple/Morbo/gcc/llvm-convert.cpp

Propchange: llvm-gcc-4.2/branches/Apple/Morbo/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jun 18 15:24:03 2010
@@ -1,2 +1,2 @@
 /llvm/trunk:100565
-/llvm-gcc-4.2/trunk:98728,98841,98893,99196,99305,99592-99593,99629,99670,99982,99984-99986,99988,99992-99993,99995,99997-99999,100035,100149,100303,100565,100624-100626,100712,100721,101090-101091,101199,101216,101304,101333,101804,101959,102139,102148,102433,102444,102506-102507,102511,102532,102561,102589,102636,102648,102745,103361,103366-103367,103394,103414,103644,103800,103918,104181,104384,104420,104423,104726,105504,105828-105829,105902,105948-105949,106005
+/llvm-gcc-4.2/trunk:98728,98841,98893,99196,99305,99592-99593,99629,99670,99982,99984-99986,99988,99992-99993,99995,99997-99999,100035,100149,100303,100565,100624-100626,100712,100721,101090-101091,101199,101216,101304,101333,101804,101959,102139,102148,102433,102444,102506-102507,102511,102532,102561,102589,102636,102648,102745,103361,103366-103367,103394,103414,103644,103800,103918,104181,104384,104420,104423,104726,105504,105828-105829,105902,105948-105949,106005,106243-106244,106270

Modified: llvm-gcc-4.2/branches/Apple/Morbo/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Morbo/gcc/llvm-convert.cpp?rev=106307&r1=106306&r2=106307&view=diff
==============================================================================
--- llvm-gcc-4.2/branches/Apple/Morbo/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/branches/Apple/Morbo/gcc/llvm-convert.cpp Fri Jun 18 15:24:03 2010
@@ -812,11 +812,12 @@
   basic_block bb;
   edge e;
   edge_iterator ei;
+  tree stmt = NULL_TREE;
   FOR_EACH_BB (bb) {
     for (block_stmt_iterator bsi = bsi_start (bb); !bsi_end_p (bsi);
          bsi_next (&bsi)) {
       MemRef DestLoc;
-      tree stmt = bsi_stmt (bsi);
+      stmt = bsi_stmt (bsi);
 
       // If this stmt returns an aggregate value (e.g. a call whose result is
       // ignored), create a temporary to receive the value.  Note that we don't
@@ -828,6 +829,21 @@
       Emit(stmt, DestLoc.Ptr ? &DestLoc : NULL);
     }
 
+    // If we didn't see any statements, the current bb is an empty
+    // basic block.  But an empty block must have one outgoing edge,
+    // and there might be some location info there; grab it.
+    if (!stmt && EmitDebugInfo()) {
+      assert(EDGE_COUNT(bb->succs) == 1 && "empty basic block with multiple successors?") ;
+      e = EDGE_I(bb->succs, 0);
+      source_locus locus = e->goto_locus;
+      if (locus) {
+        // Set new location on the way up the tree.
+        TheDebugInfo->setLocationFile(LOCATION_FILE(*locus));
+        TheDebugInfo->setLocationLine(LOCATION_LINE(*locus));
+      }
+      TheDebugInfo->EmitStopPoint(Fn, Builder.GetInsertBlock(), Builder);
+    }
+
     FOR_EACH_EDGE (e, ei, bb->succs)
       if (e->flags & EDGE_FALLTHRU)
         break;





More information about the llvm-branch-commits mailing list