aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/utils.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2012-02-27 10:41:10 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2012-02-27 10:41:10 +0000
commita0b8b1b736253f14044ba9d87cb435426915a90b (patch)
treebf702654748c8ce1cea4e17b381a5fe5c9856517 /gcc/ada/gcc-interface/utils.c
parent184d436af490f910a2cbed4b6f40a4b9bc6b76c2 (diff)
downloadgcc-a0b8b1b736253f14044ba9d87cb435426915a90b.zip
gcc-a0b8b1b736253f14044ba9d87cb435426915a90b.tar.gz
gcc-a0b8b1b736253f14044ba9d87cb435426915a90b.tar.bz2
ada-tree.h (TYPE_PACKED_ARRAY_TYPE_P): Add checking.
* gcc-interface/ada-tree.h (TYPE_PACKED_ARRAY_TYPE_P): Add checking. (TYPE_BY_REFERENCE_P): New flag. (TYPE_IS_BY_REFERENCE_P): New macro. (TYPE_DUMMY_P): Add checking and remove VOID_TYPE. (TYPE_IS_DUMMY_P): Adjust for above change. * gcc-interface/decl.c (gnat_to_gnu_entity): Use TYPE_BY_REFERENCE_P and TYPE_IS_BY_REFERENCE_P instead of TREE_ADDRESSABLE. (gnat_to_gnu_param): Likewise. (maybe_pad_type): Likewise. (make_type_from_size): Use TYPE_IS_PACKED_ARRAY_TYPE_P. * gcc-interface/misc.c (must_pass_by_ref): Use TYPE_IS_BY_REFERENCE_P instead of TREE_ADDRESSABLE. * gcc-interface/trans.c (finalize_nrv): Likewise. (call_to_gnu): Likewise. Do not create a temporary for return values with by-reference type here. (gnat_to_gnu): Test TYPE_IS_DUMMY_P instead of TYPE_DUMMY_P. (gnat_gimplify_expr) <ADDR_EXPR>: Don't do anything for non-constant CONSTRUCTORs and calls. * gcc-interface/utils.c (make_dummy_type): Get the equivalent type of the underlying type and use it throughout. Use TYPE_IS_BY_REFERENCE_P instead of TREE_ADDRESSABLE. * gcc-interface/utils2.c (build_cond_expr): Deal with by-reference types explicitly. From-SVN: r184594
Diffstat (limited to 'gcc/ada/gcc-interface/utils.c')
-rw-r--r--gcc/ada/gcc-interface/utils.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c
index ab8ca9d..33d11ef 100644
--- a/gcc/ada/gcc-interface/utils.c
+++ b/gcc/ada/gcc-interface/utils.c
@@ -291,7 +291,7 @@ make_dummy_type (Entity_Id gnat_type)
/* If there is an equivalent type, get its underlying type. */
if (Present (gnat_underlying))
- gnat_underlying = Underlying_Type (gnat_underlying);
+ gnat_underlying = Gigi_Equivalent_Type (Underlying_Type (gnat_underlying));
/* If there was no equivalent type (can only happen when just annotating
types) or underlying type, go back to the original type. */
@@ -311,8 +311,8 @@ make_dummy_type (Entity_Id gnat_type)
TYPE_DUMMY_P (gnu_type) = 1;
TYPE_STUB_DECL (gnu_type)
= create_type_stub_decl (TYPE_NAME (gnu_type), gnu_type);
- if (Is_By_Reference_Type (gnat_type))
- TREE_ADDRESSABLE (gnu_type) = 1;
+ if (Is_By_Reference_Type (gnat_underlying))
+ TYPE_BY_REFERENCE_P (gnu_type) = 1;
SET_DUMMY_NODE (gnat_underlying, gnu_type);