Commit 38b181d6 by Javier Miranda Committed by Arnaud Charlet

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
parent 99e81db6
......@@ -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;
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment