diff mbox

[1/10] debug-early merge: Ada front-end

Message ID 13015161.AmsL9u3xPQ@polaris
State New
Headers show

Commit Message

Eric Botcazou May 9, 2015, 11:29 a.m. UTC
> My question exactly.  Perhaps that was my confusion.  Why is this using
> ->global_decl?

Because that's equivalent to ->type_decl (iter, false) in DWARF.

> 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().

All right, let's follow the gospel then. :-)  Patch attached and installed.

> I can put the code back, but calling ->type_decl()?  Assuming you folks
> (Ada) don't want to use rest_of_type_compilation().

No, we don't use it for local types either (it's a no-op in DWARF in this case 
and we don't support STABS anymore because of the need to manually delay the 
generation of debug info for local types, which is a real pain in Ada).


	* gcc-interface/utils.c (gnat_write_global_declarations): Use type_decl
	method instead of global_decl for TYPE_DECLs.
diff mbox

Patch

Index: gcc-interface/utils.c
===================================================================
--- gcc-interface/utils.c	(revision 222673)
+++ gcc-interface/utils.c	(working copy)
@@ -5211,7 +5211,7 @@  gnat_write_global_declarations (void)
      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);
+      debug_hooks->type_decl (iter, false);
 
   /* Proceed to optimize and emit assembly. */
   symtab->finalize_compilation_unit ();