aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/decl.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2008-04-08 18:12:53 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2008-04-08 18:12:53 +0000
commit581edf9260bddd3f0ce13e2f2b6758f6f638b22c (patch)
treee042a3438f9aaea3565ebd713196dfa9f19c8e53 /gcc/ada/decl.c
parent57b9e36755f9459bcb6b6699b12b150037a5adb4 (diff)
downloadgcc-581edf9260bddd3f0ce13e2f2b6758f6f638b22c.zip
gcc-581edf9260bddd3f0ce13e2f2b6758f6f638b22c.tar.gz
gcc-581edf9260bddd3f0ce13e2f2b6758f6f638b22c.tar.bz2
gigi.h (standard_datatypes): Add ADT_fdesc_type and ADT_null_fdesc.
* 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. From-SVN: r134101
Diffstat (limited to 'gcc/ada/decl.c')
-rw-r--r--gcc/ada/decl.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/ada/decl.c b/gcc/ada/decl.c
index 545730b..aca69ff 100644
--- a/gcc/ada/decl.c
+++ b/gcc/ada/decl.c
@@ -3089,6 +3089,22 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
break;
case E_Access_Subprogram_Type:
+ /* Use the special descriptor type for dispatch tables if needed,
+ that is to say for the Prim_Ptr of a-tags.ads and its clones.
+ Note that we are only required to do so for static tables in
+ order to be compatible with the C++ ABI, but Ada 2005 allows
+ to extend library level tagged types at the local level so
+ we do it in the non-static case as well. */
+ if (TARGET_VTABLE_USES_DESCRIPTORS
+ && Is_Dispatch_Table_Entity (gnat_entity))
+ {
+ gnu_type = fdesc_type_node;
+ gnu_size = TYPE_SIZE (gnu_type);
+ break;
+ }
+
+ /* ... fall through ... */
+
case E_Anonymous_Access_Subprogram_Type:
/* If we are not defining this entity, and we have incomplete
entities being processed above us, make a dummy type and