+2019-12-13 Ed Schonberg <schonberg@adacore.com>
+
+ * sinfo.ads, sinfo.adb (Aspect_On_Partial_View,
+ Set_Aspect_On_Partial_View): New flag for use by SPARK, to
+ indicate whether an aspect that appears on a type declaration
+ applies to the partial view of that type.
+ * sem_ch13.adb (Analyze_Aspect_Specification): Set new flag
+ appropriately.
+
2019-12-12 Ed Schonberg <schonberg@adacore.com>
* sem_ch13.adb (Same_Reprewentation): if the actual in a call is
Set_From_Aspect_Specification (Aitem);
end if;
+ -- For an aspect that applies to a type, indicate whether it
+ -- appears on a partial view of the type.
+
+ if Is_Type (E)
+ and then Is_Private_Type (E)
+ then
+ Set_Aspect_On_Partial_View (Aspect);
+ end if;
+
-- In the context of a compilation unit, we directly put the
-- pragma in the Pragmas_After list of the N_Compilation_Unit_Aux
-- node (no delay is required here) except for aspects on a
return Node3 (N);
end Array_Aggregate;
+ function Aspect_On_Partial_View
+ (N : Node_Id) return Boolean is
+ begin
+ pragma Assert (False
+ or else NT (N).Nkind = N_Aspect_Specification);
+ return Flag18 (N);
+ end Aspect_On_Partial_View;
+
function Aspect_Rep_Item
(N : Node_Id) return Node_Id is
begin
Set_Node3_With_Parent (N, Val);
end Set_Array_Aggregate;
+ procedure Set_Aspect_On_Partial_View
+ (N : Node_Id; Val : Boolean := True) is
+ begin
+ pragma Assert (False
+ or else NT (N).Nkind = N_Aspect_Specification);
+ Set_Flag18 (N, Val);
+ end Set_Aspect_On_Partial_View;
+
procedure Set_Aspect_Rep_Item
(N : Node_Id; Val : Node_Id) is
begin
-- is used for translation of the at end handler into a normal exception
-- handler.
+ -- Aspect_On_Partial_View (Flag18)
+ -- Present on an N_Aspect_Specification node. For an aspect that applies
+ -- to a type entity, indicates whether the specification appears on the
+ -- partial view of a private type or extension. Undefined for aspects
+ -- that apply to other entities.
+
-- Aspect_Rep_Item (Node2-Sem)
-- Present in N_Aspect_Specification nodes. Points to the corresponding
-- pragma/attribute definition node used to process the aspect.
-- Is_Disabled (Flag15-Sem)
-- Is_Boolean_Aspect (Flag16-Sem)
-- Split_PPC (Flag17) Set if split pre/post attribute
+ -- Aspect_On_Partial_View (Flag18-Sem)
-- Note: Aspect_Specification is an Ada 2012 feature
function Array_Aggregate
(N : Node_Id) return Node_Id; -- Node3
+ function Aspect_On_Partial_View
+ (N : Node_Id) return Boolean; -- Flag18
+
function Aspect_Rep_Item
(N : Node_Id) return Node_Id; -- Node2
procedure Set_Array_Aggregate
(N : Node_Id; Val : Node_Id); -- Node3
+ procedure Set_Aspect_On_Partial_View
+ (N : Node_Id; Val : Boolean := True); -- Flag18
+
procedure Set_Aspect_Rep_Item
(N : Node_Id; Val : Node_Id); -- Node2
pragma Inline (Ancestor_Part);
pragma Inline (Atomic_Sync_Required);
pragma Inline (Array_Aggregate);
+ pragma Inline (Aspect_On_Partial_View);
pragma Inline (Aspect_Rep_Item);
pragma Inline (Assignment_OK);
pragma Inline (Associated_Node);
pragma Inline (Set_Alternatives);
pragma Inline (Set_Ancestor_Part);
pragma Inline (Set_Array_Aggregate);
+ pragma Inline (Set_Aspect_On_Partial_View);
pragma Inline (Set_Aspect_Rep_Item);
pragma Inline (Set_Assignment_OK);
pragma Inline (Set_Associated_Node);