c-decl.c (ext_block): Moved up.
authorArnaud Charlet <charlet@adacore.com>
Fri, 6 Jan 2012 14:11:33 +0000 (14:11 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Fri, 6 Jan 2012 14:11:33 +0000 (15:11 +0100)
* c-decl.c (ext_block): Moved up.
(collect_all_refs, for_each_global_decl): Take ext_block into account.

From-SVN: r182953

gcc/ChangeLog
gcc/c-decl.c

index 5742ae68ebeda3754592ee2962bde96009118ab6..0457656b3ff945d19bf5969b481a2adfac51c768 100644 (file)
@@ -1,3 +1,8 @@
+2012-01-06  Arnaud Charlet  <charlet@adacore.com>
+
+       * c-decl.c (ext_block): Moved up.
+       (collect_all_refs, for_each_global_decl): Take ext_block into account.
+
 2012-01-06  Han Shen  <shenhan@google.com>
 
        Translate built-in include paths for sysroot.
index 96e9c7d17534c33d452519a82a33281e90fa6a69..45fb6b39f24f2ef2db9d76368ed812408c2bc9e3 100644 (file)
@@ -9932,6 +9932,9 @@ collect_source_ref_cb (tree decl)
     collect_source_ref (LOCATION_FILE (decl_sloc (decl, false)));
 }
 
+/* Preserve the external declarations scope across a garbage collect.  */
+static GTY(()) tree ext_block;
+
 /* Collect all references relevant to SOURCE_FILE.  */
 
 static void
@@ -9942,6 +9945,8 @@ collect_all_refs (const char *source_file)
 
   FOR_EACH_VEC_ELT (tree, all_translation_units, i, t)
     collect_ada_nodes (BLOCK_VARS (DECL_INITIAL (t)), source_file);
+
+  collect_ada_nodes (BLOCK_VARS (ext_block), source_file);
 }
 
 /* Iterate over all global declarations and call CALLBACK.  */
@@ -9960,10 +9965,10 @@ for_each_global_decl (void (*callback) (tree decl))
       for (decl = BLOCK_VARS (decls); decl; decl = TREE_CHAIN (decl))
        callback (decl);
     }
-}
 
-/* Preserve the external declarations scope across a garbage collect.  */
-static GTY(()) tree ext_block;
+  for (decl = BLOCK_VARS (ext_block); decl; decl = TREE_CHAIN (decl))
+    callback (decl);
+}
 
 void
 c_write_global_declarations (void)