* 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
+2015-05-25 Eric Botcazou <ebotcazou@adacore.com>
+
+ * 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 <ebotcazou@adacore.com>
* gcc-interface/decl.c (elaborate_expression): Take a const string
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,
/* 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. */
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. */
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);
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
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)
/* 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. */
/* 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,
#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]
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);
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 ();
* *
****************************************************************************/
-/* 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"
#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;
}
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. */
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);
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,
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);
}
/* 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. */
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);
/* 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
= (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;
-- --
-- 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- --
-- --
------------------------------------------------------------------------------
--- 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 --
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;
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;
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;
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;
-- 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;