diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2009-04-22 08:34:09 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2009-04-22 08:34:09 +0000 |
commit | feec4372c1d33b1d7de0442d9d6308c2b96255ca (patch) | |
tree | bc368177858013d50041be20988e8673b42cffe4 /gcc/ada/gcc-interface/misc.c | |
parent | 7d83f4f5362bb17aa3b53db60bed6dbb5cd38e73 (diff) | |
download | gcc-feec4372c1d33b1d7de0442d9d6308c2b96255ca.zip gcc-feec4372c1d33b1d7de0442d9d6308c2b96255ca.tar.gz gcc-feec4372c1d33b1d7de0442d9d6308c2b96255ca.tar.bz2 |
ada-tree.def: Fix formatting nits.
* gcc-interface/ada-tree.def: Fix formatting nits.
(REGION_STMT): Delete.
(HANDLER_STMT): Likewise.
* gcc-interface/ada-tree.h: Fix formatting nits.
(IS_STMT): Delete.
(REGION_STMT_BODY): Likewise.
(REGION_STMT_HANDLE): Likewise.
(REGION_STMT_BLOCK): Likewise.
(HANDLER_STMT_ARG): Likewise.
(HANDLER_STMT_LIST): Likewise.
(HANDLER_STMT_BLOCK): Likewise.
* gcc-interface/gigi.h (fp_prec_to_size): Update comment.
(fp_size_to_prec): Likewise.
(largest_move_alignment): Delete.
(gnat_compute_largest_alignment): Likewise.
Fix minor nits.
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Signed_Integer_Subtype>:
Remove redundant code.
<E_Array_Type>: Remove redundant assert.
<E_Array_Subtype>: Exit early from index computation in pathological
cases.
Rewrite conditional assignment.
(make_type_from_size): Likewise.
* gcc-interface/misc.c (largest_move_alignment): Delete.
(gnat_finish_incomplete_decl): Likewise.
(LANG_HOOKS_FINISH_INCOMPLETE_DECL): Likewise.
(asm_out_file): Likewise
(gnat_print_type) <INTEGER_TYPE>: Fall through to ENUMERAL_TYPE case.
(gnat_dwarf_name): Move around.
* gcc-interface/trans.c (Attribute_to_gnu): Fix minor nits.
(gigi): Remove call to gnat_compute_largest_alignment.
* utils.c (create_field_decl): Rewrite conditional assignment.
Fix minor nits.
From-SVN: r146551
Diffstat (limited to 'gcc/ada/gcc-interface/misc.c')
-rw-r--r-- | gcc/ada/gcc-interface/misc.c | 89 |
1 files changed, 28 insertions, 61 deletions
diff --git a/gcc/ada/gcc-interface/misc.c b/gcc/ada/gcc-interface/misc.c index 6edf7f4..c35a9c3 100644 --- a/gcc/ada/gcc-interface/misc.c +++ b/gcc/ada/gcc-interface/misc.c @@ -72,14 +72,7 @@ #include "opts.h" #include "options.h" -extern FILE *asm_out_file; - -/* The largest alignment, in bits, that is needed for using the widest - move instruction. */ -unsigned int largest_move_alignment; - static bool gnat_init (void); -static void gnat_finish_incomplete_decl (tree); static unsigned int gnat_init_options (unsigned int, const char **); static int gnat_handle_option (size_t, const char *, int); static bool gnat_post_options (const char **); @@ -118,8 +111,6 @@ static tree gnat_type_max_size (const_tree); #define LANG_HOOKS_PUSHDECL gnat_return_tree #undef LANG_HOOKS_WRITE_GLOBALS #define LANG_HOOKS_WRITE_GLOBALS gnat_write_global_declarations -#undef LANG_HOOKS_FINISH_INCOMPLETE_DECL -#define LANG_HOOKS_FINISH_INCOMPLETE_DECL gnat_finish_incomplete_decl #undef LANG_HOOKS_GET_ALIAS_SET #define LANG_HOOKS_GET_ALIAS_SET gnat_get_alias_set #undef LANG_HOOKS_MARK_ADDRESSABLE @@ -153,18 +144,14 @@ const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER; are incompatible with regular GDB versions, so we must make sure to only produce them on explicit request. This is eventually reflected into the use_gnu_debug_info_extensions common flag for later processing. */ - static int gnat_dwarf_extensions = 0; -/* Command-line argc and argv. - These variables are global, since they are imported and used in - back_end.adb */ - +/* Command-line argc and argv. These variables are global + since they are imported in back_end.adb. */ unsigned int save_argc; const char **save_argv; -/* gnat standard argc argv */ - +/* GNAT argc and argv. */ extern int gnat_argc; extern char **gnat_argv; @@ -202,8 +189,8 @@ gnat_parse_file (int set_yydebug ATTRIBUTE_UNUSED) /* Decode all the language specific options that cannot be decoded by GCC. The option decoding phase of GCC calls this routine on the flags that - it cannot decode. This routine returns the number of consecutive arguments - from ARGV that it successfully decoded; 0 indicates failure. */ + it cannot decode. Return the number of consecutive arguments from ARGV + that have been successfully decoded or 0 on failure. */ static int gnat_handle_option (size_t scode, const char *arg, int value) @@ -427,34 +414,6 @@ gnat_init (void) return true; } -/* This function is called indirectly from toplev.c to handle incomplete - declarations, i.e. VAR_DECL nodes whose DECL_SIZE is zero. To be precise, - compile_file in toplev.c makes an indirect call through the function pointer - incomplete_decl_finalize_hook which is initialized to this routine in - init_decl_processing. */ - -static void -gnat_finish_incomplete_decl (tree dont_care ATTRIBUTE_UNUSED) -{ - gcc_unreachable (); -} - -/* Compute the alignment of the largest mode that can be used for copying - objects. */ - -void -gnat_compute_largest_alignment (void) -{ - enum machine_mode mode; - - for (mode = GET_CLASS_NARROWEST_MODE (MODE_INT); mode != VOIDmode; - mode = GET_MODE_WIDER_MODE (mode)) - if (optab_handler (mov_optab, mode)->insn_code != CODE_FOR_nothing) - largest_move_alignment = MIN (BIGGEST_ALIGNMENT, - MAX (largest_move_alignment, - GET_MODE_ALIGNMENT (mode))); -} - /* If we are using the GCC mechanism to process exception handling, we have to register the personality routine for Ada and to initialize various language dependent hooks. */ @@ -506,7 +465,7 @@ gnat_init_gcc_eh (void) #endif } -/* Language hooks, first one to print language-specific items in a DECL. */ +/* Print language-specific items in declaration NODE. */ static void gnat_print_decl (FILE *file, tree node, int indent) @@ -533,6 +492,8 @@ gnat_print_decl (FILE *file, tree node, int indent) } } +/* Print language-specific items in type NODE. */ + static void gnat_print_type (FILE *file, tree node, int indent) { @@ -542,11 +503,6 @@ gnat_print_type (FILE *file, tree node, int indent) print_node (file, "ci_co_list", TYPE_CI_CO_LIST (node), indent + 4); break; - case ENUMERAL_TYPE: - case BOOLEAN_TYPE: - print_node (file, "RM size", TYPE_RM_SIZE (node), indent + 4); - break; - case INTEGER_TYPE: if (TYPE_MODULAR_P (node)) print_node (file, "modulus", TYPE_MODULUS (node), indent + 4); @@ -558,6 +514,10 @@ gnat_print_type (FILE *file, tree node, int indent) else print_node (file, "index type", TYPE_INDEX_TYPE (node), indent + 4); + /* ... fall through ... */ + + case ENUMERAL_TYPE: + case BOOLEAN_TYPE: print_node (file, "RM size", TYPE_RM_SIZE (node), indent + 4); break; @@ -583,13 +543,7 @@ gnat_print_type (FILE *file, tree node, int indent) } } -static const char * -gnat_dwarf_name (tree t, int verbosity ATTRIBUTE_UNUSED) -{ - gcc_assert (DECL_P (t)); - - return (const char *) IDENTIFIER_POINTER (DECL_NAME (t)); -} +/* Return the name to be printed for DECL. */ static const char * gnat_printable_name (tree decl, int verbosity) @@ -604,8 +558,17 @@ gnat_printable_name (tree decl, int verbosity) Set_Identifier_Casing (ada_name, (char *) DECL_SOURCE_FILE (decl)); return ggc_strdup (Name_Buffer); } - else - return ada_name; + + return ada_name; +} + +/* Return the name to be used in DWARF debug info for DECL. */ + +static const char * +gnat_dwarf_name (tree decl, int verbosity ATTRIBUTE_UNUSED) +{ + gcc_assert (DECL_P (decl)); + return (const char *) IDENTIFIER_POINTER (DECL_NAME (decl)); } /* Do nothing (return the tree node passed). */ @@ -810,6 +773,8 @@ enumerate_modes (void (*f) (int, int, int, int, int, int, unsigned int)) } } +/* Return the size of the FP mode with precision PREC. */ + int fp_prec_to_size (int prec) { @@ -823,6 +788,8 @@ fp_prec_to_size (int prec) gcc_unreachable (); } +/* Return the precision of the FP mode with size SIZE. */ + int fp_size_to_prec (int size) { |