On 05/08/2015 03:35 AM, Richard Biener wrote:
On Fri, May 8, 2015 at 12:26 PM, Eric Botcazou <ebotca...@adacore.com> wrote:
@@ -5204,28 +5199,6 @@ gnat_write_global_declarations (void)
types_used_by_var_decl_insert (t, dummy_global);
}
}
-
- /* 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_SAFE_ELT (global_decls, i, iter)
- if (TREE_CODE (iter) == TYPE_DECL && !DECL_IGNORED_P (iter))
- debug_hooks->global_decl (iter);
Shouldn't that have used ->type_decl (iter) anyway? That is, are they not
already processed via rest_of_type_compilation or does the Ada FE not
use that?
My question exactly. Perhaps that was my confusion. Why is this using
->global_decl?
For example, the C front-end uses rest_of_type_compilation (see
finish_struct() in c/c-decl.c) which calls ->type_decl(), or it calls
->type_decl() from record_builtin_type().
- /* 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);
- }
}
What's the replacement mechanism for the first pass on global_decls? The
comment explains that generating debug info must be delayed in this case.
But yes, I don't think the patches add any replacement for processing
TYPE_DECLs that happen to be in global_decls.
I can put the code back, but calling ->type_decl()? Assuming you folks
(Ada) don't want to use rest_of_type_compilation().
Aldy