]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[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 63f8b7c2e081aa46bb12c226c3fbc31a5f99a467..81f4d7c3b5af8f6910cfd2f396d05e3f3ca39be8 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 634713764c38253b42e7b6efd6fccfe4335bebc8..ca85ecf384c64b0cbb15728c159869230a361616 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 2d4e0511e574b349de8c4fd8547b3d3140b6beed..bbabd76c21189fe952a6cac77c589b4a6d80d526 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 dc34aa0f9a789aa71928b9d84b421458ca5a2363..991e93f3d102e1fae1230565a7ffdde81c5b1936 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 02dd87cbde7e569af588fec85750e01f326585ec..1577b9b2eb7e6fa0c7e33ec28260d9c60a2f3450 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);