diff options
author | Arnaud Charlet <charlet@adacore.com> | 2023-02-03 11:07:24 +0000 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2023-05-22 10:44:09 +0200 |
commit | 8f563162db870d42d7306551a9dda51201ad9862 (patch) | |
tree | 8efdfafe95aba46a6c3e61a41f3a6a40f74cda0e /gcc/ada/sem_res.adb | |
parent | d516e77b5ed1d8cce0a03227a7c1946c9de21e2f (diff) | |
download | gcc-8f563162db870d42d7306551a9dda51201ad9862.zip gcc-8f563162db870d42d7306551a9dda51201ad9862.tar.gz gcc-8f563162db870d42d7306551a9dda51201ad9862.tar.bz2 |
ada: Remove extra parentheses
In preparation of enhancing -gnatyx to check for these automatically.
gcc/ada/
* ali-util.adb, par-endh.adb, par-prag.adb, par-ch2.adb,
checks.adb, fmap.adb, libgnat/a-nbnbig.ads, libgnat/g-dynhta.adb,
libgnat/s-carun8.adb, libgnat/s-strcom.adb, libgnat/a-dhfina.adb,
libgnat/a-direct.adb, libgnat/a-rbtgbo.adb, libgnat/a-strsea.adb,
libgnat/a-ststio.adb, libgnat/a-suenco.adb, libgnat/a-costso.adb,
libgnat/a-strmap.adb, libgnat/g-alleve.adb,
libgnat/g-debpoo.adb, libgnat/g-sercom__linux.adb,
libgnat/s-genbig.adb, libgnat/s-mmap.adb, libgnat/s-regpat.adb,
par-ch5.adb, sem_case.adb, sem_ch12.adb, sem_ch13.adb,
sem_ch8.adb, sem_eval.adb, sem_prag.adb, sem_type.adb,
exp_ch11.adb, exp_ch2.adb, exp_ch3.adb, exp_ch4.adb, exp_ch5.adb,
exp_ch6.adb, exp_ch9.adb, exp_put_image.adb, freeze.adb, live.adb,
sem_aggr.adb, sem_cat.adb, sem_ch10.adb, sem_ch3.adb, sem_ch6.adb,
sem_ch9.adb, sem_disp.adb, sem_elab.adb, sem_res.adb,
sem_util.adb, sinput.adb, uintp.adb, bcheck.adb, binde.adb,
binderr.adb, einfo-utils.adb, clean.adb, sem_ch4.adb, gnatls.adb,
gprep.adb, sem_ch11.adb: Remove extra parentheses.
Diffstat (limited to 'gcc/ada/sem_res.adb')
-rw-r--r-- | gcc/ada/sem_res.adb | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index f6634da..3eb13de 100644 --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -2937,7 +2937,7 @@ package body Sem_Res is -- view-swapping mechanism has no identifier. elsif (In_Instance or else In_Inlined_Body) - and then (Nkind (N) = N_Null) + and then Nkind (N) = N_Null and then Is_Private_Type (Typ) and then Is_Access_Type (Full_View (Typ)) then @@ -6305,11 +6305,11 @@ package body Sem_Res is begin Determine_Range (Left_Opnd (N), OK, Lo, Hi, Assume_Valid => True); - LNeg := (not OK) or else Lo < 0; + LNeg := not OK or else Lo < 0; Determine_Range (Right_Opnd (N), OK, Lo, Hi, Assume_Valid => True); - RNeg := (not OK) or else Lo < 0; + RNeg := not OK or else Lo < 0; -- Check if we will be generating conditionals. There are two -- cases where that can happen, first for REM, the only case @@ -10916,14 +10916,14 @@ package body Sem_Res is if not Parentheses_Found and then Comes_From_Source (Par) and then - ((Nkind (Par) in N_Modular_Type_Definition - | N_Floating_Point_Definition - | N_Ordinary_Fixed_Point_Definition - | N_Decimal_Fixed_Point_Definition - | N_Extension_Aggregate - | N_Discriminant_Specification - | N_Parameter_Specification - | N_Formal_Object_Declaration) + (Nkind (Par) in N_Modular_Type_Definition + | N_Floating_Point_Definition + | N_Ordinary_Fixed_Point_Definition + | N_Decimal_Fixed_Point_Definition + | N_Extension_Aggregate + | N_Discriminant_Specification + | N_Parameter_Specification + | N_Formal_Object_Declaration or else (Nkind (Par) = N_Object_Declaration and then @@ -13229,8 +13229,8 @@ package body Sem_Res is -- For other operators the context does not impose a type on -- the operands, but their types must match. - if (Nkind (Left_Opnd (N)) - not in N_Integer_Literal | N_String_Literal | N_Real_Literal) + if Nkind (Left_Opnd (N)) + not in N_Integer_Literal | N_String_Literal | N_Real_Literal and then Has_Applicable_User_Defined_Literal (Right_Opnd (N), Etype (Left_Opnd (N))) @@ -13238,8 +13238,8 @@ package body Sem_Res is Analyze_And_Resolve (N, Typ); return True; - elsif (Nkind (Right_Opnd (N)) - not in N_Integer_Literal | N_String_Literal | N_Real_Literal) + elsif Nkind (Right_Opnd (N)) + not in N_Integer_Literal | N_String_Literal | N_Real_Literal and then Has_Applicable_User_Defined_Literal (Left_Opnd (N), Etype (Right_Opnd (N))) @@ -13543,8 +13543,8 @@ package body Sem_Res is -- return False if Expr not of form <prefix>.all.Some_Component - if (Nkind (Expr) /= N_Selected_Component) - or else (Nkind (Prefix (Expr)) /= N_Explicit_Dereference) + if Nkind (Expr) /= N_Selected_Component + or else Nkind (Prefix (Expr)) /= N_Explicit_Dereference then -- conditional expressions, declare expressions ??? return False; @@ -13628,8 +13628,8 @@ package body Sem_Res is if not (Is_Integer_Type (Target_Index_Type) and then Is_Integer_Type (Opnd_Index_Type)) - and then (Root_Type (Target_Index_Type) - /= Root_Type (Opnd_Index_Type)) + and then Root_Type (Target_Index_Type) + /= Root_Type (Opnd_Index_Type) then Conversion_Error_N ("incompatible index types for array conversion", |