OSDN Git Service

Add Fariborz to my last change.
[pf3gnuchains/gcc-fork.git] / gcc / ada / gigi.h
index ae8b401..8d09174 100644 (file)
@@ -46,11 +46,11 @@ extern tree emit_stack_check (tree);
 
 /* GNU_TYPE is a type. Determine if it should be passed by reference by
    default.  */
-extern int default_pass_by_ref (tree);
+extern bool default_pass_by_ref (tree);
 
 /* GNU_TYPE is the type of a subprogram parameter.  Determine from the type
    if it should be passed by reference.  */
-extern int must_pass_by_ref (tree);
+extern bool must_pass_by_ref (tree);
 
 /* Elaboration routines for the front end.  */
 extern void elab_all_gnat (void);
@@ -91,7 +91,7 @@ extern void set_block_for_group (tree);
 
 /* Add a declaration statement for GNU_DECL to the current BLOCK_STMT node.
    Get SLOC from Entity_Id.  */
-extern void add_decl_stmt (tree, Entity_Id);
+extern void add_decl_expr (tree, Entity_Id);
 
 /* Given GNAT_ENTITY, elaborate all expressions that are required to
    be elaborated at the point of its definition, but do nothing else.  */
@@ -111,8 +111,6 @@ extern tree get_unpadded_type (Entity_Id);
 extern tree maybe_variable (tree);
 
 /* Create a record type that contains a field of TYPE with a starting bit
-   position so that it is aligned to ALIGN bits.  */
-/* Create a record type that contains a field of TYPE with a starting bit
    position so that it is aligned to ALIGN bits and is SIZE bytes long.  */
 extern tree make_aligning_type (tree, int, tree);
 
@@ -147,7 +145,7 @@ extern tree create_concat_name (Entity_Id, const char *);
 /* 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 int type_annotate_only;
+extern bool type_annotate_only;
 
 /* Current file name without path */
 extern const char *ref_filename;
@@ -171,9 +169,6 @@ extern void gnat_expand_stmt (tree);
 
 extern int gnat_gimplify_expr (tree *, tree *, tree *);
 
-/* Expand the body of GNU_DECL, which is not a nested function.  */
-extern void gnat_expand_body (tree);
-
 /* Do the processing for the declaration of a GNAT_ENTITY, a type.  If
    a separate Freeze node exists, delay the bulk of the processing.  Otherwise
    make a GCC type for GNAT_ENTITY and set up the correspondance.  */
@@ -217,12 +212,6 @@ extern void set_second_error_entity (Entity_Id);
 /* Protect EXP from multiple evaluation.  This may make a SAVE_EXPR.  */
 extern tree protect_multiple_eval (tree);
 
-/* Signal abort, with "Gigi abort" as the error label, and error_gnat_node
-   as the relevant node that provides the location info for the error.
-   The single parameter CODE is an integer code that is included in the
-   additional error message generated. */
-extern void gigi_abort (int) ATTRIBUTE_NORETURN;
-
 /* Initialize the table that maps GNAT codes to GCC codes for simple
    binary and unary operations.  */
 extern void init_code_table (void);
@@ -234,8 +223,7 @@ extern Node_Id error_gnat_node;
 /* This is equivalent to stabilize_reference in GCC's tree.c, but we know
    how to handle our new nodes and we take an extra argument that says
    whether to force evaluation of everything.  */
-
-extern tree gnat_stabilize_reference (tree, int);
+extern tree gnat_stabilize_reference (tree, bool);
 
 /* Highest number in the front-end node table.  */
 extern int max_gnat_nodes;
@@ -367,14 +355,14 @@ extern GTY(()) tree gnat_raise_decls[(int) LAST_REASON_CODE + 1];
 /* Returns non-zero if we are currently in the global binding level       */
 extern int global_bindings_p (void);
 
-/* Returns the list of declarations in the current level. Note that this list
-   is in reverse order (it has to be so for back-end compatibility).  */
-extern tree getdecls (void);
-
 /* Enter and exit a new binding level. */
 extern void gnat_pushlevel (void);
 extern void gnat_poplevel (void);
 
+/* Set SUPERCONTEXT of the BLOCK for the current binding level to FNDECL
+   and point FNDECL to this BLOCK.  */
+extern void set_current_block_context (tree);
+
 /* Set the jmpbuf_decl for the current binding level to DECL.  */
 extern void set_block_jmpbuf_decl (tree);
 
@@ -386,15 +374,11 @@ extern tree get_block_jmpbuf_decl (void);
    to handle the BLOCK node inside the BIND_EXPR.  */
 extern void insert_block (tree);
 
-/* Return nonzero if the are any variables in the current block.  */
-extern int block_has_vars (void);
-
-/* Records a ..._DECL node DECL as belonging to the current lexical scope.
-   Returns the ..._DECL node. */
-extern tree pushdecl (tree);
+/* Records a ..._DECL node DECL as belonging to the current lexical scope
+   and uses GNAT_ENTITY for location information.  */
+extern void gnat_pushdecl (tree, Entity_Id);
 
-/* Create the predefined scalar types such as `integer_type_node' needed
-   in the gcc back-end and initialize the global binding level.  */
+extern void gnat_init_stmt_group (void);
 extern void gnat_init_decl_processing (void);
 extern void init_gigi_decls (tree, tree);
 extern void gnat_init_gcc_eh (void);
@@ -433,7 +417,7 @@ extern tree convert (tree, tree);
    GNAT_ENTITY. Such gnu tree node is always an ..._DECL node.
    If NO_CHECK is nonzero, the latter check is suppressed.
    If GNU_DECL is zero, a previous association is to be reset.  */
-extern void save_gnu_tree (Entity_Id, tree, int);
+extern void save_gnu_tree (Entity_Id, tree, bool);
 
 /* GNAT_ENTITY is a GNAT tree node for a defining identifier.
    Return the ..._DECL node that was associated with it.  If there is no tree
@@ -441,29 +425,29 @@ extern void save_gnu_tree (Entity_Id, tree, int);
 extern tree get_gnu_tree (Entity_Id);
 
 /* Return nonzero if a GCC tree has been associated with GNAT_ENTITY.  */
-extern int present_gnu_tree (Entity_Id);
+extern bool present_gnu_tree (Entity_Id);
 
 /* Initialize tables for above routines.  */
 extern void init_gnat_to_gnu (void);
 
 /* Given a record type (RECORD_TYPE) and a chain of FIELD_DECL
    nodes (FIELDLIST), finish constructing the record or union type.
-   If HAS_REP is nonzero, this record has a rep clause; don't call
+   If HAS_REP is true, this record has a rep clause; don't call
    layout_type but merely set the size and alignment ourselves.
-   If DEFER_DEBUG is nonzero, do not call the debugging routines
+   If DEFER_DEBUG is true, do not call the debugging routines
    on this type; it will be done later. */
-extern void finish_record_type (tree, tree, int, int);
+extern void finish_record_type (tree, tree, bool, bool);
 
 /* Returns a FUNCTION_TYPE node. RETURN_TYPE is the type returned by the
    subprogram. If it is void_type_node, then we are dealing with a procedure,
    otherwise we are dealing with a function. PARAM_DECL_LIST is a list of
    PARM_DECL nodes that are the subprogram arguments.  CICO_LIST is the
    copy-in/copy-out list to be stored into TYPE_CI_CO_LIST.
-   RETURNS_UNCONSTRAINED is nonzero if the function returns an unconstrained
-   object.  RETURNS_BY_REF is nonzero if the function returns by reference.
-   RETURNS_WITH_DSP is nonzero if the function is to return with a
+   RETURNS_UNCONSTRAINED is true if the function returns an unconstrained
+   object.  RETURNS_BY_REF is true if the function returns by reference.
+   RETURNS_WITH_DSP is true if the function is to return with a
    depressed stack pointer.  */
-extern tree create_subprog_type (tree, tree, tree, int, int, int);
+extern tree create_subprog_type (tree, tree, tree, bool, bool, bool);
 
 /* Return a copy of TYPE, but safe to modify in any way.  */
 extern tree copy_type (tree);
@@ -474,55 +458,36 @@ extern tree create_index_type (tree, tree, tree);
 
 /* Return a TYPE_DECL node. TYPE_NAME gives the name of the type (a character
    string) and TYPE is a ..._TYPE node giving its data type.
-   ARTIFICIAL_P is nonzero if this is a declaration that was generated
-   by the compiler.  DEBUG_INFO_P is nonzero if we need to write debugging
-   information about this type.  */
-extern tree create_type_decl (tree, tree, struct attrib *, int, int);
+   ARTIFICIAL_P is true if this is a declaration that was generated
+   by the compiler.  DEBUG_INFO_P is true if we need to write debugging
+   information about this type.  GNAT_NODE is used for the position of
+   the decl.  */
+extern tree create_type_decl (tree, tree, struct attrib *, bool, bool,
+                             Node_Id);
 
 /* Returns a GCC VAR_DECL node. VAR_NAME gives the name of the variable.
    ASM_NAME is its assembler name (if provided).  TYPE is
    its data type (a GCC ..._TYPE node).  VAR_INIT is the GCC tree for an
    optional initial expression; NULL_TREE if none.
 
-   CONST_FLAG is nonzero if this variable is constant.
+   CONST_FLAG is true if this variable is constant.
 
-   PUBLIC_FLAG is nonzero if this definition is to be made visible outside of
+   PUBLIC_FLAG is true if this definition is to be made visible outside of
    the current compilation unit. This flag should be set when processing the
    variable definitions in a package specification.  EXTERN_FLAG is nonzero
    when processing an external variable declaration (as opposed to a
    definition: no storage is to be allocated for the variable here).
+
    STATIC_FLAG is only relevant when not at top level.  In that case
-   it indicates whether to always allocate storage to the variable.  */
-extern tree create_var_decl (tree, tree, tree, tree, int, int, int, int,
-                            struct attrib *);
+   it indicates whether to always allocate storage to the variable.
+
+   GNAT_NODE is used for the position of the decl.  */
+extern tree create_var_decl (tree, tree, tree, tree, bool, bool, bool, bool,
+                            struct attrib *, Node_Id);
 
 /* Given a DECL and ATTR_LIST, apply the listed attributes.  */
 extern void process_attributes (tree, struct attrib *);
 
-/* Obtain any pending elaborations and clear the old list.  */
-extern tree get_pending_elaborations (void);
-
-/* Return nonzero if there are pending elaborations.  */
-extern int pending_elaborations_p (void);
-
-/* Save a copy of the current pending elaboration list and make a new
-   one.  */
-extern void push_pending_elaborations (void);
-
-/* Pop the stack of pending elaborations.  */
-extern void pop_pending_elaborations (void);
-
-/* Return the current position in pending_elaborations so we can insert
-   elaborations after that point.  */
-extern tree get_elaboration_location (void);
-
-/* Insert the current elaborations after ELAB, which is in some elaboration
-   list.  */
-extern void insert_elaboration_list (tree);
-
-/* Add some pending elaborations to the current list.  */
-extern void add_pending_elaborations (tree, tree);
-
 /* Returns a FIELD_DECL node. FIELD_NAME the field name, FIELD_TYPE is its
    type, and RECORD_TYPE is the type of the parent.  PACKED is nonzero if
    this field is in a record type with a "pragma pack".  If SIZE is nonzero
@@ -532,20 +497,20 @@ extern void add_pending_elaborations (tree, tree);
 extern tree create_field_decl (tree, tree, tree, int, tree, tree, int);
 
 /* Returns a PARM_DECL node. PARAM_NAME is the name of the parameter,
-   PARAM_TYPE is its type.  READONLY is nonzero if the parameter is
+   PARAM_TYPE is its type.  READONLY is true if the parameter is
    readonly (either an IN parameter or an address of a pass-by-ref
    parameter). */
-extern tree create_param_decl (tree, tree, int);
+extern tree create_param_decl (tree, tree, bool);
 
 /* Returns a FUNCTION_DECL node.  SUBPROG_NAME is the name of the subprogram,
    ASM_NAME is its assembler name, SUBPROG_TYPE is its type (a FUNCTION_TYPE
    node), PARAM_DECL_LIST is the list of the subprogram arguments (a list of
    PARM_DECL nodes chained through the TREE_CHAIN field).
 
-   INLINE_FLAG, PUBLIC_FLAG, and EXTERN_FLAG are used to set the appropriate
-   fields in the FUNCTION_DECL.  */
-extern tree create_subprog_decl (tree, tree, tree, tree, int, int, int,
-                                struct attrib *);
+   INLINE_FLAG, PUBLIC_FLAG, EXTERN_FLAG, and ATTR_LIST are used to set the
+   appropriate fields in the FUNCTION_DECL.  GNAT_NODE gives the location.  */
+extern tree create_subprog_decl (tree, tree, tree, tree, bool, bool, bool,
+                                struct attrib *, Node_Id);
 
 /* Returns a LABEL_DECL node for LABEL_NAME.  */
 extern tree create_label_decl (tree);
@@ -589,14 +554,14 @@ extern void update_pointer_to (tree, tree);
 
 /* 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.  */
-extern tree max_size (tree, int);
+   minimum (if !MAX_P) possible value of the discriminant.  */
+extern tree max_size (tree, bool);
 
 /* Remove all conversions that are done in EXP.  This includes converting
    from a padded type or to a left-justified modular type.  If TRUE_ADDRESS
-   is nonzero, always return the address of the containing object even if
+   is true, always return the address of the containing object even if
    the address is not bit-aligned.  */
-extern tree remove_conversions (tree, int);
+extern tree remove_conversions (tree, bool);
 
 /* If EXP's type is an UNCONSTRAINED_ARRAY_TYPE, return an expression that
    refers to the underlying array.  If its type has TYPE_CONTAINS_TEMPLATE_P,
@@ -604,8 +569,8 @@ extern tree remove_conversions (tree, int);
 extern tree maybe_unconstrained_array (tree);
 
 /* Return an expression that does an unchecked converstion of EXPR to TYPE.
-   If NOTRUNC_P is set, truncation operations should be suppressed.  */
-extern tree unchecked_convert (tree, tree, int);
+   If NOTRUNC_P is true, truncation operations should be suppressed.  */
+extern tree unchecked_convert (tree, tree, bool);
 
 /* Prepare expr to be an argument of a TRUTH_NOT_EXPR or other logical
    operation.
@@ -667,7 +632,7 @@ extern tree gnat_build_constructor (tree, tree);
 /* Return a COMPONENT_REF to access a field that is given by COMPONENT,
    an IDENTIFIER_NODE giving the name of the field, FIELD, a FIELD_DECL,
    for the field, or both.  Don't fold the result if NO_FOLD_P.  */
-extern tree build_component_ref (tree, tree, tree, int);
+extern tree build_component_ref (tree, tree, tree, bool);
 
 /* Build a GCC tree to call an allocation or deallocation function.
    If GNU_OBJ is nonzero, it is an object to deallocate.  Otherwise,
@@ -696,6 +661,10 @@ extern tree fill_vms_descriptor (tree, Entity_Id);
    should not be allocated in a register.  Return true if successful.  */
 extern bool gnat_mark_addressable (tree);
 
+/* Implementation of the builtin_function langhook.  */
+extern tree builtin_function (const char *, tree, int, enum built_in_class,
+                             const char *, tree);
+
 /* This function is called by the front end to enumerate all the supported
    modes for the machine.  We pass a function which is called back with
    the following integer parameters: