mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-27 09:38:57 +00:00
Move allocate_stub_method to stabsread.c
allocate_stub_method is only called from stabsread.c, and I don't think it will be needed anywhere else. So, move it and make it static. Tested by rebuilding.
This commit is contained in:
@@ -861,26 +861,6 @@ lookup_methodptr_type (struct type *to_type)
|
||||
return mtype;
|
||||
}
|
||||
|
||||
/* Allocate a stub method whose return type is TYPE. This apparently
|
||||
happens for speed of symbol reading, since parsing out the
|
||||
arguments to the method is cpu-intensive, the way we are doing it.
|
||||
So, we will fill in arguments later. This always returns a fresh
|
||||
type. */
|
||||
|
||||
struct type *
|
||||
allocate_stub_method (struct type *type)
|
||||
{
|
||||
struct type *mtype;
|
||||
|
||||
mtype = alloc_type_copy (type);
|
||||
mtype->set_code (TYPE_CODE_METHOD);
|
||||
mtype->set_length (1);
|
||||
mtype->set_is_stub (true);
|
||||
mtype->set_target_type (type);
|
||||
/* TYPE_SELF_TYPE (mtype) = unknown yet */
|
||||
return mtype;
|
||||
}
|
||||
|
||||
/* See gdbtypes.h. */
|
||||
|
||||
bool
|
||||
|
||||
@@ -2312,8 +2312,6 @@ extern void smash_to_memberptr_type (struct type *, struct type *,
|
||||
|
||||
extern void smash_to_methodptr_type (struct type *, struct type *);
|
||||
|
||||
extern struct type *allocate_stub_method (struct type *);
|
||||
|
||||
extern const char *type_name_or_error (struct type *type);
|
||||
|
||||
struct struct_elt
|
||||
|
||||
@@ -1464,6 +1464,26 @@ error_type (const char **pp, struct objfile *objfile)
|
||||
}
|
||||
|
||||
|
||||
/* Allocate a stub method whose return type is TYPE. This apparently
|
||||
happens for speed of symbol reading, since parsing out the
|
||||
arguments to the method is cpu-intensive, the way we are doing it.
|
||||
So, we will fill in arguments later. This always returns a fresh
|
||||
type. */
|
||||
|
||||
static struct type *
|
||||
allocate_stub_method (struct type *type)
|
||||
{
|
||||
struct type *mtype;
|
||||
|
||||
mtype = alloc_type_copy (type);
|
||||
mtype->set_code (TYPE_CODE_METHOD);
|
||||
mtype->set_length (1);
|
||||
mtype->set_is_stub (true);
|
||||
mtype->set_target_type (type);
|
||||
/* TYPE_SELF_TYPE (mtype) = unknown yet */
|
||||
return mtype;
|
||||
}
|
||||
|
||||
/* Read type information or a type definition; return the type. Even
|
||||
though this routine accepts either type information or a type
|
||||
definition, the distinction is relevant--some parts of stabsread.c
|
||||
|
||||
Reference in New Issue
Block a user