diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2011-12-18 14:41:00 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2011-12-18 14:41:00 +0000 |
commit | 2ad8d9105d0f772c46c12d65c799ed3938285346 (patch) | |
tree | 0a142fcd6ce856dec9298f10e5d77f444c652cd3 /gcc/ada/gcc-interface/decl.c | |
parent | 7cb62ef1ba8272fa9706c9110289a1d3ced36d65 (diff) | |
download | gcc-2ad8d9105d0f772c46c12d65c799ed3938285346.zip gcc-2ad8d9105d0f772c46c12d65c799ed3938285346.tar.gz gcc-2ad8d9105d0f772c46c12d65c799ed3938285346.tar.bz2 |
decl.c (gnat_to_gnu_param): Add comment about double reference and DECL_POINTS_TO_READONLY_P.
* gcc-interface/decl.c (gnat_to_gnu_param): Add comment about double
reference and DECL_POINTS_TO_READONLY_P.
* gcc-interface/trans.c (Identifier_to_gnu) <by_ref>: Always set the
TREE_READONLY flag on the first dereference of a double dereference.
From-SVN: r182460
Diffstat (limited to 'gcc/ada/gcc-interface/decl.c')
-rw-r--r-- | gcc/ada/gcc-interface/decl.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index c3774f2..89a6a2e 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -5587,6 +5587,10 @@ gnat_to_gnu_param (Entity_Id gnat_param, Mechanism_Type mech, DECL_BY_COMPONENT_PTR_P (gnu_param) = by_component_ptr; DECL_BY_DESCRIPTOR_P (gnu_param) = (mech == By_Descriptor || mech == By_Short_Descriptor); + /* Note that, in case of a parameter passed by double reference, the + DECL_POINTS_TO_READONLY_P flag is meant for the second reference. + The first reference always points to read-only, as it points to + the second reference, i.e. the reference to the actual parameter. */ DECL_POINTS_TO_READONLY_P (gnu_param) = (ro_param && (by_ref || by_component_ptr)); DECL_CAN_NEVER_BE_NULL_P (gnu_param) = Can_Never_Be_Null (gnat_param); |