]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
sem_util.adb (Collect_Interfaces_Info): Minor reformating.
authorJavier Miranda <miranda@adacore.com>
Tue, 5 Aug 2008 08:41:07 +0000 (10:41 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Tue, 5 Aug 2008 08:41:07 +0000 (10:41 +0200)
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

gcc/ada/exp_ch3.adb
gcc/ada/sem_util.adb

index e50ea0487b2b43c2436160a6c4139b7a2201d041..b5fac5c8594d3b5ff8afad4141dd4ea3ad2f5ca2 100644 (file)
@@ -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;
 
index e8823b6164fa32a76398f28564d4426bb7d443b5..96e24a4c994aa27cc04f514c5ef5ac28c123eca3 100644 (file)
@@ -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