public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-5722] [Ada] More intuitive names in sanity-checking of derived types
@ 2021-12-02 16:28 Pierre-Marie de Rodat
0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2021-12-02 16:28 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:45be7610383af22b552ab7b2d0fa0e1d632c66f0
commit r12-5722-g45be7610383af22b552ab7b2d0fa0e1d632c66f0
Author: Piotr Trojanek <trojanek@adacore.com>
Date: Sun Nov 21 20:26:32 2021 +0100
[Ada] More intuitive names in sanity-checking of derived types
gcc/ada/
* sem_ch3.adb (Check_Derived_Type): Rename local variables; fix
style in comment.
Diff:
---
gcc/ada/sem_ch3.adb | 48 ++++++++++++++++++++++++------------------------
1 file changed, 24 insertions(+), 24 deletions(-)
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index edcc1ca26cb..02066e470c8 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -16369,12 +16369,12 @@ package body Sem_Ch3 is
------------------------
function Check_Derived_Type return Boolean is
- E : Entity_Id;
- Elmt : Elmt_Id;
- List : Elist_Id;
- New_Subp : Entity_Id;
- Op_Elmt : Elmt_Id;
- Subp : Entity_Id;
+ E : Entity_Id;
+ Derived_Elmt : Elmt_Id;
+ Derived_Op : Entity_Id;
+ Derived_Ops : Elist_Id;
+ Parent_Elmt : Elmt_Id;
+ Parent_Op : Entity_Id;
begin
-- Traverse list of entities in the current scope searching for
@@ -16389,7 +16389,7 @@ package body Sem_Ch3 is
-- Disable this test if Derived_Type completes an incomplete
-- type because in such case more primitives can be added
-- later to the list of primitives of Derived_Type by routine
- -- Process_Incomplete_Dependents
+ -- Process_Incomplete_Dependents.
return True;
end if;
@@ -16397,13 +16397,13 @@ package body Sem_Ch3 is
Next_Entity (E);
end loop;
- List := Collect_Primitive_Operations (Derived_Type);
- Elmt := First_Elmt (List);
+ Derived_Ops := Collect_Primitive_Operations (Derived_Type);
- Op_Elmt := First_Elmt (Op_List);
- while Present (Op_Elmt) loop
- Subp := Node (Op_Elmt);
- New_Subp := Node (Elmt);
+ Derived_Elmt := First_Elmt (Derived_Ops);
+ Parent_Elmt := First_Elmt (Op_List);
+ while Present (Parent_Elmt) loop
+ Parent_Op := Node (Parent_Elmt);
+ Derived_Op := Node (Derived_Elmt);
-- At this early stage Derived_Type has no entities with attribute
-- Interface_Alias. In addition, such primitives are always
@@ -16411,31 +16411,31 @@ package body Sem_Ch3 is
-- Therefore, if found we can safely stop processing pending
-- entities.
- exit when Present (Interface_Alias (Subp));
+ exit when Present (Interface_Alias (Parent_Op));
-- Handle hidden entities
- if not Is_Predefined_Dispatching_Operation (Subp)
- and then Is_Hidden (Subp)
+ if not Is_Predefined_Dispatching_Operation (Parent_Op)
+ and then Is_Hidden (Parent_Op)
then
- if Present (New_Subp)
- and then Primitive_Names_Match (Subp, New_Subp)
+ if Present (Derived_Op)
+ and then Primitive_Names_Match (Parent_Op, Derived_Op)
then
- Next_Elmt (Elmt);
+ Next_Elmt (Derived_Elmt);
end if;
else
- if not Present (New_Subp)
- or else Ekind (Subp) /= Ekind (New_Subp)
- or else not Primitive_Names_Match (Subp, New_Subp)
+ if No (Derived_Op)
+ or else Ekind (Parent_Op) /= Ekind (Derived_Op)
+ or else not Primitive_Names_Match (Parent_Op, Derived_Op)
then
return False;
end if;
- Next_Elmt (Elmt);
+ Next_Elmt (Derived_Elmt);
end if;
- Next_Elmt (Op_Elmt);
+ Next_Elmt (Parent_Elmt);
end loop;
return True;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-12-02 16:28 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-02 16:28 [gcc r12-5722] [Ada] More intuitive names in sanity-checking of derived types Pierre-Marie de Rodat
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).