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/exp_ch4.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/exp_ch4.adb')
-rw-r--r-- | gcc/ada/exp_ch4.adb | 169 |
1 files changed, 85 insertions, 84 deletions
diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index 8241925..b89d66c 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -2140,47 +2140,47 @@ package body Exp_Ch4 is if Llo /= No_Uint and then Rlo /= No_Uint then case N_Op_Compare (Nkind (N)) is - when N_Op_Eq => - if Llo = Lhi and then Rlo = Rhi and then Llo = Rlo then - Set_True; - elsif Llo > Rhi or else Lhi < Rlo then - Set_False; - end if; + when N_Op_Eq => + if Llo = Lhi and then Rlo = Rhi and then Llo = Rlo then + Set_True; + elsif Llo > Rhi or else Lhi < Rlo then + Set_False; + end if; - when N_Op_Ge => - if Llo >= Rhi then - Set_True; - elsif Lhi < Rlo then - Set_False; - end if; + when N_Op_Ge => + if Llo >= Rhi then + Set_True; + elsif Lhi < Rlo then + Set_False; + end if; - when N_Op_Gt => - if Llo > Rhi then - Set_True; - elsif Lhi <= Rlo then - Set_False; - end if; + when N_Op_Gt => + if Llo > Rhi then + Set_True; + elsif Lhi <= Rlo then + Set_False; + end if; - when N_Op_Le => - if Llo > Rhi then - Set_False; - elsif Lhi <= Rlo then - Set_True; - end if; + when N_Op_Le => + if Llo > Rhi then + Set_False; + elsif Lhi <= Rlo then + Set_True; + end if; - when N_Op_Lt => - if Llo >= Rhi then - Set_False; - elsif Lhi < Rlo then - Set_True; - end if; + when N_Op_Lt => + if Llo >= Rhi then + Set_False; + elsif Lhi < Rlo then + Set_True; + end if; - when N_Op_Ne => - if Llo = Lhi and then Rlo = Rhi and then Llo = Rlo then - Set_False; - elsif Llo > Rhi or else Lhi < Rlo then - Set_True; - end if; + when N_Op_Ne => + if Llo = Lhi and then Rlo = Rhi and then Llo = Rlo then + Set_False; + elsif Llo > Rhi or else Lhi < Rlo then + Set_True; + end if; end case; -- All done if we did the rewrite @@ -13170,56 +13170,57 @@ package body Exp_Ch4 is begin case N_Op_Compare (Nkind (N)) is - when N_Op_Eq => - True_Result := Res = EQ; - False_Result := Res = LT or else Res = GT or else Res = NE; - - when N_Op_Ge => - True_Result := Res in Compare_GE; - False_Result := Res = LT; - - if Res = LE - and then Constant_Condition_Warnings - and then Comes_From_Source (Original_Node (N)) - and then Nkind (Original_Node (N)) = N_Op_Ge - and then not In_Instance - and then Is_Integer_Type (Etype (Left_Opnd (N))) - and then not Has_Warnings_Off (Etype (Left_Opnd (N))) - then - Error_Msg_N - ("can never be greater than, could replace by ""'=""?c?", - N); - Warning_Generated := True; - end if; - - when N_Op_Gt => - True_Result := Res = GT; - False_Result := Res in Compare_LE; - - when N_Op_Lt => - True_Result := Res = LT; - False_Result := Res in Compare_GE; - - when N_Op_Le => - True_Result := Res in Compare_LE; - False_Result := Res = GT; + when N_Op_Eq => + True_Result := Res = EQ; + False_Result := Res = LT or else Res = GT or else Res = NE; + + when N_Op_Ge => + True_Result := Res in Compare_GE; + False_Result := Res = LT; + + if Res = LE + and then Constant_Condition_Warnings + and then Comes_From_Source (Original_Node (N)) + and then Nkind (Original_Node (N)) = N_Op_Ge + and then not In_Instance + and then Is_Integer_Type (Etype (Left_Opnd (N))) + and then not Has_Warnings_Off (Etype (Left_Opnd (N))) + then + Error_Msg_N + ("can never be greater than, could replace by " + & """'=""?c?", N); + Warning_Generated := True; + end if; - if Res = GE - and then Constant_Condition_Warnings - and then Comes_From_Source (Original_Node (N)) - and then Nkind (Original_Node (N)) = N_Op_Le - and then not In_Instance - and then Is_Integer_Type (Etype (Left_Opnd (N))) - and then not Has_Warnings_Off (Etype (Left_Opnd (N))) - then - Error_Msg_N - ("can never be less than, could replace by ""'=""?c?", N); - Warning_Generated := True; - end if; + when N_Op_Gt => + True_Result := Res = GT; + False_Result := Res in Compare_LE; + + when N_Op_Lt => + True_Result := Res = LT; + False_Result := Res in Compare_GE; + + when N_Op_Le => + True_Result := Res in Compare_LE; + False_Result := Res = GT; + + if Res = GE + and then Constant_Condition_Warnings + and then Comes_From_Source (Original_Node (N)) + and then Nkind (Original_Node (N)) = N_Op_Le + and then not In_Instance + and then Is_Integer_Type (Etype (Left_Opnd (N))) + and then not Has_Warnings_Off (Etype (Left_Opnd (N))) + then + Error_Msg_N + ("can never be less than, could replace by ""'=""?c?", + N); + Warning_Generated := True; + end if; - when N_Op_Ne => - True_Result := Res = NE or else Res = GT or else Res = LT; - False_Result := Res = EQ; + when N_Op_Ne => + True_Result := Res = NE or else Res = GT or else Res = LT; + False_Result := Res = EQ; end case; -- If this is the first iteration, then we actually convert the |