aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2019-10-12 14:51:26 +0000
committerEric Botcazou <ebotcazou@adacore.com>2019-10-12 14:51:26 +0000
commit6b439af409dd53b12b246dd73807c48d8607a1c7 (patch)
tree20ec9f33effd56b84831ba69236b68e5dae443a4
parentf3e563f74addb68d3a5bc9cfdcdce4c58456f33a (diff)
PR ada/91995
* sem_util.ads (Defining_Entity): Remove 2nd and 3th parameters. * sem_util.adb (Defining_Entity): Remove 2nd and 3th parameters, and adjust accordingly. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@276919 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ada/ChangeLog7
-rw-r--r--gcc/ada/sem_util.adb21
-rw-r--r--gcc/ada/sem_util.ads17
3 files changed, 13 insertions, 32 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 176a5c4bc40..14a5dbca52a 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,10 @@
+2019-10-12 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR ada/91995
+ * sem_util.ads (Defining_Entity): Remove 2nd and 3th parameters.
+ * sem_util.adb (Defining_Entity): Remove 2nd and 3th parameters,
+ and adjust accordingly.
+
2019-10-11 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (annotate_value) <INTEGER_CST>: Really test the
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index 1a7b6ab92af..d461692807e 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -5203,10 +5203,7 @@ package body Sem_Util is
-- Defining_Entity --
---------------------
- function Defining_Entity
- (N : Node_Id;
- Empty_On_Errors : Boolean := False) return Entity_Id
- is
+ function Defining_Entity (N : Node_Id) return Entity_Id is
Err : Entity_Id := Empty;
begin
@@ -5285,14 +5282,10 @@ package body Sem_Util is
-- can continue semantic analysis.
elsif Nam = Error then
- if Empty_On_Errors then
- return Empty;
- else
- Err := Make_Temporary (Sloc (N), 'T');
- Set_Defining_Unit_Name (N, Err);
+ Err := Make_Temporary (Sloc (N), 'T');
+ Set_Defining_Unit_Name (N, Err);
- return Err;
- end if;
+ return Err;
-- If not an entity, get defining identifier
@@ -5307,11 +5300,7 @@ package body Sem_Util is
return Entity (Identifier (N));
when others =>
- if Empty_On_Errors then
- return Empty;
- else
- raise Program_Error;
- end if;
+ raise Program_Error;
end case;
end Defining_Entity;
diff --git a/gcc/ada/sem_util.ads b/gcc/ada/sem_util.ads
index cfec762dcb3..5a33d467083 100644
--- a/gcc/ada/sem_util.ads
+++ b/gcc/ada/sem_util.ads
@@ -474,9 +474,7 @@ package Sem_Util is
-- in the case of a descendant of a generic formal type (returns Int'Last
-- instead of 0).
- function Defining_Entity
- (N : Node_Id;
- Empty_On_Errors : Boolean := False) return Entity_Id;
+ function Defining_Entity (N : Node_Id) return Entity_Id;
-- Given a declaration N, returns the associated defining entity. If the
-- declaration has a specification, the entity is obtained from the
-- specification. If the declaration has a defining unit name, then the
@@ -487,19 +485,6 @@ package Sem_Util is
-- local entities declared during loop expansion. These entities need
-- debugging information, generated through Qualify_Entity_Names, and
-- the loop declaration must be placed in the table Name_Qualify_Units.
- --
- -- Set flag Empty_On_Error to change the behavior of this routine as
- -- follows:
- --
- -- * True - A declaration that lacks a defining entity returns Empty.
- -- A node that does not allow for a defining entity returns Empty.
- --
- -- * False - A declaration that lacks a defining entity is given a new
- -- internally generated entity which is subsequently returned. A node
- -- that does not allow for a defining entity raises Program_Error.
- --
- -- The former semantics is appropriate for the back end; the latter
- -- semantics is appropriate for the front end.
function Denotes_Discriminant
(N : Node_Id;