This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] [4/5] Use DWARF-2 DW_AT_artificial information


Elena, did you ever get a chance to finish looking at this?

On Tue, Jan 15, 2002 at 03:31:57PM -0500, Daniel Jacobowitz wrote:
> This one's a bit larger than the others.  It also has a little more impact -
> it adds a word of memory per argument per method per class.  I don't think
> the storage is an issue right now, and some day I intend to go through and
> clean up our memory usage a little bit in places much more severe than this.
> 
> Other than that it's pretty straightforward.  OK to commit?
> 
> -- 
> Daniel Jacobowitz                           Carnegie Mellon University
> MontaVista Software                         Debian GNU/Linux Developer
> 
> 2002-01-15  Daniel Jacobowitz  <drow@mvista.com>
> 
> 	* gdbtypes.h (struct method_args): New.
> 	(struct type): Change arg_types to method_args.
> 	Change TYPE_ARG_TYPES to TYPE_METHOD_ARGS.  Add TYPE_ARG_TYPE,
> 	TYPE_FN_FIELD_ARG.
> 	(smash_to_method_type): Update prototype to accept struct
> 	method_args.
> 	* gdbtypes.c (smash_to_method_type): Update to use TYPE_METHOD_ARGS.
> 	(check_stub_method): Likewise.  Initialize method arguments
> 	to non-artificial.
> 	(print_arg_types): Update to accept struct method_args.  Print out
> 	new field ``artificial'' for each argument.
> 	(dump_fn_fieldlists): Fix indentation of type dumps.
> 	(recursive_dump_type): Update to use TYPE_METHOD_ARGS.
> 
> 	* dwarf2read.c (dwarf2_add_member_fn): Update to use struct
> 	method_args.  Preserve TYPE_FIELD_ARTIFICIAL.
> 	* stabsread.c (read_type): Update to use struct method_args.
> 	(read_args): Likewise.  Initialize artificial to 0.
> 	* valops.c (hand_function_call): Update to use struct method_args.
> 	(typecmp): Likewise.
> 	(find_overload_match): Update to use TYPE_FN_FIELD_ARG.
> 
> 	* c-typeprint.c (cp_type_print_method_args): Update to accept
> 	struct method_args.  Skip leading artificial arguments.
> 	(c_type_print_args): Likewise.
> 
> diff -urp src-p3/gdb/c-typeprint.c src-final/gdb/c-typeprint.c
> --- src-p3/gdb/c-typeprint.c	Tue Jan 15 14:38:27 2002
> +++ src-final/gdb/c-typeprint.c	Tue Jan 15 14:30:21 2002
> @@ -41,7 +41,7 @@
>  /* Flag indicating target was compiled by HP compiler */
>  extern int hp_som_som_object_present;
>  
> -static void cp_type_print_method_args (struct type ** args, char *prefix,
> +static void cp_type_print_method_args (struct method_args *args, char *prefix,
>  				       char *varstring, int staticp,
>  				       struct ui_file *stream);
>  
> @@ -150,26 +150,36 @@ cp_type_print_derivation_info (struct ui
>  /* Print the C++ method arguments ARGS to the file STREAM.  */
>  
>  static void
> -cp_type_print_method_args (struct type **args, char *prefix, char *varstring,
> -			   int staticp, struct ui_file *stream)
> +cp_type_print_method_args (struct method_args *args, char *prefix,
> +			   char *varstring, int staticp,
> +			   struct ui_file *stream)
>  {
> -  int i;
> +  struct method_args *curarg = NULL;
> +
> +  if (args != NULL)
> +    {
> +      /* Skip ``this'' and any leading artificial arguments.  */
> +      curarg = &args[!staticp];
> +      while (curarg->artificial)
> +	curarg++;
> +    }
>  
>    fprintf_symbol_filtered (stream, prefix, language_cplus, DMGL_ANSI);
>    fprintf_symbol_filtered (stream, varstring, language_cplus, DMGL_ANSI);
>    fputs_filtered ("(", stream);
> -  if (args && args[!staticp] && args[!staticp]->code != TYPE_CODE_VOID)
> +  if (curarg && curarg->type
> +      && curarg->type->code != TYPE_CODE_VOID)
>      {
> -      i = !staticp;		/* skip the class variable */
>        while (1)
>  	{
> -	  type_print (args[i++], "", stream, 0);
> -	  if (!args[i])
> +	  type_print (curarg->type, "", stream, 0);
> +	  curarg++;
> +	  if (!curarg->type)
>  	    {
>  	      fprintf_filtered (stream, " ...");
>  	      break;
>  	    }
> -	  else if (args[i]->code != TYPE_CODE_VOID)
> +	  else if (curarg->type->code != TYPE_CODE_VOID)
>  	    {
>  	      fprintf_filtered (stream, ", ");
>  	    }
> @@ -336,33 +346,39 @@ static void
>  c_type_print_args (struct type *type, struct ui_file *stream)
>  {
>    int i;
> -  struct type **args;
> +  struct method_args *args, *curarg;
>  
>    fprintf_filtered (stream, "(");
> -  args = TYPE_ARG_TYPES (type);
> +  args = TYPE_METHOD_ARGS (type);
>    if (args != NULL)
>      {
> -      if (args[1] == NULL)
> +      /* Always skip ``this''.  */
> +      curarg = &args[1];
> +
> +      /* Skip any artificial arguments.  */
> +      while (curarg->artificial)
> +	curarg++;
> +
> +      if (curarg->type == NULL)
>  	{
>  	  fprintf_filtered (stream, "...");
>  	}
> -      else if ((args[1]->code == TYPE_CODE_VOID) &&
> +      else if ((curarg->type->code == TYPE_CODE_VOID) &&
>  	       (current_language->la_language == language_cplus))
>  	{
>  	  fprintf_filtered (stream, "void");
>  	}
>        else
>  	{
> -	  for (i = 1;
> -	       args[i] != NULL && args[i]->code != TYPE_CODE_VOID;
> -	       i++)
> +	  while (curarg->type != NULL
> +		 && curarg->type->code != TYPE_CODE_VOID)
>  	    {
> -	      c_print_type (args[i], "", stream, -1, 0);
> -	      if (args[i + 1] == NULL)
> +	      c_print_type (curarg->type, "", stream, -1, 0);
> +	      if ((curarg + 1)->type == NULL)
>  		{
>  		  fprintf_filtered (stream, "...");
>  		}
> -	      else if (args[i + 1]->code != TYPE_CODE_VOID)
> +	      else if ((curarg + 1)->type->code != TYPE_CODE_VOID)
>  		{
>  		  fprintf_filtered (stream, ",");
>  		  wrap_here ("    ");
> diff -urp src-p3/gdb/dwarf2read.c src-final/gdb/dwarf2read.c
> --- src-p3/gdb/dwarf2read.c	Tue Jan 15 14:38:27 2002
> +++ src-final/gdb/dwarf2read.c	Tue Jan 15 14:30:21 2002
> @@ -2116,21 +2116,26 @@ dwarf2_add_member_fn (struct field_info 
>    if (die->type && TYPE_CODE (die->type) == TYPE_CODE_FUNC)
>      {
>        struct type *return_type = TYPE_TARGET_TYPE (die->type);
> -      struct type **arg_types;
> +      struct method_args *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 *));
> +      arg_types = (struct method_args *)
> +	TYPE_ALLOC (fnp->type, (nparams + 1) * sizeof (struct method_args));
>        for (iparams = 0; iparams < nparams; iparams++)
> -	arg_types[iparams] = TYPE_FIELD_TYPE (die->type, iparams);
> +	{
> +	  arg_types[iparams].type = TYPE_FIELD_TYPE (die->type, iparams);
> +	  arg_types[iparams].artificial = TYPE_FIELD_ARTIFICIAL (die->type,
> +								 iparams);
> +	}
>  
>        /* Set last entry in argument type vector.  */
>        if (TYPE_VARARGS (die->type))
> -	arg_types[nparams] = NULL;
> +	arg_types[nparams].type = NULL;
>        else
> -	arg_types[nparams] = dwarf2_fundamental_type (objfile, FT_VOID);
> +	arg_types[nparams].type = dwarf2_fundamental_type (objfile, FT_VOID);
> +      arg_types[nparams].artificial = 0;
>  
>        smash_to_method_type (fnp->type, type, return_type, arg_types);
>  
> diff -urp src-p3/gdb/gdbtypes.c src-final/gdb/gdbtypes.c
> --- src-p3/gdb/gdbtypes.c	Tue Jan 15 14:25:54 2002
> +++ src-final/gdb/gdbtypes.c	Tue Jan 15 14:30:21 2002
> @@ -112,7 +112,7 @@ static void add_mangled_type (struct ext
>  static void cfront_mangle_name (struct type *, int, int);
>  #endif
>  static void print_bit_vector (B_TYPE *, int);
> -static void print_arg_types (struct type **, int);
> +static void print_arg_types (struct method_args *, int);
>  static void dump_fn_fieldlists (struct type *, int);
>  static void print_cplus_stuff (struct type *, int);
>  static void virtual_base_list_aux (struct type *dclass);
> @@ -821,7 +821,7 @@ smash_to_member_type (struct type *type,
>  
>  void
>  smash_to_method_type (struct type *type, struct type *domain,
> -		      struct type *to_type, struct type **args)
> +		      struct type *to_type, struct method_args *args)
>  {
>    struct objfile *objfile;
>  
> @@ -831,7 +831,7 @@ smash_to_method_type (struct type *type,
>    TYPE_OBJFILE (type) = objfile;
>    TYPE_TARGET_TYPE (type) = to_type;
>    TYPE_DOMAIN_TYPE (type) = domain;
> -  TYPE_ARG_TYPES (type) = args;
> +  TYPE_METHOD_ARGS (type) = args;
>    TYPE_LENGTH (type) = 1;	/* In practice, this is never needed.  */
>    TYPE_CODE (type) = TYPE_CODE_METHOD;
>  }
> @@ -1535,7 +1535,7 @@ check_stub_method (struct type *type, in
>  					 DMGL_PARAMS | DMGL_ANSI);
>    char *argtypetext, *p;
>    int depth = 0, argcount = 1;
> -  struct type **argtypes;
> +  struct method_args *argtypes;
>    struct type *mtype;
>  
>    /* Make sure we got back a function string that we can use.  */
> @@ -1571,11 +1571,13 @@ check_stub_method (struct type *type, in
>    /* We need two more slots: one for the THIS pointer, and one for the
>       NULL [...] or void [end of arglist].  */
>  
> -  argtypes = (struct type **)
> -    TYPE_ALLOC (type, (argcount + 2) * sizeof (struct type *));
> +  argtypes = (struct method_args *)
> +    TYPE_ALLOC (type, (argcount + 2) * sizeof (struct method_args));
>    p = argtypetext;
>    /* FIXME: This is wrong for static member functions.  */
> -  argtypes[0] = lookup_pointer_type (type);
> +  argtypes[0].type = lookup_pointer_type (type);
> +  /* Assume no artificial arguments.  */
> +  argtypes[0].artificial = 0;
>    argcount = 1;
>  
>    if (*p != ')')		/* () means no args, skip while */
> @@ -1588,8 +1590,9 @@ check_stub_method (struct type *type, in
>  	      /* Avoid parsing of ellipsis, they will be handled below.  */
>  	      if (strncmp (argtypetext, "...", p - argtypetext) != 0)
>  		{
> -		  argtypes[argcount] =
> +		  argtypes[argcount].type =
>  		    safe_parse_type (argtypetext, p - argtypetext);
> +		  argtypes[argcount].artificial = 0;
>  		  argcount += 1;
>  		}
>  	      argtypetext = p + 1;
> @@ -1610,11 +1613,13 @@ check_stub_method (struct type *type, in
>  
>    if (p[-2] != '.')		/* Not '...' */
>      {
> -      argtypes[argcount] = builtin_type_void;	/* List terminator */
> +      argtypes[argcount].type = builtin_type_void;	/* List terminator */
> +      argtypes[argcount].artificial = 0;
>      }
>    else
>      {
> -      argtypes[argcount] = NULL;	/* Ellist terminator */
> +      argtypes[argcount].type = NULL;	/* Ellist terminator */
> +      argtypes[argcount].artificial = 0;
>      }
>  
>    xfree (demangled_name);
> @@ -1626,7 +1631,7 @@ check_stub_method (struct type *type, in
>    /* Now update the old "stub" type into a real type.  */
>    mtype = TYPE_FN_FIELD_TYPE (f, signature_id);
>    TYPE_DOMAIN_TYPE (mtype) = type;
> -  TYPE_ARG_TYPES (mtype) = argtypes;
> +  TYPE_METHOD_ARGS (mtype) = argtypes;
>    TYPE_FLAGS (mtype) &= ~TYPE_FLAG_STUB;
>    TYPE_FN_FIELD_STUB (f, signature_id) = 0;
>  }
> @@ -2584,14 +2589,15 @@ print_bit_vector (B_TYPE *bits, int nbit
>     include it since we may get into a infinitely recursive situation. */
>  
>  static void
> -print_arg_types (struct type **args, int spaces)
> +print_arg_types (struct method_args *args, int spaces)
>  {
>    if (args != NULL)
>      {
> -      while (*args != NULL)
> +      while (args->type != NULL)
>  	{
> -	  recursive_dump_type (*args, spaces + 2);
> -	  if ((*args++)->code == TYPE_CODE_VOID)
> +	  printfi_filtered (spaces, "artificial %d\n", args->artificial);
> +	  recursive_dump_type (args->type, spaces + 2);
> +	  if ((args++)->type->code == TYPE_CODE_VOID)
>  	    {
>  	      break;
>  	    }
> @@ -2640,7 +2646,7 @@ dump_fn_fieldlists (struct type *type, i
>  	  gdb_print_host_address (TYPE_FN_FIELD_ARGS (f, overload_idx), gdb_stdout);
>  	  printf_filtered ("\n");
>  
> -	  print_arg_types (TYPE_FN_FIELD_ARGS (f, overload_idx), spaces);
> +	  print_arg_types (TYPE_FN_FIELD_ARGS (f, overload_idx), spaces+8);
>  	  printfi_filtered (spaces + 8, "fcontext ");
>  	  gdb_print_host_address (TYPE_FN_FIELD_FCONTEXT (f, overload_idx),
>  				  gdb_stdout);
> @@ -2978,10 +2984,10 @@ recursive_dump_type (struct type *type, 
>      {
>      case TYPE_CODE_METHOD:
>      case TYPE_CODE_FUNC:
> -      printfi_filtered (spaces, "arg_types ");
> -      gdb_print_host_address (TYPE_ARG_TYPES (type), gdb_stdout);
> +      printfi_filtered (spaces, "method_args ");
> +      gdb_print_host_address (TYPE_METHOD_ARGS (type), gdb_stdout);
>        puts_filtered ("\n");
> -      print_arg_types (TYPE_ARG_TYPES (type), spaces);
> +      print_arg_types (TYPE_METHOD_ARGS (type), spaces);
>        break;
>  
>      case TYPE_CODE_STRUCT:
> diff -urp src-p3/gdb/gdbtypes.h src-final/gdb/gdbtypes.h
> --- src-p3/gdb/gdbtypes.h	Tue Jan 15 14:38:27 2002
> +++ src-final/gdb/gdbtypes.h	Tue Jan 15 14:30:21 2002
> @@ -73,6 +73,11 @@ struct block;
>  #define	B_BYTES(x)	( 1 + ((x)>>3) )
>  #define	B_CLRALL(a,x)	memset ((a), 0, B_BYTES(x))
>  
> +struct method_args {
> +  struct type *type;
> +  int artificial;
> +};
> +
>  /* Different kinds of data types are distinguished by the `code' field.  */
>  
>  enum type_code
> @@ -463,7 +468,7 @@ struct type
>  	   pointer after the last argument for functions with variable
>  	   arguments.  */
>  
> -	struct type **arg_types;
> +	struct method_args *method_args;
>  
>  	/* CPLUS_STUFF is for TYPE_CODE_STRUCT.  It is initialized to point to
>  	   cplus_struct_default, a default static instance of a struct
> @@ -780,7 +785,8 @@ extern void allocate_cplus_struct_type (
>  #define TYPE_NINSTANTIATIONS(thistype) TYPE_CPLUS_SPECIFIC(thistype)->ninstantiations
>  #define TYPE_DECLARED_TYPE(thistype) TYPE_CPLUS_SPECIFIC(thistype)->declared_type
>  #define	TYPE_TYPE_SPECIFIC(thistype) (thistype)->type_specific
> -#define TYPE_ARG_TYPES(thistype) (thistype)->type_specific.arg_types
> +#define TYPE_METHOD_ARGS(thistype) (thistype)->type_specific.method_args
> +#define TYPE_ARG_TYPE(thistype,i) TYPE_METHOD_ARGS(thistype)[i].type
>  #define TYPE_CPLUS_SPECIFIC(thistype) (thistype)->type_specific.cplus_stuff
>  #define TYPE_FLOATFORMAT(thistype) (thistype)->type_specific.floatformat
>  #define TYPE_BASECLASS(thistype,index) (thistype)->fields[index].type
> @@ -858,7 +864,8 @@ extern void allocate_cplus_struct_type (
>  #define TYPE_FN_FIELD(thisfn, n) (thisfn)[n]
>  #define TYPE_FN_FIELD_PHYSNAME(thisfn, n) (thisfn)[n].physname
>  #define TYPE_FN_FIELD_TYPE(thisfn, n) (thisfn)[n].type
> -#define TYPE_FN_FIELD_ARGS(thisfn, n) TYPE_ARG_TYPES ((thisfn)[n].type)
> +#define TYPE_FN_FIELD_ARGS(thisfn, n) TYPE_METHOD_ARGS ((thisfn)[n].type)
> +#define TYPE_FN_FIELD_ARG(thisfn, n, i) TYPE_ARG_TYPE ((thisfn)[n].type, i)
>  #define TYPE_FN_FIELD_CONST(thisfn, n) ((thisfn)[n].is_const)
>  #define TYPE_FN_FIELD_VOLATILE(thisfn, n) ((thisfn)[n].is_volatile)
>  #define TYPE_FN_FIELD_PRIVATE(thisfn, n) ((thisfn)[n].is_private)
> @@ -1068,7 +1075,7 @@ extern struct type *lookup_member_type (
>  
>  extern void
>  smash_to_method_type (struct type *, struct type *, struct type *,
> -		      struct type **);
> +		      struct method_args *);
>  
>  extern void
>  smash_to_member_type (struct type *, struct type *, struct type *);
> diff -urp src-p3/gdb/hp-symtab-read.c src-final/gdb/hp-symtab-read.c
> --- src-p3/gdb/hp-symtab-read.c	Tue Jan 15 14:29:16 2002
> +++ src-final/gdb/hp-symtab-read.c	Tue Jan 15 14:30:21 2002
> @@ -2555,19 +2555,20 @@ hpread_type_lookup (dnttpointer hp_type,
>  	struct type *retvaltype;
>  	int nargs;
>  	int i;
> -	struct type **args_type;
> +	struct method_args *args_type;
>  	class_type = hpread_type_lookup (dn_bufp->dptrmem.pointsto,
>  					 objfile);
>  	functype = hpread_type_lookup (dn_bufp->dptrmem.memtype,
>  				       objfile);
>  	retvaltype = TYPE_TARGET_TYPE (functype);
>  	nargs = TYPE_NFIELDS (functype);
> -	args_type = (struct type **) xmalloc ((nargs + 1) * sizeof (struct type *));
> +	args_type = (struct method_args *) xmalloc ((nargs + 1) * sizeof (struct method_args));
>  	for (i = 0; i < nargs; i++)
>  	  {
> -	    args_type[i] = TYPE_FIELD_TYPE (functype, i);
> +	    args_type[i].type = TYPE_FIELD_TYPE (functype, i);
> +	    args_type[i].artificial = 0;
>  	  }
> -	args_type[nargs] = NULL;
> +	args_type[nargs].type = NULL;
>  	ptrmemtype = alloc_type (objfile);
>  	smash_to_method_type (ptrmemtype, class_type, retvaltype, args_type);
>  	return make_pointer_type (ptrmemtype, NULL);
> diff -urp src-p3/gdb/stabsread.c src-final/gdb/stabsread.c
> --- src-p3/gdb/stabsread.c	Tue Jan 15 14:29:16 2002
> +++ src-final/gdb/stabsread.c	Tue Jan 15 14:30:22 2002
> @@ -141,7 +141,7 @@ static struct type *read_struct_type (ch
>  static struct type *read_array_type (char **, struct type *,
>  				     struct objfile *);
>  
> -static struct type **read_args (char **, int, struct objfile *);
> +static struct method_args *read_args (char **, int, struct objfile *);
>  
>  static int
>  read_cpp_abbrev (struct field_info *, char **, struct type *,
> @@ -2671,7 +2671,7 @@ again:
>  	{
>  	  struct type *domain = read_type (pp, objfile);
>  	  struct type *return_type;
> -	  struct type **args;
> +	  struct method_args *args;
>  
>  	  if (**pp != ',')
>  	    /* Invalid member type data format.  */
> @@ -4748,21 +4748,23 @@ handle_true_range:
>  }
>  
>  /* Read in an argument list.  This is a list of types, separated by commas
> -   and terminated with END.  Return the list of types read in, or (struct type
> -   **)-1 if there is an error.  */
> +   and terminated with END.  Return the list of types read in, or (struct
> +   method_args *)-1 if there is an error.  */
>  
> -static struct type **
> +static struct method_args *
>  read_args (char **pp, int end, struct objfile *objfile)
>  {
>    /* FIXME!  Remove this arbitrary limit!  */
> -  struct type *types[1024], **rval;	/* allow for fns of 1023 parameters */
> +  struct type *types[1024];	/* allow for fns of 1023 parameters */
> +  struct method_args *rval;
>    int n = 0;
> +  int i;
>  
>    while (**pp != end)
>      {
>        if (**pp != ',')
>  	/* Invalid argument list: no ','.  */
> -	return (struct type **) -1;
> +	return (struct method_args *) -1;
>        (*pp)++;
>        STABS_CONTINUE (pp, objfile);
>        types[n++] = read_type (pp, objfile);
> @@ -4771,18 +4773,22 @@ read_args (char **pp, int end, struct ob
>  
>    if (n == 1)
>      {
> -      rval = (struct type **) xmalloc (2 * sizeof (struct type *));
> +      rval = (struct method_args *) xmalloc (2 * sizeof (struct method_args));
>      }
>    else if (TYPE_CODE (types[n - 1]) != TYPE_CODE_VOID)
>      {
> -      rval = (struct type **) xmalloc ((n + 1) * sizeof (struct type *));
> -      memset (rval + n, 0, sizeof (struct type *));
> +      rval = (struct method_args *) xmalloc ((n + 1) * sizeof (struct method_args));
> +      memset (rval + n, 0, sizeof (struct method_args));
>      }
>    else
>      {
> -      rval = (struct type **) xmalloc (n * sizeof (struct type *));
> +      rval = (struct method_args *) xmalloc (n * sizeof (struct method_args));
> +    }
> +  for (i = 0; i < n; i++)
> +    {
> +      rval[i].type = types[i];
> +      rval[i].artificial = 0;
>      }
> -  memcpy (rval, types, n * sizeof (struct type *));
>    return rval;
>  }
>  
> diff -urp src-p3/gdb/valops.c src-final/gdb/valops.c
> --- src-p3/gdb/valops.c	Tue Jan 15 14:25:54 2002
> +++ src-final/gdb/valops.c	Tue Jan 15 14:30:22 2002
> @@ -44,7 +44,7 @@ extern int hp_som_som_object_present;
>  extern int overload_debug;
>  /* Local functions.  */
>  
> -static int typecmp (int staticp, struct type *t1[], struct value *t2[]);
> +static int typecmp (int staticp, struct method_args *t1, struct value *t2[]);
>  
>  static CORE_ADDR find_function_addr (struct value *, struct type **);
>  static struct value *value_arg_coerce (struct value *, struct type *, int);
> @@ -1429,7 +1429,7 @@ hand_function_call (struct value *functi
>    if (TYPE_CODE (ftype) == TYPE_CODE_METHOD)
>      {
>        i = 0;
> -      while (TYPE_CODE (TYPE_ARG_TYPES (ftype)[i]) != TYPE_CODE_VOID)
> +      while (TYPE_CODE (TYPE_ARG_TYPE (ftype, i)) != TYPE_CODE_VOID)
>  	i++;
>        n_method_args = i;
>        if (nargs < i)
> @@ -1446,7 +1446,7 @@ hand_function_call (struct value *functi
>        if (TYPE_CODE (ftype) == TYPE_CODE_METHOD)
>  	{
>  	  if (i < n_method_args)
> -	    args[i] = value_arg_coerce (args[i], TYPE_ARG_TYPES (ftype)[i], 1);
> +	    args[i] = value_arg_coerce (args[i], TYPE_ARG_TYPE (ftype, i), 1);
>  	  else
>  	    args[i] = value_arg_coerce (args[i], NULL, 0);
>  	}
> @@ -1941,7 +1941,7 @@ value_bitstring (char *ptr, int len)
>     requested operation is type secure, shouldn't we?  FIXME.  */
>  
>  static int
> -typecmp (int staticp, struct type *t1[], struct value *t2[])
> +typecmp (int staticp, struct method_args t1[], struct value *t2[])
>  {
>    int i;
>  
> @@ -1951,16 +1951,17 @@ typecmp (int staticp, struct type *t1[],
>      return t2[1] != 0;
>    if (t1 == 0)
>      return 1;
> -  if (TYPE_CODE (t1[0]) == TYPE_CODE_VOID)
> +  if (TYPE_CODE (t1[0].type) == TYPE_CODE_VOID)
>      return 0;
> -  if (t1[!staticp] == 0)
> +  if (t1[!staticp].type == 0)
>      return 0;
> -  for (i = !staticp; t1[i] && TYPE_CODE (t1[i]) != TYPE_CODE_VOID; i++)
> +  for (i = !staticp; t1[i].type && TYPE_CODE (t1[i].type) != TYPE_CODE_VOID;
> +       i++)
>      {
>        struct type *tt1, *tt2;
>        if (!t2[i])
>  	return i + 1;
> -      tt1 = check_typedef (t1[i]);
> +      tt1 = check_typedef (t1[i].type);
>        tt2 = check_typedef (VALUE_TYPE (t2[i]));
>        if (TYPE_CODE (tt1) == TYPE_CODE_REF
>        /* We should be doing hairy argument matching, as below.  */
> @@ -1997,10 +1998,10 @@ typecmp (int staticp, struct type *t1[],
>        /* We should be doing much hairier argument matching (see section 13.2
>           of the ARM), but as a quick kludge, just check for the same type
>           code.  */
> -      if (TYPE_CODE (t1[i]) != TYPE_CODE (VALUE_TYPE (t2[i])))
> +      if (TYPE_CODE (t1[i].type) != TYPE_CODE (VALUE_TYPE (t2[i])))
>  	return i + 1;
>      }
> -  if (!t1[i])
> +  if (!t1[i].type)
>      return 0;
>    return t2[i] ? i + 1 : 0;
>  }
> @@ -2744,7 +2745,8 @@ find_overload_match (struct type **arg_t
>  
>  	  if (TYPE_FN_FIELD_ARGS(fns_ptr,ix))
>  	    {
> -	      while (TYPE_CODE(TYPE_FN_FIELD_ARGS(fns_ptr,ix)[nparms]) != TYPE_CODE_VOID)
> +	      while (TYPE_CODE(TYPE_FN_FIELD_ARG(fns_ptr,ix,nparms))
> +		     != TYPE_CODE_VOID)
>  		nparms++;
>  	    }
>  	}
> @@ -2758,7 +2760,7 @@ find_overload_match (struct type **arg_t
>        parm_types = (struct type **) xmalloc (nparms * (sizeof (struct type *)));
>        for (jj = 0; jj < nparms; jj++)
>  	parm_types[jj] = (method
> -			  ? (TYPE_FN_FIELD_ARGS (fns_ptr, ix)[jj])
> +			  ? (TYPE_FN_FIELD_ARG (fns_ptr, ix, jj))
>  			  : TYPE_FIELD_TYPE (SYMBOL_TYPE (oload_syms[ix]), jj));
>  
>        /* Compare parameter types to supplied argument types */
> 

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]