[Ada] Implement C++ ABI for dispatch tables on IA-64
Eric Botcazou
ebotcazou@adacore.com
Tue Apr 8 18:22:00 GMT 2008
Dispatch tables are the exact equivalent in Ada of virtual tables in C++.
GNAT already implements the C++ ABI when interfacing with C++, but on IA-64
it was lacking the support for descriptors in virtual tables as specified in
http://www.codesourcery.com/cxx-abi/abi.html#vtable
Technically this boils down to honoring TARGET_VTABLE_USES_DESCRIPTORS.
Tested on i586-suse-linux, applied on the mainline.
2008-04-08 Eric Botcazou <ebotcazou@adacore.com>
* gigi.h (standard_datatypes): Add ADT_fdesc_type and ADT_null_fdesc.
(fdesc_type_node): Define.
(null_fdesc_node): Likewise.
* decl.c (gnat_to_gnu_entity) <E_Access_Subprogram_Type>: If the target
uses descriptors for vtables and the type comes from a dispatch table,
return the descriptor type.
* trans.c (Attribute_to_gnu) <Attr_Unrestricted_Access>: If the target
uses descriptors for vtables and the type comes from a dispatch table,
build a descriptor in the static case and copy the existing one in the
non-static case.
(gnat_to_gnu) <N_Null>: If the target uses descriptors for vtables and
the type is a pointer-to-subprogram coming from a dispatch table,
return the null descriptor.
<N_Unchecked_Type_Conversion>: If the target uses descriptors for
vtables, the source type is the descriptor type and the target type is
a pointer type, first build the pointer.
* utils.c (init_gigi_decls): If the target uses descriptors for vtables
build the descriptor type and the null descriptor.
--
Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p.diff
Type: text/x-diff
Size: 6381 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20080408/9e0a9d33/attachment.bin>
More information about the Gcc-patches
mailing list