From 104099b897fe28c5d28b81a83d7655ea3b91c0c8 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Fri, 11 Oct 2019 08:19:03 +0000 Subject: decl.c (gnat_to_gnu_entity): New case to deal with the definition of named numbers. * gcc-interface/decl.c (gnat_to_gnu_entity) : New case to deal with the definition of named numbers. : Minor tweaks. Set DECL_IGNORED_P on the CONST_DECL if a corresponding variable is built. * gcc-interface/trans.c (gnat_to_gnu) : Return error_mark_node instead of aborting on overflow for named numbers. : Reuse the case and deal with error_mark_node specifically. * gcc-interface/utils.c (create_var_decl): Do not set DECL_IGNORED_P on CONST_DECLs. (gnat_write_global_declarations): Output global constants. From-SVN: r276864 --- gcc/ada/gcc-interface/utils.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'gcc/ada/gcc-interface/utils.c') diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c index d2891f2..e14645a 100644 --- a/gcc/ada/gcc-interface/utils.c +++ b/gcc/ada/gcc-interface/utils.c @@ -2731,13 +2731,11 @@ create_var_decl (tree name, tree asm_name, tree type, tree init, && !have_global_bss_p ()) DECL_COMMON (var_decl) = 1; - /* Do not emit debug info for a CONST_DECL if optimization isn't enabled, - since we will create an associated variable. Likewise for an external - constant whose initializer is not absolute, because this would mean a - global relocation in a read-only section which runs afoul of the PE-COFF - run-time relocation mechanism. */ + /* Do not emit debug info if not requested, or for an external constant whose + initializer is not absolute because this would require a global relocation + in a read-only section which runs afoul of the PE-COFF run-time relocation + mechanism. */ if (!debug_info_p - || (TREE_CODE (var_decl) == CONST_DECL && !optimize) || (extern_flag && constant_p && init @@ -5840,6 +5838,11 @@ gnat_write_global_declarations (void) && DECL_FUNCTION_IS_DEF (iter)) debug_hooks->early_global_decl (iter); + /* Output global constants. */ + FOR_EACH_VEC_SAFE_ELT (global_decls, i, iter) + if (TREE_CODE (iter) == CONST_DECL && !DECL_IGNORED_P (iter)) + debug_hooks->early_global_decl (iter); + /* Then output the global variables. We need to do that after the debug information for global types is emitted so that they are finalized. Skip external global variables, unless we need to emit debug info for them: -- cgit v1.1