diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2013-10-10 14:27:37 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2013-10-10 14:27:37 +0200 |
commit | 4530b919823b0cd7cdaddd14350310e2cb5711c4 (patch) | |
tree | 19eca81a6b738b0f0635049d99cccf6e686ce8e1 /gcc/ada/freeze.adb | |
parent | 4169c2d220718a78e661a605ebd838b0ad5a40bd (diff) | |
download | gcc-4530b919823b0cd7cdaddd14350310e2cb5711c4.zip gcc-4530b919823b0cd7cdaddd14350310e2cb5711c4.tar.gz gcc-4530b919823b0cd7cdaddd14350310e2cb5711c4.tar.bz2 |
[multiple changes]
2013-10-10 Pascal Obry <obry@adacore.com>
* prj-conf.adb: Minor typo fixes in comment.
2013-10-10 Thomas Quinot <quinot@adacore.com>
* s-taprop-posix.adb (Compute_Deadline): New local subprogram,
factors common code between Timed_Sleep and Timed_Delay.
2013-10-10 Robert Dewar <dewar@adacore.com>
* 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 <dewar@adacore.com>
* 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
Diffstat (limited to 'gcc/ada/freeze.adb')
-rw-r--r-- | gcc/ada/freeze.adb | 34 |
1 files changed, 21 insertions, 13 deletions
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; |