]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Simplify rewriting of attributes into Boolean literals
authorPiotr Trojanek <trojanek@adacore.com>
Tue, 11 Jan 2022 19:41:13 +0000 (20:41 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Tue, 12 Jul 2022 12:24:13 +0000 (12:24 +0000)
Code cleanup; semantics is unaffected.

gcc/ada/

* sem_attr.adb (Set_Boolean_Result): Simplify using
Boolean_Literals.

gcc/ada/sem_attr.adb

index cab2461a39c9f223c78a9e2f13474d0cec116547..adeda43bd8763cfe3d9064b1c112f54eebcd2ee3 100644 (file)
@@ -12778,13 +12778,8 @@ package body Sem_Attr is
    ------------------------
 
    procedure Set_Boolean_Result (N : Node_Id; B : Boolean) is
-      Loc : constant Source_Ptr := Sloc (N);
    begin
-      if B then
-         Rewrite (N, New_Occurrence_Of (Standard_True, Loc));
-      else
-         Rewrite (N, New_Occurrence_Of (Standard_False, Loc));
-      end if;
+      Rewrite (N, New_Occurrence_Of (Boolean_Literals (B), Sloc (N)));
    end Set_Boolean_Result;
 
    --------------------------------