Commit ee7c961d by Piotr Trojanek Committed by Pierre-Marie de Rodat

[Ada] A new utility routine for detecting attribute 'Old

Add a utility routine for detecting attribute 'Old. It will be
immediately reused in the GNATprove backend.

2019-09-17  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

	* sem_util.ads, sem_util.adb (Is_Attribute_Old): New utility
	routine.

From-SVN: r275780
parent cbb0b553
2019-09-17 Piotr Trojanek <trojanek@adacore.com>
* sem_util.ads, sem_util.adb (Is_Attribute_Old): New utility
routine.
2019-09-17 Yannick Moy <moy@adacore.com>
* inline.adb (Can_Be_Inlined_In_GNATprove_Mode): Add handling
......
......@@ -13559,6 +13559,16 @@ package body Sem_Util is
Is_Volatile_Full_Access (Etype (Entity (N)))));
end Is_Atomic_Or_VFA_Object;
----------------------
-- Is_Attribute_Old --
----------------------
function Is_Attribute_Old (N : Node_Id) return Boolean is
begin
return Nkind (N) = N_Attribute_Reference
and then Attribute_Name (N) = Name_Old;
end Is_Attribute_Old;
-------------------------
-- Is_Attribute_Result --
-------------------------
......
......@@ -1549,6 +1549,9 @@ package Sem_Util is
-- Determine whether arbitrary node N denotes a reference to an object
-- which is either atomic or Volatile_Full_Access.
function Is_Attribute_Old (N : Node_Id) return Boolean;
-- Determine whether node N denotes attribute 'Old
function Is_Attribute_Result (N : Node_Id) return Boolean;
-- Determine whether node N denotes attribute 'Result
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment