diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-01-06 14:11:33 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-01-06 14:11:33 +0000 |
commit | 00ce46e280d46261af40442fce86cc4cc312811f (patch) | |
tree | 4ff8e7acf1f2eb69d93439fae3fe079b3290b0d7 /gcc/c-decl.c | |
parent | 2ff958e6232e1150011c2eb61f685961425b37b2 (diff) | |
download | gcc-00ce46e280d46261af40442fce86cc4cc312811f.tar.gz |
* 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/trunk@182953 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 96e9c7d1753..45fb6b39f24 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -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) |