From 4530b919823b0cd7cdaddd14350310e2cb5711c4 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Thu, 10 Oct 2013 14:27:37 +0200 Subject: [multiple changes] 2013-10-10 Pascal Obry * prj-conf.adb: Minor typo fixes in comment. 2013-10-10 Thomas Quinot * s-taprop-posix.adb (Compute_Deadline): New local subprogram, factors common code between Timed_Sleep and Timed_Delay. 2013-10-10 Robert Dewar * freeze.adb (Freeze_Record_Type): Don't replace others if expander inactive. This avoids clobbering the ASIS tree in -gnatct mode. 2013-10-10 Robert Dewar * sem_res.adb (Resolve_Op_Expon): Avoid crash testing for fixed-point case in preanalysis mode (error will be caught during full analysis). From-SVN: r203362 --- gcc/ada/freeze.adb | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) (limited to 'gcc/ada/freeze.adb') diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb index e8a2d9f..79b0a0d 100644 --- a/gcc/ada/freeze.adb +++ b/gcc/ada/freeze.adb @@ -2766,20 +2766,28 @@ package body Freeze is -- of course we already know the list of choices corresponding -- to the others choice (it's the list we're replacing!) - declare - Last_Var : constant Node_Id := - Last_Non_Pragma (Variants (V)); - Others_Node : Node_Id; - begin - if Nkind (First (Discrete_Choices (Last_Var))) /= + -- We only want to do this if the expander is active, since + -- we do not want to clobber the ASIS tree! + + if Expander_Active then + declare + Last_Var : constant Node_Id := + Last_Non_Pragma (Variants (V)); + + Others_Node : Node_Id; + + begin + 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; - end; + 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; + end; + end if; end if; end Check_Variant_Part; end Freeze_Record_Type; -- cgit v1.1