Skip to content
This repository has been archived by the owner on Jun 20, 2019. It is now read-only.

Aarch64 vaarg #612

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions gcc/d/d-target.def
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,29 @@ DEFHOOK
unsigned, (void),
hook_uint_void_0)

/* The types of extra fields to store in TypeInfo for va_arg implementation. */
DEFHOOK
(d_vaarg_ti_types,
"Returns types of target-specific fields which need to be inserted into\
TypeInfo to support the va_arg variant taking a TypeInfo argument.\
The va_arg imlementation can be found in core/stdc/stdarg.d. This function's\
first parameter is a @code{tinfo_kind} as fields can be differnt depending\
on the kind of TypeInfo. Returns a @code{TREE_LIST} of types and void_zero_node\
if no extra fields are needed.",
tree, (d_tinfo_kind),
d_default_vaarg_ti_types)

/* The initializer values of extra fields to store in TypeInfo. */
DEFHOOK
(d_vaarg_ti_values,
"Returns initial values for target-specific fields which need to be inserted\
into TypeInfo to support the va_arg variant taking a TypeInfo argument.\
The va_arg imlementation can be found in core/stdc/stdarg.d. This function's\
first parameter is a @code{tree} for the type described by the TypeInfo\
instance. Returns a @code{TREE_LIST} of initial values and NULL_TREE\
if no extra fields are needed.",
tree, (d_tinfo_kind, tree),
d_default_vaarg_ti_values)

/* Close the 'struct gcc_targetdm' definition. */
HOOK_VECTOR_END (C90_EMPTY_HACK)
30 changes: 30 additions & 0 deletions gcc/d/d-target.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,30 @@
#ifndef GCC_D_TARGET_H
#define GCC_D_TARGET_H

/* Used by target as parameter for d_vaarg_ti_types */
enum d_tinfo_kind
{
D_TK_TYPEINFO_TYPE, /* object.TypeInfo */
D_TK_CLASSINFO_TYPE, /* object.TypeInfo_Class */
D_TK_INTERFACE_TYPE, /* object.TypeInfo_Interface */
D_TK_STRUCT_TYPE, /* object.TypeInfo_Struct */
D_TK_POINTER_TYPE, /* object.TypeInfo_Pointer */
D_TK_ARRAY_TYPE, /* object.TypeInfo_Array */
D_TK_STATICARRAY_TYPE, /* object.TypeInfo_StaticArray */
D_TK_ASSOCIATIVEARRAY_TYPE, /* object.TypeInfo_AssociativeArray */
D_TK_VECTOR_TYPE, /* object.TypeInfo_Vector */
D_TK_ENUMERAL_TYPE, /* object.TypeInfo_Enum */
D_TK_FUNCTION_TYPE, /* object.TypeInfo_Function */
D_TK_DELEGATE_TYPE, /* object.TypeInfo_Delegate */
D_TK_TYPELIST_TYPE, /* object.TypeInfo_Tuple */
D_TK_CONST_TYPE, /* object.TypeInfo_Const */
D_TK_IMMUTABLE_TYPE, /* object.TypeInfo_Invariant */
D_TK_SHARED_TYPE, /* object.TypeInfo_Shared */
D_TK_INOUT_TYPE, /* object.TypeInfo_Inout */
D_TK_CPPTI_TYPE, /* object.__cpp_type_info_ptr */
D_TK_END,
};

#define DEFHOOKPOD(NAME, DOC, TYPE, INIT) TYPE NAME;
#define DEFHOOK(NAME, DOC, TYPE, PARAMS, INIT) TYPE (* NAME) PARAMS;
#define DEFHOOK_UNDOC DEFHOOK
Expand All @@ -31,4 +55,10 @@ extern struct gcc_targetdm targetdm;
/* Used by target to add predefined version idenditiers. */
extern void d_add_builtin_version (const char *);

/* default implementation for d_vaarg_ti_types */
extern tree d_default_vaarg_ti_types (d_tinfo_kind);

/* default implementation for d_vaarg_ti_values */
extern tree d_default_vaarg_ti_values (d_tinfo_kind, tree);

#endif /* GCC_D_TARGET_H */
Loading