aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2read.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2002-06-14 14:34:26 +0000
committerDaniel Jacobowitz <drow@false.org>2002-06-14 14:34:26 +0000
commitad2f7632f9c475a71481499715635ea3344b92d8 (patch)
treeaa8e35f419210ddb891abff35d75ba48372d15dd /gdb/dwarf2read.c
parentecb4347adecd566f59016dea61f1b9425ae83b43 (diff)
downloadgdb-ad2f7632f9c475a71481499715635ea3344b92d8.zip
gdb-ad2f7632f9c475a71481499715635ea3344b92d8.tar.gz
gdb-ad2f7632f9c475a71481499715635ea3344b92d8.tar.bz2
2002-06-14 Daniel Jacobowitz <drow@mvista.com>
* gdbtypes.h (TYPE_FLAG_VARARGS): Update comment. (struct main_type): Remove arg_types member. Update comments for struct field. (TYPE_ARG_TYPES): Remove. (TYPE_FN_FIELD_ARGS): Update. (smash_to_method_type): Update prototype. * c-typeprint.c (cp_type_print_method_args): Take method type instead of argument list. Use new argument layout. Simplify. (c_type_print_args): Use new argument layout. Simplify. (c_type_print_base): Update call to cp_type_print_method_args. * dwarf2read.c (dwarf2_add_member_fn): Remove unneeded type argument; use die->type instead. Update call to smash_to_method_type. (read_structure_scope): Update call to dwarf2_add_member_fn. * gdbtypes.c (allocate_stub_method): Update comment. (smash_to_method_type): Take new NARGS and VARARGS arguments. Use new argument layout. (check_stub_method): Use new argument layout. Don't count void as an argument. (print_arg_types): Update comments. Use new argument layout. (recursive_dump_type): Don't print arg_types member. * hpread.c (hpread_read_struct_type): Use new argument layout. (fixup_class_method_type): Likewise. (hpread_type_lookup): Likewise. * stabsread.c (read_type): Update calls to read_args and smash_to_method_type. (read_args): Use new argument layout. Simplify. * valops.c (typecmp): Use new argument layout. Update parameters and comments. Simplify. (hand_function_call): Use new argument layout. (search_struct_method): Update call to typecmp. (find_overload_match): Use new argument layout.
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r--gdb/dwarf2read.c27
1 files changed, 8 insertions, 19 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 6c2b542..9fa8fb3 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -799,8 +799,7 @@ static void dwarf2_attach_fields_to_type (struct field_info *,
struct type *, struct objfile *);
static void dwarf2_add_member_fn (struct field_info *,
- struct die_info *, struct type *,
- struct objfile *objfile,
+ struct die_info *, struct objfile *objfile,
const struct comp_unit_head *);
static void dwarf2_attach_fn_fields_to_type (struct field_info *,
@@ -2233,7 +2232,7 @@ dwarf2_attach_fields_to_type (struct field_info *fip, struct type *type,
static void
dwarf2_add_member_fn (struct field_info *fip, struct die_info *die,
- struct type *type, struct objfile *objfile,
+ struct objfile *objfile,
const struct comp_unit_head *cu_header)
{
struct attribute *attr;
@@ -2299,23 +2298,13 @@ dwarf2_add_member_fn (struct field_info *fip, struct die_info *die,
if (die->type && TYPE_CODE (die->type) == TYPE_CODE_FUNC)
{
struct type *return_type = TYPE_TARGET_TYPE (die->type);
- struct type **arg_types;
int nparams = TYPE_NFIELDS (die->type);
- int iparams;
- /* Copy argument types from the subroutine type. */
- arg_types = (struct type **)
- TYPE_ALLOC (fnp->type, (nparams + 1) * sizeof (struct type *));
- for (iparams = 0; iparams < nparams; iparams++)
- arg_types[iparams] = TYPE_FIELD_TYPE (die->type, iparams);
-
- /* Set last entry in argument type vector. */
- if (TYPE_VARARGS (die->type))
- arg_types[nparams] = NULL;
- else
- arg_types[nparams] = dwarf2_fundamental_type (objfile, FT_VOID);
-
- smash_to_method_type (fnp->type, type, return_type, arg_types);
+ smash_to_method_type (fnp->type, die->type,
+ TYPE_TARGET_TYPE (die->type),
+ TYPE_FIELDS (die->type),
+ TYPE_NFIELDS (die->type),
+ TYPE_VARARGS (die->type));
/* Handle static member functions.
Dwarf2 has no clean way to discern C++ static and non-static
@@ -2485,7 +2474,7 @@ read_structure_scope (struct die_info *die, struct objfile *objfile,
{
/* C++ member function. */
process_die (child_die, objfile, cu_header);
- dwarf2_add_member_fn (&fi, child_die, type, objfile, cu_header);
+ dwarf2_add_member_fn (&fi, child_die, objfile, cu_header);
}
else if (child_die->tag == DW_TAG_inheritance)
{