diff options
Diffstat (limited to 'gcc/ada/exp_ch3.adb')
| -rw-r--r-- | gcc/ada/exp_ch3.adb | 33 |
1 files changed, 10 insertions, 23 deletions
diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb index 8e1124a..98ad0e2 100644 --- a/gcc/ada/exp_ch3.adb +++ b/gcc/ada/exp_ch3.adb @@ -5846,31 +5846,18 @@ package body Exp_Ch3 is -- Expand_N_Variant_Part -- --------------------------- - procedure Expand_N_Variant_Part (N : Node_Id) is - Last_Var : constant Node_Id := Last_Non_Pragma (Variants (N)); - Others_Node : Node_Id; + -- Note: this procedure no longer has any effect. It used to be that we + -- would replace the choices in the last variant by a when others, and + -- also expanded static predicates in variant choices here, but both of + -- those activities were being done too early, since we can't check the + -- choices until the statically predicated subtypes are frozen, which can + -- happen as late as the free point of the record, and we can't change the + -- last choice to an others before checking the choices, which is now done + -- at the freeze point of the record. + procedure Expand_N_Variant_Part (N : Node_Id) is begin - -- If the last variant does not contain the Others choice, replace it - -- with an N_Others_Choice node since Gigi always wants an Others. Note - -- that we do not bother to call Analyze on the modified variant part, - -- since its only effect would be to compute the Others_Discrete_Choices - -- node laboriously, and of course we already know the list of choices - -- corresponding to the others choice (it's the list we're replacing!) - - if Nkind (First (Discrete_Choices (Last_Var))) /= N_Others_Choice then - Others_Node := Make_Others_Choice (Sloc (Last_Var)); - Set_Others_Discrete_Choices - (Others_Node, Discrete_Choices (Last_Var)); - Set_Discrete_Choices (Last_Var, New_List (Others_Node)); - end if; - - -- We have one more expansion activity, which is to deal with static - -- predicates in the variant choices. But we have to defer that to - -- the freeze point, because the statically predicated subtype won't - -- be fully processed till then, so this expansion activity is carried - -- out in Freeze_Record_Type. - + null; end Expand_N_Variant_Part; --------------------------------- |
