diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2011-06-06 10:00:32 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2011-06-06 10:00:32 +0000 |
commit | 10e4d0563e0862eaf29529134cc7b6495fecaa51 (patch) | |
tree | 95670f8be314f1ca9d4417d4ca2a1c6333a55f00 /gcc/ada/gcc-interface/utils.c | |
parent | aa4203e7344b980828998592db0d60f8bc77261e (diff) | |
download | gcc-10e4d0563e0862eaf29529134cc7b6495fecaa51.zip gcc-10e4d0563e0862eaf29529134cc7b6495fecaa51.tar.gz gcc-10e4d0563e0862eaf29529134cc7b6495fecaa51.tar.bz2 |
utils.c: Include diagnostic.h.
* gcc-interface/utils.c: Include diagnostic.h.
(gnat_write_global_declarations): Output debug information for all
global type declarations before finalizing the compilation unit.
* gcc-interface/Make-lang.in (ada/utils.o): Add dependency.
From-SVN: r174687
Diffstat (limited to 'gcc/ada/gcc-interface/utils.c')
-rw-r--r-- | gcc/ada/gcc-interface/utils.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c index ad2ff2a..0f2a331 100644 --- a/gcc/ada/gcc-interface/utils.c +++ b/gcc/ada/gcc-interface/utils.c @@ -38,6 +38,7 @@ #include "target.h" #include "langhooks.h" #include "cgraph.h" +#include "diagnostic.h" #include "tree-dump.h" #include "tree-inline.h" #include "tree-iterator.h" @@ -4756,6 +4757,9 @@ static GTY (()) tree dummy_global; void gnat_write_global_declarations (void) { + unsigned int i; + tree iter; + /* If we have declared types as used at the global level, insert them in the global hash table. We use a dummy variable for this purpose. */ if (!VEC_empty (tree, types_used_by_cur_var_decl)) @@ -4773,13 +4777,28 @@ gnat_write_global_declarations (void) } } + /* Output debug information for all global type declarations first. This + ensures that global types whose compilation hasn't been finalized yet, + for example pointers to Taft amendment types, have their compilation + finalized in the right context. */ + FOR_EACH_VEC_ELT (tree, global_decls, i, iter) + if (TREE_CODE (iter) == TYPE_DECL) + debug_hooks->global_decl (iter); + /* Proceed to optimize and emit assembly. FIXME: shouldn't be the front end's responsibility to call this. */ cgraph_finalize_compilation_unit (); - /* Emit debug info for all global declarations. */ - emit_debug_global_declarations (VEC_address (tree, global_decls), - VEC_length (tree, global_decls)); + /* After cgraph has had a chance to emit everything that's going to + be emitted, output debug information for the rest of globals. */ + if (!seen_error ()) + { + timevar_push (TV_SYMOUT); + FOR_EACH_VEC_ELT (tree, global_decls, i, iter) + if (TREE_CODE (iter) != TYPE_DECL) + debug_hooks->global_decl (iter); + timevar_pop (TV_SYMOUT); + } } /* ************************************************************************ |