Commit 872fc7b5 by Gary Dismukes Committed by Arnaud Charlet

sem_prag.adb: Minor reformatting.

2017-01-12  Gary Dismukes  <dismukes@adacore.com>

	* sem_prag.adb: Minor reformatting.
	* sem_util.adb (Unique_Entity): fix result for
	bodies of entry families.

From-SVN: r244363
parent 00420f74
2017-01-12 Gary Dismukes <dismukes@adacore.com>
* sem_prag.adb: Minor reformatting.
* sem_util.adb (Unique_Entity): fix result for
bodies of entry families.
2017-01-12 Justin Squirek <squirek@adacore.com> 2017-01-12 Justin Squirek <squirek@adacore.com>
* sem_prag.adb (Analyze_Pragma): Add appropriate calls to * sem_prag.adb (Analyze_Pragma): Add appropriate calls to
......
...@@ -3296,7 +3296,7 @@ package body Sem_Prag is ...@@ -3296,7 +3296,7 @@ package body Sem_Prag is
elsif Ekind (Item_Id) = E_Constant then elsif Ekind (Item_Id) = E_Constant then
Error_Msg_Name_1 := Chars (Encap_Id); Error_Msg_Name_1 := Chars (Encap_Id);
SPARK_Msg_NE SPARK_Msg_NE
(Fix_Msg (Encap_Typ, "consant & cannot act as constituent of " (Fix_Msg (Encap_Typ, "constant & cannot act as constituent of "
& "single protected type %"), Indic, Item_Id); & "single protected type %"), Indic, Item_Id);
-- The constituent is a package instantiation -- The constituent is a package instantiation
...@@ -11831,7 +11831,7 @@ package body Sem_Prag is ...@@ -11831,7 +11831,7 @@ package body Sem_Prag is
procedure Resolve_Suppressible (Policy : Node_Id); procedure Resolve_Suppressible (Policy : Node_Id);
-- Converts the assertion policy 'Suppressible' to either Check or -- Converts the assertion policy 'Suppressible' to either Check or
-- ignore based on whether checks are suppressed via -gnatp or ??? -- Ignore based on whether checks are suppressed via -gnatp or ???
-------------------------- --------------------------
-- Resolve_Suppressible -- -- Resolve_Suppressible --
...@@ -20658,14 +20658,25 @@ package body Sem_Util is ...@@ -20658,14 +20658,25 @@ package body Sem_Util is
when Entry_Kind => when Entry_Kind =>
if Nkind (Parent (E)) = N_Entry_Body then if Nkind (Parent (E)) = N_Entry_Body then
declare declare
Prot_Type : Entity_Id;
Prot_Item : Entity_Id; Prot_Item : Entity_Id;
begin begin
if Ekind (E) = E_Entry then
Prot_Type := Scope (E);
else
-- Bodies of entry families are nested within an extra
-- scope that contains an entry index declaration.
Prot_Type := Scope (Scope (E));
end if;
pragma Assert (Ekind (Prot_Type) = E_Protected_Type);
-- Traverse the entity list of the protected type and locate -- Traverse the entity list of the protected type and locate
-- an entry declaration which matches the entry body. -- an entry declaration which matches the entry body.
Prot_Item := First_Entity (Scope (E)); Prot_Item := First_Entity (Prot_Type);
while Present (Prot_Item) loop while Present (Prot_Item) loop
if Ekind (Prot_Item) = E_Entry if Ekind (Prot_Item) in Entry_Kind
and then Corresponding_Body (Parent (Prot_Item)) = E and then Corresponding_Body (Parent (Prot_Item)) = E
then then
U := Prot_Item; U := Prot_Item;
......
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