From 1366ba411aced82547671901bf20655b40e3dded Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Mon, 25 May 2015 21:12:39 +0000 Subject: [PATCH] targtyps.c (get_float_words_be): Rename into... * gcc-interface/targtyps.c (get_float_words_be): Rename into... (get_target_float_words_be): ...this. (get_words_be): Rename into... (get_target_words_be): ...this. (get_bytes_be): Rename into... (get_target_bytes_be): ...this. (get_bits_be): Rename into... (get_target_bits_be): ...this. * gcc-interface/gigi.h (standard_datatypes): Remove ADT_ptr_void_type. (ptr_void_type_node): Delete. (get_target_float_size): Likewise. (get_target_double_size): Likewise. (get_target_long_double_size): Likewise. (get_float_words_be): Likewise. (get_words_be): Likewise. (get_bytes_be): Likewise. (get_bits_be): Likewise. (get_target_float_words_be): Declare. (get_target_words_be): Likewise. (get_target_bytes_be): Likewise. (get_target_bits_be): Likewise. * gcc-interface/decl.c (gnat_to_gnu_entity): Replace ptr_void_type_node with ptr_type_node. (intrin_return_compatible_p): Likewise. * gcc-interface/trans.c (gigi): Likewise. * gcc-interface/utils2.c (maybe_wrap_malloc): Likewise. (maybe_wrap_free): Likewise. * gcc-interface/utils.c (maybe_pad_type): Remove superfluous space. * gcc-interface/misc.c (gnat_init): Do not set ptr_void_type_node. From-SVN: r223656 --- gcc/ada/ChangeLog | 32 ++++++++++++++++++++++++++++++++ gcc/ada/gcc-interface/decl.c | 14 +++++++------- gcc/ada/gcc-interface/gigi.h | 15 ++++----------- gcc/ada/gcc-interface/misc.c | 2 -- gcc/ada/gcc-interface/targtyps.c | 10 +++++----- gcc/ada/gcc-interface/trans.c | 11 ++++------- gcc/ada/gcc-interface/utils.c | 4 ++-- gcc/ada/gcc-interface/utils2.c | 14 +++++++------- gcc/ada/get_targ.adb | 18 +++++++++--------- 9 files changed, 70 insertions(+), 50 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 38b9fa33c19..05b1edf7bd6 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,35 @@ +2015-05-25 Eric Botcazou + + * gcc-interface/targtyps.c (get_float_words_be): Rename into... + (get_target_float_words_be): ...this. + (get_words_be): Rename into... + (get_target_words_be): ...this. + (get_bytes_be): Rename into... + (get_target_bytes_be): ...this. + (get_bits_be): Rename into... + (get_target_bits_be): ...this. + * gcc-interface/gigi.h (standard_datatypes): Remove ADT_ptr_void_type. + (ptr_void_type_node): Delete. + (get_target_float_size): Likewise. + (get_target_double_size): Likewise. + (get_target_long_double_size): Likewise. + (get_float_words_be): Likewise. + (get_words_be): Likewise. + (get_bytes_be): Likewise. + (get_bits_be): Likewise. + (get_target_float_words_be): Declare. + (get_target_words_be): Likewise. + (get_target_bytes_be): Likewise. + (get_target_bits_be): Likewise. + * gcc-interface/decl.c (gnat_to_gnu_entity): Replace ptr_void_type_node + with ptr_type_node. + (intrin_return_compatible_p): Likewise. + * gcc-interface/trans.c (gigi): Likewise. + * gcc-interface/utils2.c (maybe_wrap_malloc): Likewise. + (maybe_wrap_free): Likewise. + * gcc-interface/utils.c (maybe_pad_type): Remove superfluous space. + * gcc-interface/misc.c (gnat_init): Do not set ptr_void_type_node. + 2015-05-25 Eric Botcazou * gcc-interface/decl.c (elaborate_expression): Take a const string diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index a4b398425ea..2d803fa5eb8 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -2055,7 +2055,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) a pointer to the array type since we don't have the array type yet (it will reference the fat pointer via the bounds). */ tem - = create_field_decl (get_identifier ("P_ARRAY"), ptr_void_type_node, + = create_field_decl (get_identifier ("P_ARRAY"), ptr_type_node, gnu_fat_type, NULL_TREE, NULL_TREE, 0, 0); DECL_CHAIN (tem) = create_field_decl (get_identifier ("P_BOUNDS"), gnu_ptr_template, @@ -3889,7 +3889,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) /* If expansion is disabled, the equivalent type of a concurrent type is absent, so build a dummy pointer type. */ else if (type_annotate_only && No (gnat_desig_equiv)) - gnu_type = ptr_void_type_node; + gnu_type = ptr_type_node; /* Finally, handle the default case where we can just elaborate our designated type. */ @@ -4008,7 +4008,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) case E_Access_Protected_Subprogram_Type: case E_Anonymous_Access_Protected_Subprogram_Type: if (type_annotate_only && No (gnat_equiv_type)) - gnu_type = ptr_void_type_node; + gnu_type = ptr_type_node; else { /* The run-time representation is the equivalent type. */ @@ -4232,7 +4232,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) we are only annotating types, break circularities here. */ if (type_annotate_only && is_from_limited_with_of_main (gnat_return_type)) - gnu_return_type = ptr_void_type_node; + gnu_return_type = void_type_node; else gnu_return_type = gnat_to_gnu_type (gnat_return_type); @@ -4343,7 +4343,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) if (type_annotate_only && is_from_limited_with_of_main (gnat_param_type)) { - gnu_param_type = ptr_void_type_node; + gnu_param_type = void_type_node; fake_param_type = true; } else @@ -5681,7 +5681,7 @@ gnat_to_gnu_param (Entity_Id gnat_param, Mechanism_Type mech, if (Convention (gnat_subprog) == Convention_Intrinsic && Present (Interface_Name (gnat_subprog)) && Is_Descendent_Of_Address (Etype (gnat_param))) - gnu_param_type = ptr_void_type_node; + gnu_param_type = ptr_type_node; /* Arrays are passed as pointers to element type for foreign conventions. */ if (foreign && mech != By_Copy && TREE_CODE (gnu_param_type) == ARRAY_TYPE) @@ -8310,7 +8310,7 @@ intrin_return_compatible_p (intrin_binding_t * inb) /* If return type is Address (integer type), map it to void *. */ if (Is_Descendent_Of_Address (Etype (inb->gnat_entity))) - ada_return_type = ptr_void_type_node; + ada_return_type = ptr_type_node; /* Check return types compatibility otherwise. Note that this handles void/void as well. */ diff --git a/gcc/ada/gcc-interface/gigi.h b/gcc/ada/gcc-interface/gigi.h index 35833ba885b..f817fbc9785 100644 --- a/gcc/ada/gcc-interface/gigi.h +++ b/gcc/ada/gcc-interface/gigi.h @@ -373,9 +373,6 @@ enum standard_datatypes /* The type of an exception. */ ADT_except_type, - /* Type declaration node <==> typedef void *T */ - ADT_ptr_void_type, - /* Function type declaration -- void T() */ ADT_void_ftype, @@ -461,7 +458,6 @@ extern GTY(()) tree gnat_raise_decls_ext[(int) LAST_REASON_CODE + 1]; #define longest_float_type_node gnat_std_decls[(int) ADT_longest_float_type] #define except_type_node gnat_std_decls[(int) ADT_except_type] -#define ptr_void_type_node gnat_std_decls[(int) ADT_ptr_void_type] #define void_ftype gnat_std_decls[(int) ADT_void_ftype] #define ptr_void_ftype gnat_std_decls[(int) ADT_ptr_void_ftype] #define fdesc_type_node gnat_std_decls[(int) ADT_fdesc_type] @@ -1035,18 +1031,15 @@ extern Pos get_target_short_size (void); extern Pos get_target_int_size (void); extern Pos get_target_long_size (void); extern Pos get_target_long_long_size (void); -extern Pos get_target_float_size (void); -extern Pos get_target_double_size (void); -extern Pos get_target_long_double_size (void); extern Pos get_target_pointer_size (void); extern Pos get_target_maximum_default_alignment (void); extern Pos get_target_system_allocator_alignment (void); extern Pos get_target_maximum_allowed_alignment (void); extern Pos get_target_maximum_alignment (void); -extern Nat get_float_words_be (void); -extern Nat get_words_be (void); -extern Nat get_bytes_be (void); -extern Nat get_bits_be (void); +extern Nat get_target_float_words_be (void); +extern Nat get_target_words_be (void); +extern Nat get_target_bytes_be (void); +extern Nat get_target_bits_be (void); extern Nat get_target_strict_alignment (void); extern Nat get_target_double_float_alignment (void); extern Nat get_target_double_scalar_alignment (void); diff --git a/gcc/ada/gcc-interface/misc.c b/gcc/ada/gcc-interface/misc.c index 24fcdde68e8..cdd546668dd 100644 --- a/gcc/ada/gcc-interface/misc.c +++ b/gcc/ada/gcc-interface/misc.c @@ -370,8 +370,6 @@ gnat_init (void) sbitsize_one_node = sbitsize_int (1); sbitsize_unit_node = sbitsize_int (BITS_PER_UNIT); - ptr_void_type_node = build_pointer_type (void_type_node); - /* Show that REFERENCE_TYPEs are internal and should be Pmode. */ internal_reference_types (); diff --git a/gcc/ada/gcc-interface/targtyps.c b/gcc/ada/gcc-interface/targtyps.c index 064b52f5d4a..b9a6e20f78d 100644 --- a/gcc/ada/gcc-interface/targtyps.c +++ b/gcc/ada/gcc-interface/targtyps.c @@ -23,7 +23,7 @@ * * ****************************************************************************/ -/* Functions for retrieving target types. See Ada package Get_Targ */ +/* Functions for retrieving target types. See Ada package Get_Targ. */ #include "config.h" #include "system.h" @@ -192,25 +192,25 @@ get_target_maximum_alignment (void) #endif Nat -get_float_words_be (void) +get_target_float_words_be (void) { return FLOAT_WORDS_BIG_ENDIAN; } Nat -get_words_be (void) +get_target_words_be (void) { return WORDS_BIG_ENDIAN; } Nat -get_bytes_be (void) +get_target_bytes_be (void) { return BYTES_BIG_ENDIAN; } Nat -get_bits_be (void) +get_target_bits_be (void) { return BITS_BIG_ENDIAN; } diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c index cb8662c0a87..2cb830461e8 100644 --- a/gcc/ada/gcc-interface/trans.c +++ b/gcc/ada/gcc-interface/trans.c @@ -414,7 +414,7 @@ gigi (Node_Id gnat_root, ptr_void_ftype = build_pointer_type (void_ftype); /* Now declare run-time functions. */ - ftype = build_function_type_list (ptr_void_type_node, sizetype, NULL_TREE); + ftype = build_function_type_list (ptr_type_node, sizetype, NULL_TREE); /* malloc is a function declaration tree for a function to allocate memory. */ @@ -428,7 +428,7 @@ gigi (Node_Id gnat_root, free_decl = create_subprog_decl (get_identifier ("__gnat_free"), NULL_TREE, build_function_type_list (void_type_node, - ptr_void_type_node, + ptr_type_node, NULL_TREE), NULL_TREE, is_disabled, true, true, true, NULL, Empty); @@ -494,8 +494,7 @@ gigi (Node_Id gnat_root, DECL_FUNCTION_CODE (update_setjmp_buf_decl) = BUILT_IN_UPDATE_SETJMP_BUF; /* Hooks to call when entering/leaving an exception handler. */ - ftype - = build_function_type_list (void_type_node, ptr_void_type_node, NULL_TREE); + ftype = build_function_type_list (void_type_node, ptr_type_node, NULL_TREE); begin_handler_decl = create_subprog_decl (get_identifier ("__gnat_begin_handler"), NULL_TREE, @@ -576,9 +575,7 @@ gigi (Node_Id gnat_root, set_exception_parameter_decl = create_subprog_decl (get_identifier ("__gnat_set_exception_parameter"), NULL_TREE, - build_function_type_list (void_type_node, - ptr_void_type_node, - ptr_void_type_node, + build_function_type_list (void_type_node, ptr_type_node, ptr_type_node, NULL_TREE), NULL_TREE, is_disabled, true, true, true, NULL, Empty); diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c index 3cefe112834..c20378ab035 100644 --- a/gcc/ada/gcc-interface/utils.c +++ b/gcc/ada/gcc-interface/utils.c @@ -1351,8 +1351,8 @@ maybe_pad_type (tree type, tree size, unsigned int align, } /* Now create the field with the original size. */ - field = create_field_decl (get_identifier ("F"), type, record, orig_size, - bitsize_zero_node, 0, 1); + field = create_field_decl (get_identifier ("F"), type, record, orig_size, + bitsize_zero_node, 0, 1); DECL_INTERNAL_P (field) = 1; /* Do not emit debug info until after the auxiliary record is built. */ diff --git a/gcc/ada/gcc-interface/utils2.c b/gcc/ada/gcc-interface/utils2.c index 42587d9a802..157a18bf297 100644 --- a/gcc/ada/gcc-interface/utils2.c +++ b/gcc/ada/gcc-interface/utils2.c @@ -833,7 +833,7 @@ tree build_binary_op (enum tree_code op_code, tree result_type, tree left_operand, tree right_operand) { - tree left_type = TREE_TYPE (left_operand); + tree left_type = TREE_TYPE (left_operand); tree right_type = TREE_TYPE (right_operand); tree left_base_type = get_base_type (left_type); tree right_base_type = get_base_type (right_type); @@ -2289,14 +2289,14 @@ maybe_wrap_malloc (tree data_size, tree data_type, Node_Id gnat_node) /* Then arrange to store the allocator's return value ahead and return. */ tree storage_ptr_slot_addr - = build_binary_op (POINTER_PLUS_EXPR, ptr_void_type_node, - convert (ptr_void_type_node, aligning_field_addr), + = build_binary_op (POINTER_PLUS_EXPR, ptr_type_node, + convert (ptr_type_node, aligning_field_addr), size_int (-(HOST_WIDE_INT) POINTER_SIZE / BITS_PER_UNIT)); tree storage_ptr_slot = build_unary_op (INDIRECT_REF, NULL_TREE, - convert (build_pointer_type (ptr_void_type_node), + convert (build_pointer_type (ptr_type_node), storage_ptr_slot_addr)); return @@ -2331,15 +2331,15 @@ maybe_wrap_free (tree data_ptr, tree data_type) = (void *)DATA_PTR - (void *)sizeof (void *)) */ tree data_front_ptr = build_binary_op - (POINTER_PLUS_EXPR, ptr_void_type_node, - convert (ptr_void_type_node, data_ptr), + (POINTER_PLUS_EXPR, ptr_type_node, + convert (ptr_type_node, data_ptr), size_int (-(HOST_WIDE_INT) POINTER_SIZE / BITS_PER_UNIT)); /* FREE_PTR (void *) = *(void **)DATA_FRONT_PTR */ free_ptr = build_unary_op (INDIRECT_REF, NULL_TREE, - convert (build_pointer_type (ptr_void_type_node), data_front_ptr)); + convert (build_pointer_type (ptr_type_node), data_front_ptr)); } else free_ptr = data_ptr; diff --git a/gcc/ada/get_targ.adb b/gcc/ada/get_targ.adb index e1dfb26ff2d..9a47000d2e7 100644 --- a/gcc/ada/get_targ.adb +++ b/gcc/ada/get_targ.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2014, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2015, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -23,12 +23,12 @@ -- -- ------------------------------------------------------------------------------ --- Version for use with gcc +-- Version for use with GCC package body Get_Targ is - -- Functions returning individual runtime. For the standard (GCC) back - -- end these come from C interface functions (one for each value). + -- Functions returning individual run-time values. For the standard (GCC) + -- back end, these come from C interface functions (one for each value). ----------------------- -- Get_Bits_Per_Unit -- @@ -157,7 +157,7 @@ package body Get_Targ is function Get_Float_Words_BE return Nat is function C_Get_Float_Words_BE return Nat; pragma Import (C, C_Get_Float_Words_BE, - "get_float_words_be"); + "get_target_float_words_be"); begin return C_Get_Float_Words_BE; end Get_Float_Words_BE; @@ -169,7 +169,7 @@ package body Get_Targ is function Get_Words_BE return Nat is function C_Get_Words_BE return Nat; pragma Import (C, C_Get_Words_BE, - "get_words_be"); + "get_target_words_be"); begin return C_Get_Words_BE; end Get_Words_BE; @@ -181,7 +181,7 @@ package body Get_Targ is function Get_Bytes_BE return Nat is function C_Get_Bytes_BE return Nat; pragma Import (C, C_Get_Bytes_BE, - "get_bytes_be"); + "get_target_bytes_be"); begin return C_Get_Bytes_BE; end Get_Bytes_BE; @@ -193,7 +193,7 @@ package body Get_Targ is function Get_Bits_BE return Nat is function C_Get_Bits_BE return Nat; pragma Import (C, C_Get_Bits_BE, - "get_bits_be"); + "get_target_bits_be"); begin return C_Get_Bits_BE; end Get_Bits_BE; @@ -306,7 +306,7 @@ package body Get_Targ is -- Width_From_Size -- --------------------- - function Width_From_Size (Size : Pos) return Pos is + function Width_From_Size (Size : Pos) return Pos is begin case Size is when 8 => return 4; -- 2.30.2