[Ada] Simplify Is_Loop_Pragma

gcc/ada/

	* sem_prag.adb (Is_Loop_Pragma): Avoid repeated calls to
	Original_Node; remove unnecessary IF statement.
This commit is contained in:
Piotr Trojanek 2020-10-07 22:12:45 +02:00 committed by Pierre-Marie de Rodat
parent 428b1317a5
commit 45ce230785

View File

@ -6194,17 +6194,15 @@ package body Sem_Prag is
--------------------
function Is_Loop_Pragma (Stmt : Node_Id) return Boolean is
Original_Stmt : constant Node_Id := Original_Node (Stmt);
begin
-- Inspect the original node as Loop_Invariant and Loop_Variant
-- pragmas are rewritten to null when assertions are disabled.
if Nkind (Original_Node (Stmt)) = N_Pragma then
return
Pragma_Name_Unmapped (Original_Node (Stmt))
return Nkind (Original_Stmt) = N_Pragma
and then Pragma_Name_Unmapped (Original_Stmt)
in Name_Loop_Invariant | Name_Loop_Variant;
else
return False;
end if;
end Is_Loop_Pragma;
---------------------