aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/gcc-interface/utils.c')
-rw-r--r--gcc/ada/gcc-interface/utils.c34
1 files changed, 13 insertions, 21 deletions
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c
index f3d44e9..307a841 100644
--- a/gcc/ada/gcc-interface/utils.c
+++ b/gcc/ada/gcc-interface/utils.c
@@ -224,8 +224,8 @@ static GTY((deletable)) struct gnat_binding_level *free_binding_level;
/* The context to be used for global declarations. */
static GTY(()) tree global_context;
-/* An array of global declarations. */
-static GTY(()) vec<tree, va_gc> *global_decls;
+/* An array of global type declarations. */
+static GTY(()) vec<tree, va_gc> *type_decls;
/* An array of builtin function declarations. */
static GTY(()) vec<tree, va_gc> *builtin_decls;
@@ -756,7 +756,10 @@ gnat_pushdecl (tree decl, Node_Id gnat_node)
vec_safe_push (builtin_decls, decl);
}
else if (global_bindings_p ())
- vec_safe_push (global_decls, decl);
+ {
+ if (TREE_CODE (decl) == TYPE_DECL)
+ vec_safe_push (type_decls, decl);
+ }
else
{
DECL_CHAIN (decl) = BLOCK_VARS (current_binding_level->block);
@@ -5183,8 +5186,11 @@ smaller_form_type_p (tree type, tree orig_type)
static GTY (()) tree dummy_global;
+/* Keep track of types used at the global level and emit debug info
+ for all global types. */
+
void
-gnat_write_global_declarations (void)
+note_types_used_by_globals (void)
{
unsigned int i;
tree iter;
@@ -5214,26 +5220,12 @@ 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,
+ ensures that global types whose compilation haven't been finalized yet,
for example pointers to Taft amendment types, have their compilation
finalized in the right context. */
- FOR_EACH_VEC_SAFE_ELT (global_decls, i, iter)
- if (TREE_CODE (iter) == TYPE_DECL && !DECL_IGNORED_P (iter))
+ FOR_EACH_VEC_SAFE_ELT (type_decls, i, iter)
+ if (!DECL_IGNORED_P (iter))
debug_hooks->type_decl (iter, false);
-
- /* Proceed to optimize and emit assembly. */
- symtab->finalize_compilation_unit ();
-
- /* 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_SAFE_ELT (global_decls, i, iter)
- if (TREE_CODE (iter) != TYPE_DECL && !DECL_IGNORED_P (iter))
- debug_hooks->global_decl (iter);
- timevar_pop (TV_SYMOUT);
- }
}
/* ************************************************************************