diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-05 08:41:07 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-05 08:41:07 +0000 |
commit | c8ea8bcca4d40ef8c446ee17a1ac7506891c2c3b (patch) | |
tree | 4c97dda985e69784d7c7e9b9902793c994acaed6 /gcc | |
parent | 02aa7a86b804266986111a6a17c19d07a87f73b5 (diff) | |
download | gcc-c8ea8bcca4d40ef8c446ee17a1ac7506891c2c3b.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@138675 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/exp_ch3.adb | 25 | ||||
-rw-r--r-- | gcc/ada/sem_util.adb | 2 |
2 files changed, 11 insertions, 16 deletions
diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb index e50ea0487b2..b5fac5c8594 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 e8823b6164f..96e24a4c994 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 |