aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier Miranda <miranda@adacore.com>2008-08-05 10:41:07 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2008-08-05 10:41:07 +0200
commit38b181d6c0e6db96732eec43f8ae31fd7f3e0c71 (patch)
tree4c97dda985e69784d7c7e9b9902793c994acaed6
parent99e81db6df93386ba6d1ed7c2e6d9f504c81cace (diff)
downloadgcc-38b181d6c0e6db96732eec43f8ae31fd7f3e0c71.zip
gcc-38b181d6c0e6db96732eec43f8ae31fd7f3e0c71.tar.gz
gcc-38b181d6c0e6db96732eec43f8ae31fd7f3e0c71.tar.bz2
sem_util.adb (Collect_Interfaces_Info): Minor reformating.
2008-08-05 Javier Miranda <miranda@adacore.com> * sem_util.adb (Collect_Interfaces_Info): Minor reformating. * exp_ch3.adb (Build_Offset_To_Top_Functions): Code cleanup: the implementation of this routine has been simplified. From-SVN: r138675
-rw-r--r--gcc/ada/exp_ch3.adb25
-rw-r--r--gcc/ada/sem_util.adb2
2 files changed, 11 insertions, 16 deletions
diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb
index e50ea04..b5fac5c 100644
--- a/gcc/ada/exp_ch3.adb
+++ b/gcc/ada/exp_ch3.adb
@@ -2122,13 +2122,9 @@ package body Exp_Ch3 is
-- Local variables
- Ifaces_List : Elist_Id;
Ifaces_Comp_List : Elist_Id;
- Ifaces_Tag_List : Elist_Id;
- Iface_Elmt : Elmt_Id;
- Comp_Elmt : Elmt_Id;
-
- pragma Warnings (Off, Ifaces_Tag_List);
+ Iface_Comp_Elmt : Elmt_Id;
+ Iface_Comp : Node_Id;
-- Start of processing for Build_Offset_To_Top_Functions
@@ -2146,26 +2142,25 @@ package body Exp_Ch3 is
return;
end if;
- Collect_Interfaces_Info
- (Rec_Type, Ifaces_List, Ifaces_Comp_List, Ifaces_Tag_List);
+ Collect_Interface_Components (Rec_Type, Ifaces_Comp_List);
-- For each interface type with secondary dispatch table we generate
-- the Offset_To_Top_Functions (required to displace the pointer in
-- interface conversions)
- Iface_Elmt := First_Elmt (Ifaces_List);
- Comp_Elmt := First_Elmt (Ifaces_Comp_List);
- while Present (Iface_Elmt) loop
+ Iface_Comp_Elmt := First_Elmt (Ifaces_Comp_List);
+ while Present (Iface_Comp_Elmt) loop
+ Iface_Comp := Node (Iface_Comp_Elmt);
+ pragma Assert (Is_Interface (Related_Type (Iface_Comp)));
-- If the interface is a parent of Rec_Type it shares the primary
-- dispatch table and hence there is no need to build the function
- if not Is_Ancestor (Node (Iface_Elmt), Rec_Type) then
- Build_Offset_To_Top_Function (Iface_Comp => Node (Comp_Elmt));
+ if not Is_Ancestor (Related_Type (Iface_Comp), Rec_Type) then
+ Build_Offset_To_Top_Function (Iface_Comp);
end if;
- Next_Elmt (Iface_Elmt);
- Next_Elmt (Comp_Elmt);
+ Next_Elmt (Iface_Comp_Elmt);
end loop;
end Build_Offset_To_Top_Functions;
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index e8823b6..96e24a4 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -1447,7 +1447,7 @@ package body Sem_Util is
-- Start of processing for Collect_Interfaces_Info
begin
- Collect_Interfaces (T, Ifaces_List);
+ Collect_Interfaces (T, Ifaces_List);
Collect_Interface_Components (T, Comps_List);
-- Search for the record component and tag associated with each