public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-6445] [Ada] Code cleanups
@ 2022-01-11 13:26 Pierre-Marie de Rodat
0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2022-01-11 13:26 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:f9cdce4a71a4ea04d9669631cfd951fbd70d5b7c
commit r12-6445-gf9cdce4a71a4ea04d9669631cfd951fbd70d5b7c
Author: Arnaud Charlet <charlet@adacore.com>
Date: Mon Jan 3 10:12:57 2022 +0000
[Ada] Code cleanups
gcc/ada/
* exp_ch9.adb, gen_il-types.ads, make.adb, par-ch12.adb,
sem_ch13.adb: Use membership tests.
Diff:
---
gcc/ada/exp_ch9.adb | 2 +-
gcc/ada/gen_il-types.ads | 3 +--
gcc/ada/make.adb | 2 +-
gcc/ada/par-ch12.adb | 2 +-
gcc/ada/sem_ch13.adb | 5 ++---
5 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/gcc/ada/exp_ch9.adb b/gcc/ada/exp_ch9.adb
index 63f8b7c2e08..81f4d7c3b5a 100644
--- a/gcc/ada/exp_ch9.adb
+++ b/gcc/ada/exp_ch9.adb
@@ -4394,7 +4394,7 @@ package body Exp_Ch9 is
-- It would be better to encapsulate this as a routine in Exp_Dbug ???
if Append_Char /= ' ' then
- if Append_Char = 'P' or Append_Char = 'N' then
+ if Append_Char in 'P' | 'N' then
Add_Char_To_Name_Buffer (Append_Char);
return Name_Find;
else
diff --git a/gcc/ada/gen_il-types.ads b/gcc/ada/gen_il-types.ads
index 634713764c3..ca85ecf384c 100644
--- a/gcc/ada/gen_il-types.ads
+++ b/gcc/ada/gen_il-types.ads
@@ -577,8 +577,7 @@ package Gen_IL.Types is
| N_Defining_Operator_Symbol;
subtype Opt_Abstract_Type is Opt_Type_Enum with
- Predicate => Opt_Abstract_Type = No_Type or
- Opt_Abstract_Type in Abstract_Type;
+ Predicate => Opt_Abstract_Type in No_Type | Abstract_Type;
subtype Type_Boundaries is Type_Enum with
Predicate => Type_Boundaries in
diff --git a/gcc/ada/make.adb b/gcc/ada/make.adb
index 2d4e0511e57..bbabd76c211 100644
--- a/gcc/ada/make.adb
+++ b/gcc/ada/make.adb
@@ -3765,7 +3765,7 @@ package body Make is
declare
Arg : constant String := Argument (J);
begin
- if Arg = "-cargs" or Arg = "-bargs" or Arg = "-largs" then
+ if Arg in "-cargs" | "-bargs" | "-largs" then
In_Gnatmake_Switches := False;
elsif Arg = "-margs" then
diff --git a/gcc/ada/par-ch12.adb b/gcc/ada/par-ch12.adb
index dc34aa0f9a7..991e93f3d10 100644
--- a/gcc/ada/par-ch12.adb
+++ b/gcc/ada/par-ch12.adb
@@ -184,7 +184,7 @@ package body Ch12 is
if Token = Tok_Package then
Append (P_Formal_Package_Declaration, Decls);
- elsif Token = Tok_Procedure or Token = Tok_Function then
+ elsif Token in Tok_Procedure | Tok_Function then
Append (P_Formal_Subprogram_Declaration, Decls);
else
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
index 02dd87cbde7..1577b9b2eb7 100644
--- a/gcc/ada/sem_ch13.adb
+++ b/gcc/ada/sem_ch13.adb
@@ -17125,9 +17125,8 @@ package body Sem_Ch13 is
procedure Validate_Literal_Aspect (Typ : Entity_Id; ASN : Node_Id) is
A_Id : constant Aspect_Id := Get_Aspect_Id (ASN);
- pragma Assert ((A_Id = Aspect_Integer_Literal) or
- (A_Id = Aspect_Real_Literal) or
- (A_Id = Aspect_String_Literal));
+ pragma Assert (A_Id in Aspect_Integer_Literal |
+ Aspect_Real_Literal | Aspect_String_Literal);
Func_Name : constant Node_Id := Expression (ASN);
Overloaded : Boolean := Is_Overloaded (Func_Name);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-01-11 13:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-11 13:26 [gcc r12-6445] [Ada] Code cleanups Pierre-Marie de Rodat
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).