[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 b48aeb47739f608fa12d875ffd8f2606ba60e723..1327d31c0c97b4e9a162c359ce8ca1fe09547c67 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 1ffe513e9a4c7010eb17caa53bda08141aab6be3..b093808113a173cbbb25ba249a46ce48b8b799af 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