diff options
author | Hristian Kirtchev <kirtchev@adacore.com> | 2017-01-13 10:19:19 +0000 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2017-01-13 11:19:19 +0100 |
commit | d8f43ee6d0921b73670e8e123cdd0850dfeb330e (patch) | |
tree | f478a14a0fa94b8594e529f0aa178c5afedad3df /gcc/ada/sem_ch3.adb | |
parent | d4bf622fbf9018b4ffbb743fef37c7af0fa419c6 (diff) | |
download | gcc-d8f43ee6d0921b73670e8e123cdd0850dfeb330e.zip gcc-d8f43ee6d0921b73670e8e123cdd0850dfeb330e.tar.gz gcc-d8f43ee6d0921b73670e8e123cdd0850dfeb330e.tar.bz2 |
sem_aggr.adb, [...]: Update all eligible case statements to reflect the new style for case alternatives.
2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
* sem_aggr.adb, par_sco.adb, s-osprim-mingw.adb, exp_ch5.adb,
exp_prag.adb, sem_ch3.adb, xr_tabls.adb, lib-xref-spark_specific.adb,
layout.adb, sem_dist.adb, exp_spark.adb, exp_ch7.adb, gnatcmd.adb,
exp_util.adb, prj-proc.adb, sem_aux.adb, comperr.adb, g-memdum.adb,
exp_attr.adb, s-intman-solaris.adb, exp_ch9.adb, make.adb, live.adb,
g-sercom-linux.adb, sem_dim.adb, mlib-prj.adb, s-intman-posix.adb,
sem_ch9.adb, sem_ch10.adb, prep.adb, einfo.adb, scng.adb, checks.adb,
prj-strt.adb, sem_prag.adb, eval_fat.adb, sem_ch12.adb, sem.adb,
a-numaux-x86.adb, a-stwifi.adb, i-cobol.adb, prj.adb,
get_spark_xrefs.adb, s-tasini.adb, rtsfind.adb, freeze.adb,
g-arrspl.adb, par-ch4.adb, sem_util.adb, sem_res.adb, expander.adb,
sem_attr.adb, exp_dbug.adb, prj-pp.adb, a-stzfix.adb, s-interr.adb,
s-wchcnv.adb, switch-m.adb, gnat1drv.adb, sinput-l.adb, stylesw.adb,
contracts.adb, s-intman-android.adb, g-expect.adb, exp_ch4.adb,
g-comlin.adb, errout.adb, sinput.adb, s-exctra.adb, repinfo.adb,
g-spipat.adb, g-debpoo.adb, exp_ch6.adb, sem_ch4.adb, exp_ch13.adb,
a-wtedit.adb, validsw.adb, pprint.adb, widechar.adb, makeutl.adb,
ali.adb, set_targ.adb, sem_mech.adb, sem_ch6.adb, gnatdll.adb,
get_scos.adb, g-pehage.adb, s-tratas-default.adb, gnatbind.adb,
prj-dect.adb, g-socthi-mingw.adb, par-prag.adb, prj-nmsc.adb,
exp_disp.adb, par-ch12.adb, binde.adb, sem_ch8.adb,
s-tfsetr-default.adb, s-regexp.adb, gprep.adb, s-tpobop.adb,
a-teioed.adb, sem_warn.adb, sem_eval.adb, g-awk.adb, s-io.adb,
a-ztedit.adb, xoscons.adb, exp_intr.adb, sem_cat.adb, sprint.adb,
g-socket.adb, exp_dist.adb, sem_ch13.adb, s-tfsetr-vxworks.adb,
par-ch3.adb, treepr.adb, g-forstr.adb, g-catiio.adb, par-ch5.adb,
uname.adb, osint.adb, exp_ch3.adb, prj-env.adb, a-strfix.adb,
a-stzsup.adb, prj-tree.adb, s-fileio.adb: Update all eligible case
statements to reflect the new style for case alternatives. Various
code clean up and reformatting.
From-SVN: r244406
Diffstat (limited to 'gcc/ada/sem_ch3.adb')
-rw-r--r-- | gcc/ada/sem_ch3.adb | 86 |
1 files changed, 49 insertions, 37 deletions
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index e9f6fcd..ab1e8c0 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -1847,7 +1847,6 @@ package body Sem_Ch3 is when others => return False; - end case; end Contains_POC; @@ -2892,7 +2891,6 @@ package body Sem_Ch3 is when others => raise Program_Error; - end case; end if; @@ -4869,8 +4867,8 @@ package body Sem_Ch3 is case Ekind (T) is when Array_Kind => - Set_Ekind (Id, E_Array_Subtype); - Copy_Array_Subtype_Attributes (Id, T); + Set_Ekind (Id, E_Array_Subtype); + Copy_Array_Subtype_Attributes (Id, T); when Decimal_Fixed_Point_Kind => Set_Ekind (Id, E_Decimal_Fixed_Point_Subtype); @@ -4942,7 +4940,9 @@ package body Sem_Ch3 is Set_Equivalent_Type (Id, Equivalent_Type (T)); end if; - when E_Record_Type | E_Record_Subtype => + when E_Record_Subtype + | E_Record_Type + => Set_Ekind (Id, E_Record_Subtype); if Ekind (T) = E_Record_Subtype @@ -5097,7 +5097,7 @@ package body Sem_Ch3 is Set_Stored_Constraint_From_Discriminant_Constraint (Id); end if; - when Incomplete_Kind => + when Incomplete_Kind => if Ada_Version >= Ada_2005 then -- In Ada 2005 an incomplete type can be explicitly tagged: @@ -5808,9 +5808,10 @@ package body Sem_Ch3 is Set_Is_Internal (Anon); case Nkind (N) is - when N_Component_Declaration | - N_Unconstrained_Array_Definition | - N_Constrained_Array_Definition => + when N_Constrained_Array_Definition + | N_Component_Declaration + | N_Unconstrained_Array_Definition + => Comp := Component_Definition (N); Acc := Access_Definition (Comp); @@ -9103,9 +9104,10 @@ package body Sem_Ch3 is when Array_Kind => Build_Derived_Array_Type (N, Parent_Type, Derived_Type); - when E_Record_Type + when Class_Wide_Kind | E_Record_Subtype - | Class_Wide_Kind => + | E_Record_Type + => Build_Derived_Record_Type (N, Parent_Type, Derived_Type, Derive_Subps); return; @@ -11660,12 +11662,13 @@ package body Sem_Ch3 is Save_Homonym := Homonym (Priv); case Ekind (Full_Base) is - when E_Record_Type | - E_Record_Subtype | - Class_Wide_Kind | - Private_Kind | - Task_Kind | - Protected_Kind => + when Class_Wide_Kind + | Private_Kind + | Protected_Kind + | Task_Kind + | E_Record_Subtype + | E_Record_Type + => Copy_Node (Priv, Full); Set_Has_Discriminants @@ -17958,8 +17961,9 @@ package body Sem_Ch3 is is begin case T_Kind is - when Enumeration_Kind | - Integer_Kind => + when Enumeration_Kind + | Integer_Kind + => return Constraint_Kind = N_Range_Constraint; when Decimal_Fixed_Point_Kind => @@ -17974,14 +17978,15 @@ package body Sem_Ch3 is return Nkind_In (Constraint_Kind, N_Digits_Constraint, N_Range_Constraint); - when Access_Kind | - Array_Kind | - E_Record_Type | - E_Record_Subtype | - Class_Wide_Kind | - E_Incomplete_Type | - Private_Kind | - Concurrent_Kind => + when Access_Kind + | Array_Kind + | Class_Wide_Kind + | Concurrent_Kind + | Private_Kind + | E_Incomplete_Type + | E_Record_Subtype + | E_Record_Type + => return Constraint_Kind = N_Index_Or_Discriminant_Constraint; when others => @@ -18817,7 +18822,11 @@ package body Sem_Ch3 is end if; case Nkind (Original_Node (Exp)) is - when N_Aggregate | N_Extension_Aggregate | N_Function_Call | N_Op => + when N_Aggregate + | N_Extension_Aggregate + | N_Function_Call + | N_Op + => return True; when N_Identifier => @@ -18837,16 +18846,18 @@ package body Sem_Ch3 is -- A return statement for a build-in-place function returning a -- synchronized type also introduces an unchecked conversion. - when N_Type_Conversion | - N_Unchecked_Type_Conversion => + when N_Type_Conversion + | N_Unchecked_Type_Conversion + => return not Comes_From_Source (Exp) and then OK_For_Limited_Init_In_05 (Typ, Expression (Original_Node (Exp))); - when N_Indexed_Component | - N_Selected_Component | - N_Explicit_Dereference => + when N_Explicit_Dereference + | N_Indexed_Component + | N_Selected_Component + => return Nkind (Exp) = N_Function_Call; -- A use of 'Input is a function call, hence allowed. Normally the @@ -20891,10 +20902,11 @@ package body Sem_Ch3 is Constrain_Integer (Def_Id, S); Inherit_Predicate_Flags (Def_Id, Subtype_Mark_Id); - when E_Record_Type | - E_Record_Subtype | - Class_Wide_Kind | - E_Incomplete_Type => + when Class_Wide_Kind + | E_Incomplete_Type + | E_Record_Subtype + | E_Record_Type + => Constrain_Discriminated_Type (Def_Id, S, Related_Nod); if Ekind (Def_Id) = E_Incomplete_Type then |