[Ada] Code cleanups
authorArnaud Charlet <charlet@adacore.com>
Mon, 3 Jan 2022 10:12:57 +0000 (10:12 +0000)
committerPierre-Marie de Rodat <derodat@adacore.com>
Tue, 11 Jan 2022 13:24:45 +0000 (13:24 +0000)
gcc/ada/

* exp_ch9.adb, gen_il-types.ads, make.adb, par-ch12.adb,
sem_ch13.adb: Use membership tests.

gcc/ada/exp_ch9.adb
gcc/ada/gen_il-types.ads
gcc/ada/make.adb
gcc/ada/par-ch12.adb
gcc/ada/sem_ch13.adb

index 63f8b7c..81f4d7c 100644 (file)
@@ -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
index 6347137..ca85ecf 100644 (file)
@@ -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
index 2d4e051..bbabd76 100644 (file)
@@ -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
index dc34aa0..991e93f 100644 (file)
@@ -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
index 02dd87c..1577b9b 100644 (file)
@@ -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);