diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2019-10-11 08:19:03 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2019-10-11 08:19:03 +0000 |
commit | 104099b897fe28c5d28b81a83d7655ea3b91c0c8 (patch) | |
tree | b9d711df9dcd97928a740c08d713f196d23cdb21 /gcc/ada/gcc-interface/utils.c | |
parent | 848830dcf75bf887e7ff59a50a0be1463b7a8570 (diff) | |
download | gcc-104099b897fe28c5d28b81a83d7655ea3b91c0c8.zip gcc-104099b897fe28c5d28b81a83d7655ea3b91c0c8.tar.gz gcc-104099b897fe28c5d28b81a83d7655ea3b91c0c8.tar.bz2 |
decl.c (gnat_to_gnu_entity): New case to deal with the definition of named numbers.
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Named_{Integer|Real}>:
New case to deal with the definition of named numbers.
<E_Variable>: Minor tweaks. Set DECL_IGNORED_P on the CONST_DECL
if a corresponding variable is built.
* gcc-interface/trans.c (gnat_to_gnu) <N_Integer_Literal>: Return
error_mark_node instead of aborting on overflow for named numbers.
<N_Number_Declaration>: Reuse the <N_Object_Declaration> 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
Diffstat (limited to 'gcc/ada/gcc-interface/utils.c')
-rw-r--r-- | gcc/ada/gcc-interface/utils.c | 15 |
1 files changed, 9 insertions, 6 deletions
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: |