aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@adacore.com>2015-10-23 10:25:57 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2015-10-23 12:25:57 +0200
commit2e885093958b6f2d8383c929cd662cae87fe11fe (patch)
treed8cd8516aa31ea64927709516ce6f8d6743656e8 /gcc
parent67dbe5829e2f9cac9deb756762cdaf5a8829cb31 (diff)
downloadgcc-2e885093958b6f2d8383c929cd662cae87fe11fe.zip
gcc-2e885093958b6f2d8383c929cd662cae87fe11fe.tar.gz
gcc-2e885093958b6f2d8383c929cd662cae87fe11fe.tar.bz2
sem_util.ads (Unique_Defining_Entity): Document the result for tasks and entries.
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 From-SVN: r229222
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog7
-rw-r--r--gcc/ada/sem_util.adb26
-rw-r--r--gcc/ada/sem_util.ads2
3 files changed, 35 insertions, 0 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index d998788..513f3af 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,10 @@
+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
+
2015-10-22 Mikhail Maltsev <maltsevm@gmail.com>
* gcc-interface/decl.c (gnat_to_gnu_entity): Use gcc_checking_assert.
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index 384221e..f6c3ebd 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;
diff --git a/gcc/ada/sem_util.ads b/gcc/ada/sem_util.ads
index c0bf234..9d77c7f 100644
--- a/gcc/ada/sem_util.ads
+++ b/gcc/ada/sem_util.ads
@@ -2105,6 +2105,8 @@ package Sem_Util is
-- views of the same entity have the same unique defining entity:
-- * package spec and body;
-- * subprogram declaration, subprogram stub and subprogram body;
+ -- * entry declaration and entry body;
+ -- * task declaration, task body stub and task body;
-- * private view and full view of a type;
-- * private view and full view of a deferred constant.
-- In other cases, return the defining entity for N.