OSDN Git Service

Backport from mainline
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 6 Jan 2012 18:03:30 +0000 (18:03 +0000)
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 6 Jan 2012 18:03:30 +0000 (18:03 +0000)
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@182960 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/c-decl.c

index 77ac9fe..3437317 100644 (file)
@@ -1,3 +1,11 @@
+2012-01-06  Eric Botcazou  <ebotcazou@adacore.com>
+
+       Backport from mainline
+       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  Richard Sandiford  <richard.sandiford@linaro.org>
 
        PR middle-end/48660
index 0335cda..b148f5e 100644 (file)
@@ -9782,6 +9782,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
@@ -9792,6 +9795,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.  */
@@ -9810,10 +9815,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)