[Ada] Small cleanup in handling of Ada 2012 implicit dereferences
Pierre-Marie de Rodat
derodat@adacore.com
Fri Jun 12 08:35:46 GMT 2020
This aligns the handling of Ada 2012 implicit dereferences in the
Is_OK_Variable_For_Out_Formal predicate wih that in Is_Variable,
and removes unreachable code as a result.
This also makes more use of the Get_Reference_Discriminant helper
function to retrieve the reference discriminant of a type.
No functional changes.
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06-12 Eric Botcazou <ebotcazou@adacore.com>
gcc/ada/
* sem_ch4.adb (Try_Container_Indexing): Replace call to
First_Discriminant by Get_Reference_Discriminant to get the
reference discriminant.
* sem_ch13.adb (Check_Indexing_Functions): Likewise.
* sem_ch5.adb (Preanalyze_Range): Call Get_Reference_Discriminant
to get the reference discriminant.
* sem_util.adb (Is_OK_Variable_For_Out_Formal): Treat all
Ada 2012 implicit dereferences in only one place.
(Is_Variable): Minor tweak.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-diff
Size: 4412 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20200612/99d0af12/attachment-0001.bin>
More information about the Gcc-patches
mailing list