diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2011-10-07 11:17:55 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2011-10-07 11:17:55 +0000 |
commit | 71196d4e64ec6408e9a45a92d76abb9e715d8cc1 (patch) | |
tree | 8f7d2f68e499a4690bd68a1127224174cb0c17a2 /gcc/ada/gcc-interface/gigi.h | |
parent | 302b8e2a16a80114e4a4b8d3a760049e750d7167 (diff) | |
download | gcc-71196d4e64ec6408e9a45a92d76abb9e715d8cc1.zip gcc-71196d4e64ec6408e9a45a92d76abb9e715d8cc1.tar.gz gcc-71196d4e64ec6408e9a45a92d76abb9e715d8cc1.tar.bz2 |
gigi.h (gnat_useless_type_conversion): Declare.
* gcc-interface/gigi.h (gnat_useless_type_conversion): Declare.
(rest_of_subprog_body_compilation): Likewise.
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: For renaming,
test for useless conversions by means of gnat_useless_type_conversion.
* gcc-interface/trans.c: Include bitmap.h and cgraph.h.
(language_function): Add named_ret_val and other_ret_val.
(f_named_ret_val): New macro.
(f_other_ret_val): Likewise.
(gigi): Call rest_of_subprog_body_compilation.
(struct nrv_data): New structure.
(is_nrv_p): New predicate.
(prune_nrv_r): New helper function.
(prune_nrv_in_block): New function.
(finalize_nrv_r): New helper function.
(finalize_nrv): New function.
(return_value_ok_for_nrv_p): New predicate.
(build_return_expr): If optimization is enabled, record candidates for
the Named Return Value optimization.
(build_function_stub): Call rest_of_subprog_body_compilation.
(Subprogram_Body_to_gnu): If optimization is enabled and there are
candidates, finalize the Named Return Value optimization.
Call rest_of_subprog_body_compilation.
(call_to_gnu): At the end, if a return value is needed, simplify the
result before wrapping it up in a COMPOUND_EXPR.
* gcc-interface/utils.c (end_subprog_body): Split into...
(rest_of_subprog_body_compilation): ...this. New function.
(gnat_useless_type_conversion): Likewise.
From-SVN: r179650
Diffstat (limited to 'gcc/ada/gcc-interface/gigi.h')
-rw-r--r-- | gcc/ada/gcc-interface/gigi.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/ada/gcc-interface/gigi.h b/gcc/ada/gcc-interface/gigi.h index 30fa99e..1687fd1 100644 --- a/gcc/ada/gcc-interface/gigi.h +++ b/gcc/ada/gcc-interface/gigi.h @@ -479,6 +479,9 @@ extern tree gnat_signed_type (tree type_node); transparently converted to each other. */ extern int gnat_types_compatible_p (tree t1, tree t2); +/* Return true if EXPR is a useless type conversion. */ +extern bool gnat_useless_type_conversion (tree expr); + /* Return true if T, a FUNCTION_TYPE, has the specified list of flags. */ extern bool fntype_same_flags_p (const_tree, tree, bool, bool, bool); @@ -687,9 +690,12 @@ extern tree create_subprog_decl (tree subprog_name, tree asm_name, appearing in the subprogram. */ extern void begin_subprog_body (tree subprog_decl); -/* Finish the definition of the current subprogram BODY and finalize it. */ +/* Finish translating the current subprogram and set its BODY. */ extern void end_subprog_body (tree body); +/* Wrap up compilation of SUBPROG_DECL, a subprogram body. */ +extern void rest_of_subprog_body_compilation (tree subprog_decl); + /* 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. */ |