[Ada] Simplify discarding nodes when processing aspect/pragma Priority
authorPiotr Trojanek <trojanek@adacore.com>
Tue, 24 Nov 2020 21:56:40 +0000 (22:56 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Tue, 15 Dec 2020 11:41:54 +0000 (06:41 -0500)
gcc/ada/

* sem_ch13.adb (Analyze_Aspect_Specifications): Simplify code
for aspect Priority.
* sem_prag.adb (Analyze_Pragma): Simplify code for pragma
Priority.

gcc/ada/sem_ch13.adb
gcc/ada/sem_prag.adb

index b48aeb4..1327d31 100644 (file)
@@ -3408,15 +3408,11 @@ package body Sem_Ch13 is
                      --  System.Tasking, but this package does not trigger the
                      --  required initialization of the run-time library.
 
-                     declare
-                        Discard : Entity_Id;
-                     begin
-                        if Restricted_Profile then
-                           Discard := RTE (RE_Activate_Restricted_Tasks);
-                        else
-                           Discard := RTE (RE_Activate_Tasks);
-                        end if;
-                     end;
+                     if Restricted_Profile then
+                        Discard_Node (RTE (RE_Activate_Restricted_Tasks));
+                     else
+                        Discard_Node (RTE (RE_Activate_Tasks));
+                     end if;
 
                      --  Handling for these aspects in subprograms is complete
 
index 1ffe513..b093808 100644 (file)
@@ -21364,16 +21364,11 @@ package body Sem_Prag is
                --  package does not trigger the required initialization of the
                --  run-time library.
 
-               declare
-                  Discard : Entity_Id;
-                  pragma Warnings (Off, Discard);
-               begin
-                  if Restricted_Profile then
-                     Discard := RTE (RE_Activate_Restricted_Tasks);
-                  else
-                     Discard := RTE (RE_Activate_Tasks);
-                  end if;
-               end;
+               if Restricted_Profile then
+                  Discard_Node (RTE (RE_Activate_Restricted_Tasks));
+               else
+                  Discard_Node (RTE (RE_Activate_Tasks));
+               end if;
 
             --  Task or Protected, must be of type Integer