summaryrefslogtreecommitdiff
path: root/gcc/ada/sem_util.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2015-10-23 10:25:57 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2015-10-23 10:25:57 +0000
commit9d568ab5d2025b341f93f1fc30f19a8f19f3967c (patch)
treed8cd8516aa31ea64927709516ce6f8d6743656e8 /gcc/ada/sem_util.adb
parent6f5f406ae8357720cb5eb8edfcae580d4518b307 (diff)
downloadgcc-9d568ab5d2025b341f93f1fc30f19a8f19f3967c.tar.gz
2015-10-23 Arnaud Charlet <charlet@adacore.com>
* sem_util.ads (Unique_Defining_Entity): Document the result for tasks and entries. * sem_util.adb (Unique_Entity): Return declaration entity for task and entry bodies git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229222 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_util.adb')
-rw-r--r--gcc/ada/sem_util.adb26
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index 384221e32db..f6c3ebd2f31 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -19082,6 +19082,32 @@ package body Sem_Util is
U := Spec_Entity (E);
end if;
+ when E_Task_Body =>
+ P := Parent (E);
+ U := Corresponding_Spec (P);
+
+ when E_Entry =>
+ if Nkind (Parent (E)) = N_Entry_Body then
+ declare
+ Decl : Entity_Id := First_Entity (Scope (E));
+ begin
+ -- Traverse the entity list of the protected object
+ -- and locate an entry declaration with a matching
+ -- Corresponding_Body.
+
+ while Present (Decl) loop
+ if Ekind (Decl) = E_Entry
+ and then Corresponding_Body (Parent (Decl)) = E
+ then
+ U := Decl;
+ exit;
+ end if;
+ Next_Entity (Decl);
+ end loop;
+ pragma Assert (Present (Decl));
+ end;
+ end if;
+
when others =>
null;
end case;