2 -- { dg-options "-gnata -O2 -fno-inline" }
4 with Ada
.Unchecked_Conversion
;
6 package body Loop_Optimization2
is
8 function To_Addr_Ptr
is
9 new Ada
.Unchecked_Conversion
(System
.Address
, Addr_Ptr
);
11 function To_Address
is
12 new Ada
.Unchecked_Conversion
(Tag
, System
.Address
);
14 function To_Type_Specific_Data_Ptr
is
15 new Ada
.Unchecked_Conversion
(System
.Address
, Type_Specific_Data_Ptr
);
17 function Interface_Ancestor_Tags
(T
: Tag
) return Tag_Array
is
18 TSD_Ptr
: constant Addr_Ptr
:= To_Addr_Ptr
(To_Address
(T
));
19 TSD
: constant Type_Specific_Data_Ptr
:=
20 To_Type_Specific_Data_Ptr
(TSD_Ptr
.all);
21 Iface_Table
: constant Interface_Data_Ptr
:= TSD
.Interfaces_Table
;
23 if Iface_Table
= null then
25 Table
: Tag_Array
(1 .. 0);
31 Table
: Tag_Array
(1 .. Iface_Table
.Nb_Ifaces
);
33 for J
in 1 .. Iface_Table
.Nb_Ifaces
loop
34 Table
(J
) := Iface_Table
.Ifaces_Table
(J
).Iface_Tag
;
39 end Interface_Ancestor_Tags
;
41 end Loop_Optimization2
;