be defined. */
type_allocator alloc (gdbarch);
tdep->void_type = alloc.new_type (TYPE_CODE_VOID, TARGET_CHAR_BIT, "void");
- tdep->func_void_type = make_function_type (tdep->void_type);
+ tdep->func_void_type = lookup_function_type (tdep->void_type);
tdep->pc_type = init_pointer_type (alloc, 4 * TARGET_CHAR_BIT, NULL,
tdep->func_void_type);
be defined. */
type_allocator alloc (gdbarch);
void_type = alloc.new_type (TYPE_CODE_VOID, TARGET_CHAR_BIT, "void");
- func_void_type = make_function_type (void_type);
+ func_void_type = lookup_function_type (void_type);
tdep->pc_type = init_pointer_type (alloc, 4 * TARGET_CHAR_BIT, NULL,
func_void_type);
tdep->pc_type->set_instance_flags (tdep->pc_type->instance_flags ()
return lookup_reference_type (type, TYPE_CODE_RVALUE_REF);
}
-/* See gdbtypes.h. */
-
-type *
-make_function_type (type *return_type)
-{
- type *ntype = type_allocator (return_type).new_type ();
-
- ntype->set_target_type (return_type);
- ntype->set_length (1);
- ntype->set_code (TYPE_CODE_FUNC);
-
- INIT_FUNC_SPECIFIC (ntype);
-
- return ntype;
-}
-
/* Given a return type and argument types, create new function type.
If the final type in PARAM_TYPES is NULL, create a varargs function.
New type is allocated using ALLOC. */
static type *
create_function_type (type *return_type, int nparams, type **param_types)
{
- type *fn = make_function_type (return_type);
+ type *fn = type_allocator (return_type).new_type ();
+
+ fn->set_target_type (return_type);
+ fn->set_length (1);
+ fn->set_code (TYPE_CODE_FUNC);
+
+ INIT_FUNC_SPECIFIC (fn);
if (nparams > 0)
{
extern struct type *lookup_pointer_type (struct type *);
-/* Lookup a function type that returns type RETURN_TYPE. */
-
-extern struct type *make_function_type (type *return_type);
-
/* Create a new function type with return type RETURN_TYPE and unspecified
number and types of parameters.
type_allocator alloc (gdbarch);
tdep->void_type = alloc.new_type (TYPE_CODE_VOID, TARGET_CHAR_BIT,
"void");
- tdep->func_void_type = make_function_type (tdep->void_type);
+ tdep->func_void_type = lookup_function_type (tdep->void_type);
tdep->pc_type = init_pointer_type (alloc,
tdep->addr_length * TARGET_CHAR_BIT,
NULL, tdep->func_void_type);