> My apologies for the delay on Ada. I have reworked the patch to leave > the first pass on the TYPE_DECLs which are definitely needed. I also > optimized things a bit, since we don't need to save all the globals any > more.
Thanks, this looks fine modulo a couple of nits, see below. > There is one regression which I'd like you and Jason's input before > proceeding: > > +FAIL: gnat.dg/specs/debug1.ads scan-assembler-times DW_AT_artificial 17 > > The problem is that the Ada front-end twiddles the DECL_ARTIFICIAL flag > *after* it has called debug_hooks->early_global_decl(). The function > gnat_to_gnu_entity() calls create_var_decl_1->rest_of_decl_compilation, > but then much later twiddles DECL_ARTIFICIAL: > > if (!Comes_From_Source (gnat_entity)) > DECL_ARTIFICIAL (gnu_decl) = 1; > > Twiddling DECL_ARTIFICIAL after we create early dwarf, means the DIE > does not get the DW_AT_artificial. Would it be possible for you guys > (ahem, Ada folk) to set DECL_ARTIFICIAL before calling > rest_of_decl_compilation? Sure, just add a ??? comment before the above lines for now. @@ -535,8 +535,7 @@ extern tree gnat_type_for_size (unsigned precision, int unsignedp); an unsigned type; otherwise a signed type is returned. */ extern tree gnat_type_for_mode (machine_mode mode, int unsignedp); -/* Emit debug info for all global variable declarations. */ -extern void gnat_write_global_declarations (void); +extern void note_types_used_by_globals (void); The comment needs to be adjusted instead of removed and preferably be the same as the one (ajusted too) above the function in utils.c. -- Eric Botcazou