diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2010-04-08 20:16:36 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2010-04-08 20:16:36 +0000 |
commit | d47d0a8d97e00479a3efd3913bc996f319ac8139 (patch) | |
tree | 3bbe3665b3ad0f65e64b4973b9c1ddee13f15d9a /gcc/ada/gcc-interface/ada-tree.h | |
parent | dc5ee869f578f51a2691833b4d60054bf7e2a0a9 (diff) | |
download | gcc-d47d0a8d97e00479a3efd3913bc996f319ac8139.zip gcc-d47d0a8d97e00479a3efd3913bc996f319ac8139.tar.gz gcc-d47d0a8d97e00479a3efd3913bc996f319ac8139.tar.bz2 |
tree.h (TREE_ADDRESSABLE): Document its effect for function types.
* tree.h (TREE_ADDRESSABLE): Document its effect for function types.
* calls.c (expand_call): Pass the function type to aggregate_value_p.
* function.c (aggregate_value_p): Do not honor DECL_BY_REFERENCE on
the target function of a CALL_EXPR. Honor TREE_ADDRESSABLE on the
function type instead. Reorder and simplify checks.
* gimplify.c (gimplify_modify_expr_rhs) <WITH_SIZE_EXPR>: New case.
ada/
* gcc-interface/ada-tree.h (TYPE_RETURNS_UNCONSTRAINED_P): Rename into.
(TYPE_RETURN_UNCONSTRAINED_P): ...this.
(TYPE_RETURNS_BY_REF_P): Rename into.
(TYPE_RETURN_BY_DIRECT_REF_P): ...this.
(TYPE_RETURNS_BY_TARGET_PTR_P): Delete.
* gcc-interface/gigi.h (create_subprog_type): Adjust parameter names.
(build_return_expr): Likewise.
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Subprogram_Type>:
Rename local variables. If the return Mechanism is By_Reference, pass
return_by_invisible_ref_p to create_subprog_type instead of toggling
TREE_ADDRESSABLE. Test return_by_invisible_ref_p in order to annotate
the mechanism. Use regular return for contrained types with non-static
size and return by invisible reference for unconstrained return types
with default discriminants. Update comment.
* gcc-interface/trans.c (Subprogram_Body_to_gnu): If the function
returns by invisible reference, turn the RESULT_DECL into a pointer.
Do not handle DECL_BY_REF_P in the CICO case here.
(call_to_gnu): Remove code handling return by target pointer. For a
function call, if the return type has non-constant size, generate the
assignment with an INIT_EXPR.
(gnat_to_gnu) <N_Return_Statement>: Remove dead code in the CICO case.
If the function returns by invisible reference, build the copy return
operation manually.
(add_decl_expr): Initialize the variable with an INIT_EXPR.
* gcc-interface/utils.c (create_subprog_type): Adjust parameter names.
Adjust for renaming of macros. Copy the node only when necessary.
(create_subprog_decl): Do not toggle TREE_ADDRESSABLE on the return
type, only change DECL_BY_REFERENCE on the RETURN_DECL.
(convert_from_reference): Delete.
(is_byref_result): Likewise.
(gnat_genericize_r): Likewise.
(gnat_genericize): Likewise.
(end_subprog_body): Do not call gnat_genericize.
* gcc-interface/utils2.c (build_binary_op) <INIT_EXPR>: New case.
(build_return_expr): Adjust parameter names, logic and comment.
From-SVN: r158139
Diffstat (limited to 'gcc/ada/gcc-interface/ada-tree.h')
-rw-r--r-- | gcc/ada/gcc-interface/ada-tree.h | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/gcc/ada/gcc-interface/ada-tree.h b/gcc/ada/gcc-interface/ada-tree.h index 67a16ef..8a646fe 100644 --- a/gcc/ada/gcc-interface/ada-tree.h +++ b/gcc/ada/gcc-interface/ada-tree.h @@ -6,7 +6,7 @@ * * * C Header File * * * - * Copyright (C) 1992-2009, Free Software Foundation, Inc. * + * Copyright (C) 1992-2010, Free Software Foundation, Inc. * * * * GNAT is free software; you can redistribute it and/or modify it under * * terms of the GNU General Public License as published by the Free Soft- * @@ -90,7 +90,7 @@ do { \ /* For FUNCTION_TYPE, nonzero if this denotes a function returning an unconstrained array or record. */ -#define TYPE_RETURNS_UNCONSTRAINED_P(NODE) \ +#define TYPE_RETURN_UNCONSTRAINED_P(NODE) \ TYPE_LANG_FLAG_1 (FUNCTION_TYPE_CHECK (NODE)) /* For RECORD_TYPE, UNION_TYPE, and QUAL_UNION_TYPE, nonzero if this denotes @@ -135,8 +135,10 @@ do { \ #define TYPE_CONVENTION_FORTRAN_P(NODE) \ TYPE_LANG_FLAG_4 (ARRAY_TYPE_CHECK (NODE)) -/* For FUNCTION_TYPEs, nonzero if the function returns by reference. */ -#define TYPE_RETURNS_BY_REF_P(NODE) \ +/* For FUNCTION_TYPEs, nonzero if the function returns by direct reference, + i.e. the callee returns a pointer to a memory location it has allocated + and the caller only needs to dereference the pointer. */ +#define TYPE_RETURN_BY_DIRECT_REF_P(NODE) \ TYPE_LANG_FLAG_4 (FUNCTION_TYPE_CHECK (NODE)) /* For VOID_TYPE, ENUMERAL_TYPE, UNION_TYPE, and RECORD_TYPE, nonzero if this @@ -148,11 +150,6 @@ do { \ || TREE_CODE (NODE) == UNION_TYPE || TREE_CODE (NODE) == ENUMERAL_TYPE) \ && TYPE_DUMMY_P (NODE)) -/* For FUNCTION_TYPEs, nonzero if function returns by being passed a pointer - to a place to store its result. */ -#define TYPE_RETURNS_BY_TARGET_PTR_P(NODE) \ - TYPE_LANG_FLAG_5 (FUNCTION_TYPE_CHECK (NODE)) - /* For an INTEGER_TYPE, nonzero if TYPE_ACTUAL_BOUNDS is present. */ #define TYPE_HAS_ACTUAL_BOUNDS_P(NODE) \ TYPE_LANG_FLAG_5 (INTEGER_TYPE_CHECK (NODE)) |