aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/gigi.h
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2016-04-27 18:08:39 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2016-04-27 18:08:39 +0000
commit1e55d29a0c643ebef76b6056077e9f78686669d6 (patch)
treec55480876dc3fe6269c2e5c4075b0b3b34bf2b5d /gcc/ada/gcc-interface/gigi.h
parente306693a820abb242c4ccfce28bbd0f9cec7bda9 (diff)
downloadgcc-1e55d29a0c643ebef76b6056077e9f78686669d6.zip
gcc-1e55d29a0c643ebef76b6056077e9f78686669d6.tar.gz
gcc-1e55d29a0c643ebef76b6056077e9f78686669d6.tar.bz2
sem_aux.adb (Is_By_Reference_Type): Also return true for a tagged incomplete type without full view.
* sem_aux.adb (Is_By_Reference_Type): Also return true for a tagged incomplete type without full view. * sem_ch6.adb (Exchange_Limited_Views): Change into a function and return the list of changes. (Restore_Limited_Views): New procedure to undo the transformation made by Exchange_Limited_Views. (Analyze_Subprogram_Body_Helper): Adjust call to Exchange_Limited_Views and call Restore_Limited_Views at the end, if need be. (Possible_Freeze): Do not delay freezing because of incomplete types. (Process_Formals): Remove kludges for class-wide types. * types.h (By_Copy_Return): Delete. * gcc-interface/ada-tree.h (TYPE_MAX_ALIGN): Move around. (TYPE_DUMMY_IN_PROFILE_P): New macro. * gcc-interface/gigi.h (update_profiles_with): Declare. (finish_subprog_decl): Likewise. (get_minimal_subprog_decl): Delete. (create_subprog_type): Likewise. (create_param_decl): Adjust prototype. (create_subprog_decl): Likewise. * gcc-interface/decl.c (defer_limited_with): Rename into... (defer_limited_with_list): ...this. (gnat_to_gnu_entity): Adjust to above renaming. (finalize_from_limited_with): Likewise. (tree_entity_vec_map): New structure. (gt_pch_nx): New helpers. (dummy_to_subprog_map): New hash table. (gnat_to_gnu_param): Set the SLOC here. Remove MECH parameter and add FIRST parameter. Deal with the mechanism here instead of... Do not make read-only variant of types. Simplify expressions. In the by-ref case, test the mechanism before must_pass_by_ref and also TYPE_IS_BY_REFERENCE_P before building the reference type. (gnat_to_gnu_subprog_type): New static function extracted from... Do not special-case the type_annotate_only mode. Call gnat_to_gnu_profile_type instead of gnat_to_gnu_type on return type. Deal with dummy return types. Likewise for parameter types. Deal with by-reference types explicitly and add a kludge for null procedures with untagged incomplete types. Remove assertion on the types and be prepared for multiple elaboration of the declarations. Skip the whole CICO processing if the profile is incomplete. Handle the completion of a previously incomplete profile. (gnat_to_gnu_entity) <E_Variable>: Rename local variable. Adjust couple of calls to create_param_decl. <E_Access_Subprogram_Type, E_Anonymous_Access_Subprogram_Type>: Remove specific deferring code. <E_Access_Type>: Also deal with E_Subprogram_Type designated type. Simplify handling of dummy types and remove obsolete comment. Constify a couple of variables. Do not set TYPE_UNIVERSAL_ALIASING_P on dummy types. <E_Access_Subtype>: Tweak comment and simplify condition. <E_Subprogram_Type>: ...here. Call it and clean up handling. Remove obsolete comment and adjust call to gnat_to_gnu_param. Adjust call to create_subprog_decl. <E_Incomplete_Type>: Add a couple of 'const' qualifiers and get rid of inner break statements. Tidy up condition guarding direct use of the full view. (get_minimal_subprog_decl): Delete. (finalize_from_limited_with): Call update_profiles_with on dummy types with TYPE_DUMMY_IN_PROFILE_P set. (is_from_limited_with_of_main): Delete. (associate_subprog_with_dummy_type): New function. (update_profile): Likewise. (update_profiles_with): Likewise. (gnat_to_gnu_profile_type): Likewise. (init_gnat_decl): Initialize dummy_to_subprog_map. (destroy_gnat_decl): Destroy dummy_to_subprog_map. * gcc-interface/misc.c (gnat_get_alias_set): Add guard for accessing TYPE_UNIVERSAL_ALIASING_P. (gnat_get_array_descr_info): Minor tweak. * gcc-interface/trans.c (gigi): Adjust calls to create_subprog_decl. (build_raise_check): Likewise. (Compilation_Unit_to_gnu): Likewise. (Identifier_to_gnu): Accept mismatches coming from a limited context. (Attribute_to_gnu): Remove kludge for dispatch table entities. (process_freeze_entity): Do not retrieve old definition if there is an address clause on the entity. Call update_profiles_with on dummy types with TYPE_DUMMY_IN_PROFILE_P set. * gcc-interface/utils.c (build_dummy_unc_pointer_types): Also set TYPE_REFERENCE_TO to the fat pointer type. (create_subprog_type): Delete. (create_param_decl): Remove READONLY parameter. (finish_subprog_decl): New function extracted from... (create_subprog_decl): ...here. Call it. Remove CONST_FLAG and VOLATILE_FLAG parameters and adjust. (update_pointer_to): Also clear TYPE_REFERENCE_TO in the unconstrained case. From-SVN: r235521
Diffstat (limited to 'gcc/ada/gcc-interface/gigi.h')
-rw-r--r--gcc/ada/gcc-interface/gigi.h42
1 files changed, 15 insertions, 27 deletions
diff --git a/gcc/ada/gcc-interface/gigi.h b/gcc/ada/gcc-interface/gigi.h
index 4fb2fc4..9cc744b 100644
--- a/gcc/ada/gcc-interface/gigi.h
+++ b/gcc/ada/gcc-interface/gigi.h
@@ -49,6 +49,10 @@ extern tree gnat_to_gnu_field_decl (Entity_Id gnat_entity);
the GCC type corresponding to that entity. */
extern tree gnat_to_gnu_type (Entity_Id gnat_entity);
+/* Update the GCC tree previously built for the profiles involving GNU_TYPE,
+ a dummy type which appears in profiles. */
+extern void update_profiles_with (tree gnu_type);
+
/* Start a new statement group chained to the previous group. */
extern void start_stmt_group (void);
@@ -109,11 +113,6 @@ extern void elaborate_entity (Entity_Id gnat_entity);
/* Get the unpadded version of a GNAT type. */
extern tree get_unpadded_type (Entity_Id gnat_entity);
-/* Return the DECL associated with the public subprogram GNAT_ENTITY but whose
- type has been changed to that of the parameterless procedure, except if an
- alias is already present, in which case it is returned instead. */
-extern tree get_minimal_subprog_decl (Entity_Id gnat_entity);
-
/* Return whether the E_Subprogram_Type/E_Function/E_Procedure GNAT_ENTITY is
a C++ imported method or equivalent. */
extern bool is_cplusplus_method (Entity_Id gnat_entity);
@@ -631,20 +630,6 @@ extern void rest_of_record_type_compilation (tree record_type);
/* Append PARALLEL_TYPE on the chain of parallel types for TYPE. */
extern void add_parallel_type (tree type, tree parallel_type);
-/* Return a FUNCTION_TYPE node. RETURN_TYPE is the type returned by the
- subprogram. If it is VOID_TYPE, 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 parameters. CICO_LIST is the
- copy-in/copy-out list to be stored into the TYPE_CICO_LIST field.
- RETURN_UNCONSTRAINED_P is true if the function returns an unconstrained
- object. RETURN_BY_DIRECT_REF_P is true if the function returns by direct
- reference. RETURN_BY_INVISI_REF_P is true if the function returns by
- invisible reference. */
-extern tree create_subprog_type (tree return_type, tree param_decl_list,
- tree cico_list, bool return_unconstrained_p,
- bool return_by_direct_ref_p,
- bool return_by_invisi_ref_p);
-
/* Return a copy of TYPE, but safe to modify in any way. */
extern tree copy_type (tree type);
@@ -717,10 +702,8 @@ extern tree create_field_decl (tree name, tree type, tree record_type,
tree size, tree pos, int packed,
int addressable);
-/* Return a PARM_DECL node. NAME is the name of the parameter and 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 name, tree type, bool readonly);
+/* Return a PARM_DECL node with NAME and TYPE. */
+extern tree create_param_decl (tree name, tree type);
/* Return a LABEL_DECL with NAME. GNAT_NODE is used for the position of
the decl. */
@@ -733,8 +716,10 @@ extern tree create_label_decl (tree name, Node_Id gnat_node);
INLINE_STATUS describes the inline flags to be set on the FUNCTION_DECL.
- CONST_FLAG, PUBLIC_FLAG, EXTERN_FLAG, VOLATILE_FLAG are used to set the
- appropriate flags on the FUNCTION_DECL.
+ PUBLIC_FLAG is true if this is for a reference to a public entity or for a
+ definition to be made visible outside of the current compilation unit.
+
+ EXTERN_FLAG is true when processing an external subprogram declaration.
ARTIFICIAL_P is true if the subprogram was generated by the compiler.
@@ -746,11 +731,14 @@ extern tree create_label_decl (tree name, Node_Id gnat_node);
extern tree create_subprog_decl (tree name, tree asm_name, tree type,
tree param_decl_list,
enum inline_status_t inline_status,
- bool const_flag, bool public_flag,
- bool extern_flag, bool volatile_flag,
+ bool public_flag, bool extern_flag,
bool artificial_p, bool debug_info_p,
struct attrib *attr_list, Node_Id gnat_node);
+/* Given a subprogram declaration DECL and its TYPE, finish constructing the
+ subprogram declaration from TYPE. */
+extern void finish_subprog_decl (tree decl, tree type);
+
/* 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. */