#define MARK_VISITED(EXP) \
do { \
- if((EXP) && !CONSTANT_CLASS_P (EXP)) \
+ if((EXP) && !TREE_CONSTANT (EXP)) \
mark_visited (EXP); \
} while (0)
/* Get the unpadded version of a GNAT type. */
extern tree get_unpadded_type (Entity_Id gnat_entity);
+/* Called when we need to protect a variable object using a save_expr. */
+extern tree maybe_variable (tree gnu_operand);
+
/* 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
the name followed by "___" and the specified suffix. */
extern tree concat_name (tree gnu_name, const char *suffix);
-/* Highest number in the front-end node table. */
-extern int max_gnat_nodes;
-
-/* Current node being treated, in case abort called. */
-extern Node_Id error_gnat_node;
-
-/* True when gigi is being called on an analyzed but unexpanded
- tree, and the only purpose of the call is to properly annotate
- types with representation information. */
+/* If true, then gigi is being called on an analyzed but unexpanded tree, and
+ the only purpose of the call is to properly annotate types with
+ representation information. */
extern bool type_annotate_only;
-/* Current file name without path. */
+/* Current file name without path */
extern const char *ref_filename;
/* This structure must be kept synchronized with Call_Back_End. */
};
/* This is the main program of the back-end. It sets up all the table
- structures and then generates code. */
-extern void gigi (Node_Id gnat_root, int max_gnat_node,
- int number_name ATTRIBUTE_UNUSED,
+ structures and then generates code.
+
+ ??? Needs parameter descriptions */
+
+extern void gigi (Node_Id gnat_root, int max_gnat_node, int number_name,
struct Node *nodes_ptr, Node_Id *next_node_ptr,
Node_Id *prev_node_ptr, struct Elist_Header *elists_ptr,
struct Elmt_Item *elmts_ptr,
struct File_Info_Type *file_info_ptr,
Entity_Id standard_boolean,
Entity_Id standard_integer,
- Entity_Id standard_character,
Entity_Id standard_long_long_float,
Entity_Id standard_exception_type,
Int gigi_operating_mode);
/* 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. */
+ "&" substitution. */
extern void post_error (const char *msg, Node_Id node);
-/* Similar to post_error, but NODE is the node at which to post the error and
- ENT is the node to use for the '&' substitution. */
+/* Similar, but NODE is the node at which to post the error and ENT
+ is the node to use for the "&" substitution. */
extern void post_error_ne (const char *msg, Node_Id node, Entity_Id ent);
-/* Similar to post_error_ne, but NUM is the number to use for the '^'. */
+/* Similar, but NODE is the node at which to post the error, ENT is the node
+ to use for the "&" substitution, and N is the number to use for the ^. */
extern void post_error_ne_num (const char *msg, Node_Id node, Entity_Id ent,
- int num);
+ int n);
-/* Similar to post_error_ne, but T is a GCC tree representing the number to
- write. If T represents a constant, the text inside curly brackets in
- MSG will be output (presumably including a '^'). Otherwise it will not
- be output and the text inside square brackets will be output instead. */
+/* Similar to post_error_ne_num, but T is a GCC tree representing the number
+ to write. If the tree represents a constant that fits within a
+ host integer, the text inside curly brackets in MSG will be output
+ (presumably including a '^'). Otherwise that text will not be output
+ and the text inside square brackets will be output instead. */
extern void post_error_ne_tree (const char *msg, Node_Id node, Entity_Id ent,
tree t);
-/* Similar to post_error_ne_tree, but NUM is a second integer to write. */
+/* Similar to post_error_ne_tree, except that NUM is a second
+ integer to write in the message. */
extern void post_error_ne_tree_2 (const char *msg, Node_Id node, Entity_Id ent,
tree t, int num);
+/* Protect EXP from multiple evaluation. This may make a SAVE_EXPR. */
+extern tree protect_multiple_eval (tree exp);
+
/* Return a label to branch to for the exception type in KIND or NULL_TREE
if none. */
extern tree get_exception_label (char kind);
+/* Current node being treated, in case gigi_abort or Check_Elaboration_Code
+ called. */
+extern Node_Id error_gnat_node;
+
+/* This is equivalent to stabilize_reference in tree.c, but we know how to
+ handle our own nodes and we take extra arguments. FORCE says whether to
+ force evaluation of everything. We set SUCCESS to true unless we walk
+ through something we don't know how to stabilize. */
+extern tree maybe_stabilize_reference (tree ref, bool force, bool *success);
+
+/* Highest number in the front-end node table. */
+extern int max_gnat_nodes;
+
/* If nonzero, pretend we are allocating at global level. */
extern int force_global;
types whose size is greater or equal to 64 bits, or 0 if this alignment
is not specifically capped. */
extern int double_scalar_alignment;
+
+/* Standard data type sizes. Most of these are not used. */
+
+#ifndef CHAR_TYPE_SIZE
+#define CHAR_TYPE_SIZE BITS_PER_UNIT
+#endif
+
+#ifndef SHORT_TYPE_SIZE
+#define SHORT_TYPE_SIZE (BITS_PER_UNIT * MIN ((UNITS_PER_WORD + 1) / 2, 2))
+#endif
+
+#ifndef INT_TYPE_SIZE
+#define INT_TYPE_SIZE BITS_PER_WORD
+#endif
+
+#ifndef LONG_TYPE_SIZE
+#define LONG_TYPE_SIZE BITS_PER_WORD
+#endif
+
+#ifndef LONG_LONG_TYPE_SIZE
+#define LONG_LONG_TYPE_SIZE (BITS_PER_WORD * 2)
+#endif
+
+#ifndef FLOAT_TYPE_SIZE
+#define FLOAT_TYPE_SIZE BITS_PER_WORD
+#endif
+
+#ifndef DOUBLE_TYPE_SIZE
+#define DOUBLE_TYPE_SIZE (BITS_PER_WORD * 2)
+#endif
+
+#ifndef LONG_DOUBLE_TYPE_SIZE
+#define LONG_DOUBLE_TYPE_SIZE (BITS_PER_WORD * 2)
+#endif
+
+/* The choice of SIZE_TYPE here is very problematic. We need a signed
+ type whose bit width is Pmode. Assume "long" is such a type here. */
+#undef SIZE_TYPE
+#define SIZE_TYPE "long int"
\f
/* Data structures used to represent attributes. */
/* Type declaration node <==> typedef virtual void *T() */
ADT_fdesc_type,
- /* Null pointer for above type. */
+ /* Null pointer for above type */
ADT_null_fdesc,
- /* Value 1 in signed bitsizetype. */
- ADT_sbitsize_one_node,
-
- /* Value BITS_PER_UNIT in signed bitsizetype. */
- ADT_sbitsize_unit_node,
-
/* Function declaration nodes for run-time functions for allocating memory.
Ada allocators cause calls to these functions to be generated. Malloc32
is used only on 64bit systems needing to allocate 32bit memory. */
/* Likewise for freeing memory. */
ADT_free_decl,
- /* Function decl node for 64-bit multiplication with overflow checking. */
+ /* Function decl node for 64-bit multiplication with overflow checking */
ADT_mulv64_decl,
- /* Identifier for the name of the _Parent field in tagged record types. */
- ADT_parent_name_id,
-
/* Types and decls used by our temporary exception mechanism. See
init_gigi_decls for details. */
ADT_jmpbuf_type,
#define ptr_void_ftype gnat_std_decls[(int) ADT_ptr_void_ftype]
#define fdesc_type_node gnat_std_decls[(int) ADT_fdesc_type]
#define null_fdesc_node gnat_std_decls[(int) ADT_null_fdesc]
-#define sbitsize_one_node gnat_std_decls[(int) ADT_sbitsize_one_node]
-#define sbitsize_unit_node gnat_std_decls[(int) ADT_sbitsize_unit_node]
#define malloc_decl gnat_std_decls[(int) ADT_malloc_decl]
#define malloc32_decl gnat_std_decls[(int) ADT_malloc32_decl]
#define free_decl gnat_std_decls[(int) ADT_free_decl]
#define mulv64_decl gnat_std_decls[(int) ADT_mulv64_decl]
-#define parent_name_id gnat_std_decls[(int) ADT_parent_name_id]
#define jmpbuf_type gnat_std_decls[(int) ADT_jmpbuf_type]
#define jmpbuf_ptr_type gnat_std_decls[(int) ADT_jmpbuf_ptr_type]
#define get_jmpbuf_decl gnat_std_decls[(int) ADT_get_jmpbuf_decl]
and uses GNAT_NODE for location information. */
extern void gnat_pushdecl (tree decl, Node_Id gnat_node);
+extern void gnat_init_decl_processing (void);
extern void gnat_init_gcc_eh (void);
extern void gnat_install_builtins (void);
const_flag, public_flag, extern_flag, \
static_flag, false, attr_list, gnat_node)
+/* Given a DECL and ATTR_LIST, apply the listed attributes. */
+extern void process_attributes (tree decl, struct attrib *attr_list);
+
/* Record DECL as a global renaming pointer. */
extern void record_global_renaming_pointer (tree decl);
should not be allocated in a register. Returns true if successful. */
extern bool gnat_mark_addressable (tree t);
-/* Save EXP for later use or reuse. This is equivalent to save_expr in tree.c
- but we know how to handle our own nodes. */
-extern tree gnat_save_expr (tree exp);
-
-/* Protect EXP for immediate reuse. This is a variant of gnat_save_expr that
- is optimized under the assumption that EXP's value doesn't change before
- its subsequent reuse(s) except through its potential reevaluation. */
-extern tree gnat_protect_expr (tree exp);
-
-/* This is equivalent to stabilize_reference in tree.c but we know how to
- handle our own nodes and we take extra arguments. FORCE says whether to
- force evaluation of everything. We set SUCCESS to true unless we walk
- through something we don't know how to stabilize. */
-extern tree gnat_stabilize_reference (tree ref, bool force, bool *success);
-
/* Implementation of the builtin_function langhook. */
extern tree gnat_builtin_function (tree decl);