[llvm-commits] [llvm-gcc-4.2] r66925 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp

Devang Patel dpatel at apple.com
Fri Mar 13 11:41:32 PDT 2009


Author: dpatel
Date: Fri Mar 13 13:41:32 2009
New Revision: 66925

URL: http://llvm.org/viewvc/llvm-project?rev=66925&view=rev
Log:
Use TREE_BLOCK to access block info.

Modified:
    llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp

Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=66925&r1=66924&r2=66925&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Fri Mar 13 13:41:32 2009
@@ -732,31 +732,29 @@
       tree stmt = bsi_stmt (bsi);
       // FIXME : Optimizer and code generator are not doing the right thing yet
       // while dealing with variable's debug info locations.
-      if (TheDebugInfo && !optimize) {
+      tree new_stmt_block = TREE_BLOCK (stmt);
+      if (TheDebugInfo && new_stmt_block && !optimize) {
         if (stmt_block == NULL_TREE) 
           // This is beginning of function. llvm.dbg.func.start is emitted so
           // no need to emit llvm.dbg.region.start here.
-          stmt_block = BLOCK_SUBBLOCKS (stmt);
+          stmt_block = new_stmt_block;
         else {
-          tree new_stmt_block = BLOCK_SUBBLOCKS (stmt);
-          if (new_stmt_block) {
-            if (stmt_block != new_stmt_block) {
-              if (BLOCK_SUPERCONTEXT (new_stmt_block) == stmt_block) 
-                // Entering new scope. Emit llvm.dbg.func.start.
-                TheDebugInfo->EmitRegionStart(Builder.GetInsertBlock());
-              else if (BLOCK_SUPERCONTEXT (new_stmt_block) == 
-                       BLOCK_SUPERCONTEXT (stmt_block)) {
-                // Entering new scope at the same level. End previous current 
-                // region by emitting llvm.dbg.region.end. And emit 
-                // llvm.dbg.region.start to start new region.
-                TheDebugInfo->EmitRegionEnd(Builder.GetInsertBlock());
-                TheDebugInfo->EmitRegionStart(Builder.GetInsertBlock());
-              } else
-                // Leaving current scop.e Emit llvm.dbg.region.end.
-                TheDebugInfo->EmitRegionEnd(Builder.GetInsertBlock());
-
-              stmt_block = BLOCK_SUBBLOCKS (stmt);
-            }
+          if (stmt_block != new_stmt_block) {
+            if (BLOCK_SUPERCONTEXT (new_stmt_block) == stmt_block) 
+              // Entering new scope. Emit llvm.dbg.func.start.
+              TheDebugInfo->EmitRegionStart(Builder.GetInsertBlock());
+            else if (BLOCK_SUPERCONTEXT (new_stmt_block) == 
+                     BLOCK_SUPERCONTEXT (stmt_block)) {
+              // Entering new scope at the same level. End previous current 
+              // region by emitting llvm.dbg.region.end. And emit 
+              // llvm.dbg.region.start to start new region.
+              TheDebugInfo->EmitRegionEnd(Builder.GetInsertBlock());
+              TheDebugInfo->EmitRegionStart(Builder.GetInsertBlock());
+            } else
+              // Leaving current scop.e Emit llvm.dbg.region.end.
+              TheDebugInfo->EmitRegionEnd(Builder.GetInsertBlock());
+            
+            stmt_block = new_stmt_block;
           }
         }
       }





More information about the llvm-commits mailing list