} intrin_binding_t;
static bool intrin_profiles_compatible_p (intrin_binding_t *);
-\f
+
/* Given GNAT_ENTITY, a GNAT defining identifier node, which denotes some Ada
entity, return the equivalent GCC tree for that entity (a ..._DECL node)
and associate the ..._DECL node with the input GNAT defining identifier.
return n_elem;
}
-\f
+
/* Given GNAT_ENTITY, elaborate all expressions that are required to
be elaborated at the point of its definition, but do nothing else. */
}
}
-\f
+
/* Prepend to ATTR_LIST an entry for an attribute with provided TYPE,
NAME, ARGS and ERROR_POINT. */
if (Nkind (gnat_temp) == N_Pragma)
prepend_one_attribute_pragma (attr_list, gnat_temp);
}
-\f
+
/* Given a GNAT tree GNAT_EXPR, for an expression which is a value within a
type definition (either a bound or a discriminant value) for GNAT_ENTITY,
return the GCC tree to use for that expression. S is the suffix to use
struct er_data er = { gnat_entity, definition, 0 };
return gnat_rewrite_reference (ref, elaborate_reference_1, &er, init);
}
-\f
+
/* Given a GNU tree and a GNAT list of choices, generate an expression to test
the value passed against the list of choices. */
return gnu_result;
}
-\f
+
/* Adjust PACKED setting as passed to gnat_to_gnu_field for a field of
type FIELD_TYPE to be placed in RECORD_TYPE. Return the result. */
return gnu_field;
}
-\f
+
/* Return true if at least one member of COMPONENT_LIST needs strict
alignment. */
return (gnu_rep_list && !p_gnu_rep_list) || variants_have_rep;
}
-\f
+
/* Given GNU_SIZE, a GCC tree representing a size, return a Uint to be
placed into an Esize, Component_Bit_Offset, or Component_Size value
in the GNAT tree. */
}
}
}
-\f
+
/* Scan all fields in GNU_TYPE and return a TREE_LIST where TREE_PURPOSE is
the FIELD_DECL and TREE_VALUE a TREE_VEC containing the byte position, the
value to be placed into DECL_OFFSET_ALIGN and the bit position. The list
return gnu_list;
}
-\f
+
/* If SIZE has overflowed, return the maximum valid size, which is the upper
bound of the signed sizetype in bits, rounded down to ALIGN. Otherwise
return SIZE unmodified. */
return size;
}
-\f
+
/* Similarly, but both validate and process a value of RM size. This routine
is only called for types. */
&& !TYPE_FAT_POINTER_P (gnu_type))
SET_TYPE_ADA_SIZE (gnu_type, size);
}
-\f
+
/* ALIGNMENT is a Uint giving the alignment specified for GNAT_ENTITY,
a type or object whose present alignment is ALIGN. If this alignment is
valid, return it. Otherwise, give an error and return ALIGN. */
return align;
}
-\f
+
/* Promote the alignment of GNU_TYPE corresponding to GNAT_ENTITY. Return
a positive value on success or zero on failure. */
return align;
}
-\f
+
/* Verify that TYPE is something we can implement atomically. If not, issue
an error for GNAT_ENTITY. COMPONENT_P is true if we are being called to
process a component type. */
post_error_ne ("atomic access to & cannot be guaranteed",
gnat_error_point, gnat_entity);
}
-\f
+
/* Helper for the intrin compatibility checks family. Evaluate whether
two types are definitely incompatible. */
return return_compatible_p && arglists_compatible_p;
}
-\f
+
/* Return a FIELD_DECL node modeled on OLD_FIELD. FIELD_TYPE is its type
and RECORD_TYPE is the type of the parent. If SIZE is nonzero, it is the
specified size for this field. POS_LIST is a position list describing
return NULL_TREE;
}
}
-\f
+
/* Given a type T, a FIELD_DECL F, and a replacement value R, return an
equivalent type with adjusted size expressions where all occurrences
of references to F in a PLACEHOLDER_EXPR have been replaced by R.
return t;
}
}
-\f
+
/* Return the RM size of GNU_TYPE. This is the actual number of bits
needed to represent the object. */
/* For other types, this is just the size. */
return TYPE_SIZE (gnu_type);
}
-\f
+
/* Return the name to be used for GNAT_ENTITY. If a type, create a
fully-qualified name, possibly with type information encoding.
Otherwise, return the name. */
/* True if floating-point arithmetics may use wider intermediate results. */
extern bool fp_arith_may_widen;
-\f
+
/* Data structures used to represent attributes. */
enum attrib_type
of configurations. */
static const char *extract_encoding (const char *) ATTRIBUTE_UNUSED;
static const char *decode_name (const char *) ATTRIBUTE_UNUSED;
-\f
+
/* This makes gigi's file_info_ptr visible in this translation unit,
so that Sloc_to_locus can look it up when deciding whether to map
decls to instances. */
/* We cannot track the location of errors past this point. */
Current_Error_Node = Empty;
}
-\f
+
/* Return a subprogram decl corresponding to __gnat_rcheck_xx for the given
CHECK if KIND is EXCEPTION_SIMPLE, or else to __gnat_rcheck_xx_ext. */
return result;
}
-\f
+
/* Return a positive value if an lvalue is required for GNAT_NODE, which is
an N_Attribute_Reference. */
return gnu_result;
}
-\f
+
/* Check the inline status of nested function FNDECL wrt its parent function.
If a non-inline nested function is referenced from an inline external
DECL_UNINLINABLE (parent_decl) = 1;
}
}
-\f
+
/* Return an expression for the length of TYPE, an integral type, computed in
RESULT_TYPE, another integral type.
*gnu_result_type_p = gnu_result_type;
return gnu_result;
}
-\f
+
/* Subroutine of gnat_to_gnu to translate gnat_node, an N_Case_Statement,
to a GCC tree, which is returned. */
return gnu_result;
}
-\f
+
/* Return true if we are in the body of a loop. */
static inline bool
return gnu_result;
}
-\f
+
/* This page implements a form of Named Return Value optimization modeled
on the C++ optimization of the same name. The main difference is that
we disregard any semantical considerations when applying it here, the
return build1 (RETURN_EXPR, void_type_node, result_expr);
}
-\f
+
/* Subroutine of gnat_to_gnu to process gnat_node, an N_Subprogram_Body. We
don't return anything. */
else
rest_of_subprog_body_compilation (gnu_subprog_decl);
}
-\f
+
/* The type of an atomic access. */
typedef enum { NOT_ATOMIC, SIMPLE_ATOMIC, OUTER_ATOMIC } atomic_acces_t;
*type = NOT_ATOMIC;
*sync = false;
}
-\f
-\f/* Return true if GNAT_NODE requires simple atomic access and, if so, set SYNC
+
+/* Return true if GNAT_NODE requires simple atomic access and, if so, set SYNC
according to the associated synchronization setting. */
static inline bool
return gnu_result;
}
-\f
+
/* Subroutine of gnat_to_gnu to translate gnat_node, an
N_Handled_Sequence_Of_Statements, to a GCC tree, which is returned. */
return gnu_result;
}
-\f
+
/* Subroutine of gnat_to_gnu to translate gnat_node, an N_Exception_Handler,
to a GCC tree, which is returned. This is the variant for front-end sjlj
exception handling. */
return build3 (COND_EXPR, void_type_node, gnu_choice, gnu_body, NULL_TREE);
}
-\f
+
/* Return true if no statement in GNAT_LIST can alter the control flow. */
static bool
return
build2 (CATCH_EXPR, void_type_node, gnu_etypes_list, end_stmt_group ());
}
-\f
+
/* Subroutine of gnat_to_gnu to generate code for an N_Compilation unit. */
static void
/* Force the processing for all nodes that remain in the queue. */
process_deferred_decl_context (true);
}
-\f
+
/* Mark COND, a boolean expression, as predicating a call to a noreturn
function, i.e. predict that it is very likely false, and return it.
return gnu_result;
}
-\f
+
/* Return true if GNAT_NODE is on the LHS of an assignment or an actual
parameter of a call. */
const Entity_Id gnat_desig_type
= Designated_Type (Underlying_Type (Etype (gnat_node)));
- /* The flag is effectively only set on the base types. */
- ignore_init_type
- = Has_Constrained_Partial_View (Base_Type (gnat_desig_type));
+ ignore_init_type = Has_Constrained_Partial_View (gnat_desig_type);
gnu_init = gnat_to_gnu (Expression (gnat_temp));
gnu_init = maybe_unconstrained_array (gnu_init);
return gnu_result;
}
-\f
+
/* Return true if the statement list STMT_LIST is empty. */
static bool
save_gnu_tree (gnat_node, NULL_TREE, true);
}
-\f
+
/* Start a new statement group chained to the previous group. */
void
return end_stmt_group ();
}
-\f
+
/* Generate GIMPLE in place for the expression at *EXPR_P. */
int
gcc_unreachable ();
}
}
-\f
+
/* Force a reference to each of the entities in GNAT_PACKAGE recursively.
This routine is exclusively called in type_annotate mode, to compute DDA
if (Nkind (Unit (gnat_node)) == N_Package_Body)
elaborate_all_entities (Library_Unit (gnat_node));
}
-\f
+
/* Do the processing of GNAT_NODE, an N_Freeze_Entity. */
static void
used_types_insert (TREE_TYPE (gnu_new));
}
}
-\f
+
/* Elaborate decls in the lists GNAT_DECLS and GNAT_DECLS2, if present.
We make two passes, one to elaborate anything other than bodies (but
we declare a function if there was no spec). The second pass
add_stmt (gnat_to_gnu (gnat_decl));
}
}
-\f
+
/* Make a unary operation of kind CODE using build_unary_op, but guard
the operation by an overflow check. CODE can be one of NEGATE_EXPR
or ABS_EXPR. GNU_TYPE is the type desired for the result. Usually
: build_int_cst (TREE_TYPE (gnu_expr), 0)),
gnu_expr);
}
-\f
+
/* Return an expression that converts GNU_EXPR to GNAT_TYPE, doing overflow
checks if OVERFLOW_P is true. If TRUNCATE_P is true, do a fp-to-integer
conversion with truncation, otherwise round. GNAT_NODE is the GNAT node
return convert (gnu_type, gnu_result);
}
-\f
+
/* Return true if GNU_EXPR can be directly addressed. This is the case
unless it is an expression involving computation or if it involves a
reference to a bitfield or to an object not sufficiently aligned for
return false;
}
}
-\f
+
/* Do the processing for the declaration of a GNAT_ENTITY, a type or subtype.
If a Freeze node exists for the entity, delay the bulk of the processing.
Otherwise make a GCC type for GNAT_ENTITY and set up the correspondence. */
TREE_TYPE (gnu_new));
}
}
-\f
+
/* Subroutine of assoc_to_constructor: VALUES is a list of field associations,
some of which are from RECORD_TYPE. Return a CONSTRUCTOR consisting of the
associations that are from RECORD_TYPE. If we see an internal record, make
return gnat_build_constructor (gnu_array_type, gnu_expr_vec);
}
-\f
+
/* Process a N_Validate_Unchecked_Conversion node. */
static void
}
}
}
-\f
+
/* Convert SLOC into LOCUS. Return true if SLOC corresponds to a
source code location and false if it doesn't. If CLEAR_COLUMN is
true, set the column information to 0. If DECL is given and SLOC
return false;
}
}
-\f
+
/* Return a colon-separated list of encodings contained in encoded Ada
name. */
__gnat_decode (name, decoded, 0);
return decoded;
}
-\f
+
/* Post an error message. MSG is the error message, properly annotated.
NODE is the node at which to post the error and the node to use for the
'&' substitution. */
computed. */
static void add_deferred_type_context (struct deferred_decl_context_node *n,
tree type);
-\f
+
/* Initialize data structures of the utils.c module. */
void
pad_type_hash_table->empty ();
pad_type_hash_table = NULL;
}
-\f
+
/* GNAT_ENTITY is a GNAT tree node for an entity. Associate GNU_DECL, a GCC
tree node, with GNAT_ENTITY. If GNU_DECL is not a ..._DECL node, abort.
If NO_CHECK is true, the latter check is suppressed.
{
return PRESENT_GNU_TREE (gnat_entity);
}
-\f
+
/* Make a dummy type corresponding to GNAT_TYPE. */
tree
TYPE_REFERENCE_TO (gnu_desig_type) = gnu_fat_type;
TYPE_OBJECT_RECORD_TYPE (gnu_desig_type) = gnu_object_type;
}
-\f
+
/* Return true if we are in the global binding level. */
bool
level->chain = free_binding_level;
free_binding_level = level;
}
-\f
+
/* Set the context of TYPE and its parallel types (if any) to CONTEXT. */
static void
}
}
}
-\f
+
/* Create a record type that contains a SIZE bytes long field of TYPE with a
starting bit position so that it is aligned to ALIGN bits, and leaving at
least ROOM bytes free before the field. BASE_ALIGN is the alignment the
TYPE_REVERSE_STORAGE_ORDER (type) = 1;
return canonicalize_pad_type (type);
}
-\f
+
/* Relate the alias sets of GNU_NEW_TYPE and GNU_OLD_TYPE according to OP.
If this is a multi-dimensional array type, do this recursively.
record_component_aliases (gnu_new_type);
}
-\f
+
/* Record TYPE as a builtin type for Ada. NAME is the name of the type.
ARTIFICIAL_P is true if the type was generated by the compiler. */
if (debug_hooks->type_decl)
debug_hooks->type_decl (type_decl, false);
}
-\f
+
/* Finish constructing the character type CHAR_TYPE.
In Ada character types are enumeration types and, as a consequence, are
else
return bitsize_zero_node;
}
-\f
+
/* Return a copy of TYPE but safe to modify in any way. */
tree
return new_type;
}
-\f
+
/* Return a subtype of sizetype with range MIN to MAX and whose
TYPE_INDEX_TYPE is INDEX. GNAT_NODE is used for the position
of the associated TYPE_DECL. */
return range_type;
}
-\f
-\f/* Return an extra subtype of TYPE with range MIN to MAX. */
+
+/* Return an extra subtype of TYPE with range MIN to MAX. */
tree
create_extra_subtype (tree type, tree min, tree max)
return subtype;
}
-\f
+
/* Return a TYPE_DECL node suitable for the TYPE_STUB_DECL field of TYPE.
NAME gives the name of the type to be used in the declaration. */
return type_decl;
}
-\f
+
/* Return a VAR_DECL or CONST_DECL node.
NAME gives the name of the variable. ASM_NAME is its assembler name
return var_decl;
}
-\f
+
/* Return true if TYPE, an aggregate type, contains (or is) an array.
If SELF_REFERENTIAL is true, then an additional requirement on the
array is that it be self-referential. */
return field_decl;
}
-\f
+
/* Return a PARM_DECL node with NAME and TYPE. */
tree
DECL_ARG_TYPE (param_decl) = type;
return param_decl;
}
-\f
+
/* Process the attributes in ATTR_LIST for NODE, which is either a DECL or
a TYPE. If IN_PLACE is true, the tree pointed to by NODE should not be
changed. GNAT_NODE is used for the position of error messages. */
return label_decl;
}
-\f
+
/* Return a FUNCTION_DECL node. NAME is the name of the subprogram, ASM_NAME
its assembler name, TYPE its type (a FUNCTION_TYPE or METHOD_TYPE node),
PARAM_DECL_LIST the list of its parameters (a list of PARM_DECL nodes
DECL_NAME (decl) = main_identifier_node;
}
}
-\f
+
/* Set up the framework for generating code for SUBPROG_DECL, a subprogram
body. This routine needs to be invoked before processing the declarations
appearing in the subprogram. */
&& TYPE_RETURN_BY_DIRECT_REF_P (t) == return_by_direct_ref_p
&& TREE_ADDRESSABLE (t) == return_by_invisi_ref_p;
}
-\f
+
/* EXP is an expression for the size of an object. If this size contains
discriminant references, replace them with the maximum (if MAX_P) or
minimum (if !MAX_P) possible value of the discriminant.
gcc_unreachable ();
}
-\f
+
/* Build a template of type TEMPLATE_TYPE from the array bounds of ARRAY_TYPE.
EXPR is an expression that we can use to locate any PLACEHOLDER_EXPRs.
Return a constructor for the template. */
return gnat_build_constructor (template_type, template_elts);
}
-\f
+
/* Return true if TYPE is suitable for the element type of a vector. */
static bool
TYPE_REPRESENTATIVE_ARRAY (vector_type) = array_type;
return vector_type;
}
-\f
+
/* Build a type to be used to represent an aliased object whose nominal type
is an unconstrained array. This consists of a RECORD_TYPE containing a
field of TEMPLATE_TYPE and a field of OBJECT_TYPE, which is an ARRAY_TYPE.
return
build_unc_object_type (template_type, object_type, name, debug_info_p);
}
-\f
+
/* Update anything previously pointing to OLD_TYPE to point to NEW_TYPE.
In the normal case this is just two adjustments, but we have more to
do if NEW_TYPE is an UNCONSTRAINED_ARRAY_TYPE. */
TYPE_REFERENCE_TO (old_type) = NULL_TREE;
}
}
-\f
+
/* Convert EXPR, a pointer to a constrained array, into a pointer to an
unconstrained one. This involves making or finding a template. */
CONSTRUCTOR_APPEND_ELT (v, DECL_CHAIN (TYPE_FIELDS (type)), template_addr);
return gnat_build_constructor (type, v);
}
-\f
+
/* Create an expression whose value is that of EXPR,
converted to type TYPE. The TREE_TYPE of the value
is always TYPE. This function implements all reasonable
return convert (sizetype, expr);
}
-\f
+
/* Remove all conversions that are done in EXP. This includes converting
from a padded type or to a justified modular type. If TRUE_ADDRESS
is true, always return the address of the containing object even if
return exp;
}
-\f
+
/* If EXP's type is an UNCONSTRAINED_ARRAY_TYPE, return an expression that
refers to the underlying array. If it has TYPE_CONTAINS_TEMPLATE_P,
likewise return an expression pointing to the underlying array. */
return exp;
}
-\f
+
/* Return true if EXPR is an expression that can be folded as an operand
of a VIEW_CONVERT_EXPR. See ada-tree.h for a complete rationale. */
return expr;
}
-\f
+
/* Return the appropriate GCC tree code for the specified GNAT_TYPE,
the latter being a record type as predicated by Is_Record_Type. */
return type;
}
-\f
+
/* EXP is a GCC tree representing an address. See if we can find how strictly
the object at this address is aligned and, if so, return the alignment of
the object in bits. Otherwise return 0. */
return this_alignment;
}
-\f
+
/* We have a comparison or assignment operation on two types, T1 and T2, which
are either both array types or both record types. T1 is assumed to be for
the left hand side operand, and T2 for the right hand side. Return the
could cause a bad self-referential reference. */
return NULL_TREE;
}
-\f
+
/* Return an expression tree representing an equality comparison of A1 and A2,
two objects of type ARRAY_TYPE. The result should be of type RESULT_TYPE.
build_binary_op (TRUTH_ORIF_EXPR, result_type,
p1_array_is_null, same_bounds));
}
-\f
+
/* Compute the result of applying OP_CODE to LHS and RHS, where both are of
type TYPE. We know that TYPE is a modular type with a nonbinary
modulus. */
return convert (type, result);
}
-\f
+
/* This page contains routines that implement the Ada semantics with regard
to atomic objects. They are fully piggybacked on the middle-end support
for atomic loads and stores.
/* Something went wrong earlier if we have not found the atomic load. */
gcc_unreachable ();
}
-\f
+
/* Make a binary operation of kind OP_CODE. RESULT_TYPE is the type
desired for the result. Usually the operation is to be performed
in that type. For INIT_EXPR and MODIFY_EXPR, RESULT_TYPE must be
return result;
}
-\f
+
/* Similar, but for unary operations. */
tree
return result;
}
-\f
+
/* Similar, but for COND_EXPR. */
tree
return result;
}
-\f
+
/* Conveniently construct a function call expression. FNDECL names the
function to be called, N is the number of arguments, and the "..."
parameters are the argument expressions. Unlike build_call_expr
va_end (ap);
return fn;
}
-\f
+
/* Build a goto to LABEL for a raise, with an optional call to Local_Raise.
MSG gives the exception's identity for the call to Local_Raise, if any. */
convert (integer_type_node, first),
convert (integer_type_node, last));
}
-\f
+
/* qsort comparer for the bit positions of two constructor elements
for record components. */
TREE_READONLY (result) = TYPE_READONLY (type) || read_only || allconstant;
return result;
}
-\f
+
/* Return a COMPONENT_REF to access FIELD in RECORD, or NULL_TREE if the field
is not found in the record. Don't fold the result if NO_FOLD is true. */
build_call_raise (CE_Discriminant_Check_Failed, Empty,
N_Raise_Constraint_Error));
}
-\f
+
/* Helper for build_call_alloc_dealloc, with arguments to be interpreted
identically. Process the case where a GNAT_PROC to call is provided. */
return maybe_wrap_malloc (gnu_size, gnu_type, gnat_node);
}
}
-\f
+
/* Build a GCC tree that corresponds to allocating an object of TYPE whose
initial value is INIT, if INIT is nonzero. Convert the expression to
RESULT_TYPE, which must be some pointer type, and return the result.
return storage;
}
-\f
+
/* Indicate that we need to take the address of T and that it therefore
should not be allocated in a register. Return true if successful. */
return true;
}
}
-\f
+
/* Return true if EXP is a stable expression for the purpose of the functions
below and, therefore, can be returned unmodified by them. We accept things
that are actual constants or that have already been handled. */