Create and use struct rank.
2010-11-04 Sami Wagiaalla <swagiaal@redhat.com> * gdbtypes.h: Create struct rank. Convert all 'BADNESS' macros to const struct rank declarations. (sum_ranks): New function. (compare_ranks): New function. * valops.c (find_oload_champ): Updated. (classify_oload_match): Use compare_ranks. Improved comments. (compare_parameters): Use compare_ranks. * gdbtypes.c: Initialize 'BADNESS' constants. (sum_ranks): New function. (compare_ranks): New function. (compare_badness): Use compare_ranks. (rank_function): Use global constants instead of literals. (rank_one_type): Ditto. Return struct rank. Use sum_ranks.
This commit is contained in:
parent
23fa7f66ac
commit
6403aeeaa1
4 changed files with 128 additions and 40 deletions
|
@ -1,3 +1,22 @@
|
||||||
|
2010-11-04 Sami Wagiaalla <swagiaal@redhat.com>
|
||||||
|
|
||||||
|
* gdbtypes.h: Create struct rank.
|
||||||
|
Convert all 'BADNESS' macros to const struct rank declarations.
|
||||||
|
(sum_ranks): New function.
|
||||||
|
(compare_ranks): New function.
|
||||||
|
* valops.c (find_oload_champ): Updated.
|
||||||
|
(classify_oload_match): Use compare_ranks.
|
||||||
|
Improved comments.
|
||||||
|
(compare_parameters): Use compare_ranks.
|
||||||
|
* gdbtypes.c: Initialize 'BADNESS' constants.
|
||||||
|
(sum_ranks): New function.
|
||||||
|
(compare_ranks): New function.
|
||||||
|
(compare_badness): Use compare_ranks.
|
||||||
|
(rank_function): Use global constants instead of literals.
|
||||||
|
(rank_one_type): Ditto.
|
||||||
|
Return struct rank.
|
||||||
|
Use sum_ranks.
|
||||||
|
|
||||||
2010-11-04 Doug Evans <dje@google.com>
|
2010-11-04 Doug Evans <dje@google.com>
|
||||||
|
|
||||||
* python/py-prettyprint.c (find_pretty_printer_from_gdb): Fix comment.
|
* python/py-prettyprint.c (find_pretty_printer_from_gdb): Fix comment.
|
||||||
|
|
|
@ -41,6 +41,28 @@
|
||||||
#include "hashtab.h"
|
#include "hashtab.h"
|
||||||
|
|
||||||
|
|
||||||
|
/* Initialize BADNESS constants. */
|
||||||
|
|
||||||
|
const struct rank LENGTH_MISMATCH_BADNESS = {100};
|
||||||
|
|
||||||
|
const struct rank TOO_FEW_PARAMS_BADNESS = {100};
|
||||||
|
const struct rank INCOMPATIBLE_TYPE_BADNESS = {100};
|
||||||
|
|
||||||
|
const struct rank EXACT_MATCH_BADNESS = {0};
|
||||||
|
|
||||||
|
const struct rank INTEGER_PROMOTION_BADNESS = {1};
|
||||||
|
const struct rank FLOAT_PROMOTION_BADNESS = {1};
|
||||||
|
const struct rank BASE_PTR_CONVERSION_BADNESS = {1};
|
||||||
|
const struct rank INTEGER_CONVERSION_BADNESS = {2};
|
||||||
|
const struct rank FLOAT_CONVERSION_BADNESS = {2};
|
||||||
|
const struct rank INT_FLOAT_CONVERSION_BADNESS = {2};
|
||||||
|
const struct rank VOID_PTR_CONVERSION_BADNESS = {2};
|
||||||
|
const struct rank BOOL_PTR_CONVERSION_BADNESS = {3};
|
||||||
|
const struct rank BASE_CONVERSION_BADNESS = {2};
|
||||||
|
const struct rank REFERENCE_CONVERSION_BADNESS = {2};
|
||||||
|
|
||||||
|
const struct rank NS_POINTER_CONVERSION_BADNESS = {10};
|
||||||
|
|
||||||
/* Floatformat pairs. */
|
/* Floatformat pairs. */
|
||||||
const struct floatformat *floatformats_ieee_half[BFD_ENDIAN_UNKNOWN] = {
|
const struct floatformat *floatformats_ieee_half[BFD_ENDIAN_UNKNOWN] = {
|
||||||
&floatformat_ieee_half_big,
|
&floatformat_ieee_half_big,
|
||||||
|
@ -2056,6 +2078,32 @@ is_unique_ancestor (struct type *base, struct value *val)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Return the sum of the rank of A with the rank of B. */
|
||||||
|
|
||||||
|
struct rank
|
||||||
|
sum_ranks (struct rank a, struct rank b)
|
||||||
|
{
|
||||||
|
struct rank c;
|
||||||
|
c.rank = a.rank + b.rank;
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Compare rank A and B and return:
|
||||||
|
0 if a = b
|
||||||
|
1 if a is better than b
|
||||||
|
-1 if b is better than a. */
|
||||||
|
|
||||||
|
int
|
||||||
|
compare_ranks (struct rank a, struct rank b)
|
||||||
|
{
|
||||||
|
if (a.rank == b.rank)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (a.rank < b.rank)
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
/* Functions for overload resolution begin here */
|
/* Functions for overload resolution begin here */
|
||||||
|
|
||||||
|
@ -2080,7 +2128,7 @@ compare_badness (struct badness_vector *a, struct badness_vector *b)
|
||||||
/* Subtract b from a */
|
/* Subtract b from a */
|
||||||
for (i = 0; i < a->length; i++)
|
for (i = 0; i < a->length; i++)
|
||||||
{
|
{
|
||||||
tmp = a->rank[i] - b->rank[i];
|
tmp = compare_ranks (b->rank[i], a->rank[i]);
|
||||||
if (tmp > 0)
|
if (tmp > 0)
|
||||||
found_pos = 1;
|
found_pos = 1;
|
||||||
else if (tmp < 0)
|
else if (tmp < 0)
|
||||||
|
@ -2128,7 +2176,9 @@ rank_function (struct type **parms, int nparms,
|
||||||
arguments and ellipsis parameter lists, we should consider those
|
arguments and ellipsis parameter lists, we should consider those
|
||||||
and rank the length-match more finely. */
|
and rank the length-match more finely. */
|
||||||
|
|
||||||
LENGTH_MATCH (bv) = (nargs != nparms) ? LENGTH_MISMATCH_BADNESS : 0;
|
LENGTH_MATCH (bv) = (nargs != nparms)
|
||||||
|
? LENGTH_MISMATCH_BADNESS
|
||||||
|
: EXACT_MATCH_BADNESS;
|
||||||
|
|
||||||
/* Now rank all the parameters of the candidate function */
|
/* Now rank all the parameters of the candidate function */
|
||||||
for (i = 1; i <= min_len; i++)
|
for (i = 1; i <= min_len; i++)
|
||||||
|
@ -2239,12 +2289,12 @@ types_equal (struct type *a, struct type *b)
|
||||||
* PARM is to ARG. The higher the return value, the worse the match.
|
* PARM is to ARG. The higher the return value, the worse the match.
|
||||||
* Generally the "bad" conversions are all uniformly assigned a 100. */
|
* Generally the "bad" conversions are all uniformly assigned a 100. */
|
||||||
|
|
||||||
int
|
struct rank
|
||||||
rank_one_type (struct type *parm, struct type *arg)
|
rank_one_type (struct type *parm, struct type *arg)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (types_equal (parm, arg))
|
if (types_equal (parm, arg))
|
||||||
return 0;
|
return EXACT_MATCH_BADNESS;
|
||||||
|
|
||||||
/* Resolve typedefs */
|
/* Resolve typedefs */
|
||||||
if (TYPE_CODE (parm) == TYPE_CODE_TYPEDEF)
|
if (TYPE_CODE (parm) == TYPE_CODE_TYPEDEF)
|
||||||
|
@ -2255,11 +2305,11 @@ rank_one_type (struct type *parm, struct type *arg)
|
||||||
/* See through references, since we can almost make non-references
|
/* See through references, since we can almost make non-references
|
||||||
references. */
|
references. */
|
||||||
if (TYPE_CODE (arg) == TYPE_CODE_REF)
|
if (TYPE_CODE (arg) == TYPE_CODE_REF)
|
||||||
return (rank_one_type (parm, TYPE_TARGET_TYPE (arg))
|
return (sum_ranks (rank_one_type (parm, TYPE_TARGET_TYPE (arg)),
|
||||||
+ REFERENCE_CONVERSION_BADNESS);
|
REFERENCE_CONVERSION_BADNESS));
|
||||||
if (TYPE_CODE (parm) == TYPE_CODE_REF)
|
if (TYPE_CODE (parm) == TYPE_CODE_REF)
|
||||||
return (rank_one_type (TYPE_TARGET_TYPE (parm), arg)
|
return (sum_ranks (rank_one_type (TYPE_TARGET_TYPE (parm), arg),
|
||||||
+ REFERENCE_CONVERSION_BADNESS);
|
REFERENCE_CONVERSION_BADNESS));
|
||||||
if (overload_debug)
|
if (overload_debug)
|
||||||
/* Debugging only. */
|
/* Debugging only. */
|
||||||
fprintf_filtered (gdb_stderr,
|
fprintf_filtered (gdb_stderr,
|
||||||
|
@ -2290,7 +2340,7 @@ rank_one_type (struct type *parm, struct type *arg)
|
||||||
case TYPE_CODE_ARRAY:
|
case TYPE_CODE_ARRAY:
|
||||||
if (types_equal (TYPE_TARGET_TYPE (parm),
|
if (types_equal (TYPE_TARGET_TYPE (parm),
|
||||||
TYPE_TARGET_TYPE (arg)))
|
TYPE_TARGET_TYPE (arg)))
|
||||||
return 0;
|
return EXACT_MATCH_BADNESS;
|
||||||
return INCOMPATIBLE_TYPE_BADNESS;
|
return INCOMPATIBLE_TYPE_BADNESS;
|
||||||
case TYPE_CODE_FUNC:
|
case TYPE_CODE_FUNC:
|
||||||
return rank_one_type (TYPE_TARGET_TYPE (parm), arg);
|
return rank_one_type (TYPE_TARGET_TYPE (parm), arg);
|
||||||
|
@ -2333,7 +2383,7 @@ rank_one_type (struct type *parm, struct type *arg)
|
||||||
{
|
{
|
||||||
/* This case only for character types */
|
/* This case only for character types */
|
||||||
if (TYPE_NOSIGN (arg))
|
if (TYPE_NOSIGN (arg))
|
||||||
return 0; /* plain char -> plain char */
|
return EXACT_MATCH_BADNESS; /* plain char -> plain char */
|
||||||
else /* signed/unsigned char -> plain char */
|
else /* signed/unsigned char -> plain char */
|
||||||
return INTEGER_CONVERSION_BADNESS;
|
return INTEGER_CONVERSION_BADNESS;
|
||||||
}
|
}
|
||||||
|
@ -2345,7 +2395,7 @@ rank_one_type (struct type *parm, struct type *arg)
|
||||||
unsigned long -> unsigned long */
|
unsigned long -> unsigned long */
|
||||||
if (integer_types_same_name_p (TYPE_NAME (parm),
|
if (integer_types_same_name_p (TYPE_NAME (parm),
|
||||||
TYPE_NAME (arg)))
|
TYPE_NAME (arg)))
|
||||||
return 0;
|
return EXACT_MATCH_BADNESS;
|
||||||
else if (integer_types_same_name_p (TYPE_NAME (arg),
|
else if (integer_types_same_name_p (TYPE_NAME (arg),
|
||||||
"int")
|
"int")
|
||||||
&& integer_types_same_name_p (TYPE_NAME (parm),
|
&& integer_types_same_name_p (TYPE_NAME (parm),
|
||||||
|
@ -2369,7 +2419,7 @@ rank_one_type (struct type *parm, struct type *arg)
|
||||||
{
|
{
|
||||||
if (integer_types_same_name_p (TYPE_NAME (parm),
|
if (integer_types_same_name_p (TYPE_NAME (parm),
|
||||||
TYPE_NAME (arg)))
|
TYPE_NAME (arg)))
|
||||||
return 0;
|
return EXACT_MATCH_BADNESS;
|
||||||
else if (integer_types_same_name_p (TYPE_NAME (arg),
|
else if (integer_types_same_name_p (TYPE_NAME (arg),
|
||||||
"int")
|
"int")
|
||||||
&& integer_types_same_name_p (TYPE_NAME (parm),
|
&& integer_types_same_name_p (TYPE_NAME (parm),
|
||||||
|
@ -2435,19 +2485,19 @@ rank_one_type (struct type *parm, struct type *arg)
|
||||||
if (TYPE_NOSIGN (parm))
|
if (TYPE_NOSIGN (parm))
|
||||||
{
|
{
|
||||||
if (TYPE_NOSIGN (arg))
|
if (TYPE_NOSIGN (arg))
|
||||||
return 0;
|
return EXACT_MATCH_BADNESS;
|
||||||
else
|
else
|
||||||
return INTEGER_CONVERSION_BADNESS;
|
return INTEGER_CONVERSION_BADNESS;
|
||||||
}
|
}
|
||||||
else if (TYPE_UNSIGNED (parm))
|
else if (TYPE_UNSIGNED (parm))
|
||||||
{
|
{
|
||||||
if (TYPE_UNSIGNED (arg))
|
if (TYPE_UNSIGNED (arg))
|
||||||
return 0;
|
return EXACT_MATCH_BADNESS;
|
||||||
else
|
else
|
||||||
return INTEGER_PROMOTION_BADNESS;
|
return INTEGER_PROMOTION_BADNESS;
|
||||||
}
|
}
|
||||||
else if (!TYPE_NOSIGN (arg) && !TYPE_UNSIGNED (arg))
|
else if (!TYPE_NOSIGN (arg) && !TYPE_UNSIGNED (arg))
|
||||||
return 0;
|
return EXACT_MATCH_BADNESS;
|
||||||
else
|
else
|
||||||
return INTEGER_CONVERSION_BADNESS;
|
return INTEGER_CONVERSION_BADNESS;
|
||||||
default:
|
default:
|
||||||
|
@ -2481,7 +2531,7 @@ rank_one_type (struct type *parm, struct type *arg)
|
||||||
case TYPE_CODE_PTR:
|
case TYPE_CODE_PTR:
|
||||||
return BOOL_PTR_CONVERSION_BADNESS;
|
return BOOL_PTR_CONVERSION_BADNESS;
|
||||||
case TYPE_CODE_BOOL:
|
case TYPE_CODE_BOOL:
|
||||||
return 0;
|
return EXACT_MATCH_BADNESS;
|
||||||
default:
|
default:
|
||||||
return INCOMPATIBLE_TYPE_BADNESS;
|
return INCOMPATIBLE_TYPE_BADNESS;
|
||||||
}
|
}
|
||||||
|
@ -2493,7 +2543,7 @@ rank_one_type (struct type *parm, struct type *arg)
|
||||||
if (TYPE_LENGTH (arg) < TYPE_LENGTH (parm))
|
if (TYPE_LENGTH (arg) < TYPE_LENGTH (parm))
|
||||||
return FLOAT_PROMOTION_BADNESS;
|
return FLOAT_PROMOTION_BADNESS;
|
||||||
else if (TYPE_LENGTH (arg) == TYPE_LENGTH (parm))
|
else if (TYPE_LENGTH (arg) == TYPE_LENGTH (parm))
|
||||||
return 0;
|
return EXACT_MATCH_BADNESS;
|
||||||
else
|
else
|
||||||
return FLOAT_CONVERSION_BADNESS;
|
return FLOAT_CONVERSION_BADNESS;
|
||||||
case TYPE_CODE_INT:
|
case TYPE_CODE_INT:
|
||||||
|
@ -2512,7 +2562,7 @@ rank_one_type (struct type *parm, struct type *arg)
|
||||||
case TYPE_CODE_FLT:
|
case TYPE_CODE_FLT:
|
||||||
return FLOAT_PROMOTION_BADNESS;
|
return FLOAT_PROMOTION_BADNESS;
|
||||||
case TYPE_CODE_COMPLEX:
|
case TYPE_CODE_COMPLEX:
|
||||||
return 0;
|
return EXACT_MATCH_BADNESS;
|
||||||
default:
|
default:
|
||||||
return INCOMPATIBLE_TYPE_BADNESS;
|
return INCOMPATIBLE_TYPE_BADNESS;
|
||||||
}
|
}
|
||||||
|
|
|
@ -849,11 +849,17 @@ struct vbase
|
||||||
struct vbase *next; /* next in chain */
|
struct vbase *next; /* next in chain */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* Struct used to store conversion rankings. */
|
||||||
|
struct rank
|
||||||
|
{
|
||||||
|
int rank;
|
||||||
|
};
|
||||||
|
|
||||||
/* Struct used for ranking a function for overload resolution */
|
/* Struct used for ranking a function for overload resolution */
|
||||||
struct badness_vector
|
struct badness_vector
|
||||||
{
|
{
|
||||||
int length;
|
int length;
|
||||||
int *rank;
|
struct rank *rank;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* GNAT Ada-specific information for various Ada types. */
|
/* GNAT Ada-specific information for various Ada types. */
|
||||||
|
@ -1399,45 +1405,52 @@ extern int is_unique_ancestor (struct type *, struct value *);
|
||||||
#define LENGTH_MATCH(bv) ((bv)->rank[0])
|
#define LENGTH_MATCH(bv) ((bv)->rank[0])
|
||||||
|
|
||||||
/* Badness if parameter list length doesn't match arg list length */
|
/* Badness if parameter list length doesn't match arg list length */
|
||||||
#define LENGTH_MISMATCH_BADNESS 100
|
extern const struct rank LENGTH_MISMATCH_BADNESS;
|
||||||
|
|
||||||
/* Dummy badness value for nonexistent parameter positions */
|
/* Dummy badness value for nonexistent parameter positions */
|
||||||
#define TOO_FEW_PARAMS_BADNESS 100
|
extern const struct rank TOO_FEW_PARAMS_BADNESS;
|
||||||
/* Badness if no conversion among types */
|
/* Badness if no conversion among types */
|
||||||
#define INCOMPATIBLE_TYPE_BADNESS 100
|
extern const struct rank INCOMPATIBLE_TYPE_BADNESS;
|
||||||
|
|
||||||
|
/* Badness of an exact match. */
|
||||||
|
extern const struct rank EXACT_MATCH_BADNESS;
|
||||||
|
|
||||||
/* Badness of integral promotion */
|
/* Badness of integral promotion */
|
||||||
#define INTEGER_PROMOTION_BADNESS 1
|
extern const struct rank INTEGER_PROMOTION_BADNESS;
|
||||||
/* Badness of floating promotion */
|
/* Badness of floating promotion */
|
||||||
#define FLOAT_PROMOTION_BADNESS 1
|
extern const struct rank FLOAT_PROMOTION_BADNESS;
|
||||||
/* Badness of converting a derived class pointer
|
/* Badness of converting a derived class pointer
|
||||||
to a base class pointer. */
|
to a base class pointer. */
|
||||||
#define BASE_PTR_CONVERSION_BADNESS 1
|
extern const struct rank BASE_PTR_CONVERSION_BADNESS;
|
||||||
/* Badness of integral conversion */
|
/* Badness of integral conversion */
|
||||||
#define INTEGER_CONVERSION_BADNESS 2
|
extern const struct rank INTEGER_CONVERSION_BADNESS;
|
||||||
/* Badness of floating conversion */
|
/* Badness of floating conversion */
|
||||||
#define FLOAT_CONVERSION_BADNESS 2
|
extern const struct rank FLOAT_CONVERSION_BADNESS;
|
||||||
/* Badness of integer<->floating conversions */
|
/* Badness of integer<->floating conversions */
|
||||||
#define INT_FLOAT_CONVERSION_BADNESS 2
|
extern const struct rank INT_FLOAT_CONVERSION_BADNESS;
|
||||||
/* Badness of conversion of pointer to void pointer */
|
/* Badness of conversion of pointer to void pointer */
|
||||||
#define VOID_PTR_CONVERSION_BADNESS 2
|
extern const struct rank VOID_PTR_CONVERSION_BADNESS;
|
||||||
/* Badness of conversion of pointer to boolean. */
|
/* Badness of conversion of pointer to boolean. */
|
||||||
#define BOOL_PTR_CONVERSION_BADNESS 3
|
extern const struct rank BOOL_PTR_CONVERSION_BADNESS;
|
||||||
/* Badness of converting derived to base class */
|
/* Badness of converting derived to base class */
|
||||||
#define BASE_CONVERSION_BADNESS 2
|
extern const struct rank BASE_CONVERSION_BADNESS;
|
||||||
/* Badness of converting from non-reference to reference */
|
/* Badness of converting from non-reference to reference */
|
||||||
#define REFERENCE_CONVERSION_BADNESS 2
|
extern const struct rank REFERENCE_CONVERSION_BADNESS;
|
||||||
|
|
||||||
/* Non-standard conversions allowed by the debugger */
|
/* Non-standard conversions allowed by the debugger */
|
||||||
/* Converting a pointer to an int is usually OK */
|
/* Converting a pointer to an int is usually OK */
|
||||||
#define NS_POINTER_CONVERSION_BADNESS 10
|
extern const struct rank NS_POINTER_CONVERSION_BADNESS;
|
||||||
|
|
||||||
|
|
||||||
|
extern struct rank sum_ranks (struct rank a, struct rank b);
|
||||||
|
extern int compare_ranks (struct rank a, struct rank b);
|
||||||
|
|
||||||
extern int compare_badness (struct badness_vector *, struct badness_vector *);
|
extern int compare_badness (struct badness_vector *, struct badness_vector *);
|
||||||
|
|
||||||
extern struct badness_vector *rank_function (struct type **, int,
|
extern struct badness_vector *rank_function (struct type **, int,
|
||||||
struct type **, int);
|
struct type **, int);
|
||||||
|
|
||||||
extern int rank_one_type (struct type *, struct type *);
|
extern struct rank rank_one_type (struct type *, struct type *);
|
||||||
|
|
||||||
extern void recursive_dump_type (struct type *, int);
|
extern void recursive_dump_type (struct type *, int);
|
||||||
|
|
||||||
|
|
18
gdb/valops.c
18
gdb/valops.c
|
@ -2905,7 +2905,7 @@ find_oload_champ (struct type **arg_types, int nargs, int method,
|
||||||
for (jj = 0; jj < nargs - static_offset; jj++)
|
for (jj = 0; jj < nargs - static_offset; jj++)
|
||||||
fprintf_filtered (gdb_stderr,
|
fprintf_filtered (gdb_stderr,
|
||||||
"...Badness @ %d : %d\n",
|
"...Badness @ %d : %d\n",
|
||||||
jj, bv->rank[jj]);
|
jj, bv->rank[jj].rank);
|
||||||
fprintf_filtered (gdb_stderr,
|
fprintf_filtered (gdb_stderr,
|
||||||
"Overload resolution champion is %d, ambiguous? %d\n",
|
"Overload resolution champion is %d, ambiguous? %d\n",
|
||||||
oload_champ, oload_ambiguous);
|
oload_champ, oload_ambiguous);
|
||||||
|
@ -2939,9 +2939,15 @@ classify_oload_match (struct badness_vector *oload_champ_bv,
|
||||||
|
|
||||||
for (ix = 1; ix <= nargs - static_offset; ix++)
|
for (ix = 1; ix <= nargs - static_offset; ix++)
|
||||||
{
|
{
|
||||||
if (oload_champ_bv->rank[ix] >= 100)
|
/* If this conversion is as bad as INCOMPATIBLE_TYPE_BADNESS
|
||||||
|
or worse return INCOMPATIBLE. */
|
||||||
|
if (compare_ranks (oload_champ_bv->rank[ix],
|
||||||
|
INCOMPATIBLE_TYPE_BADNESS) <= 0)
|
||||||
return INCOMPATIBLE; /* Truly mismatched types. */
|
return INCOMPATIBLE; /* Truly mismatched types. */
|
||||||
else if (oload_champ_bv->rank[ix] >= 10)
|
/* Otherwise If this conversion is as bad as
|
||||||
|
NS_POINTER_CONVERSION_BADNESS or worse return NON_STANDARD. */
|
||||||
|
else if (compare_ranks (oload_champ_bv->rank[ix],
|
||||||
|
NS_POINTER_CONVERSION_BADNESS) <= 0)
|
||||||
return NON_STANDARD; /* Non-standard type conversions
|
return NON_STANDARD; /* Non-standard type conversions
|
||||||
needed. */
|
needed. */
|
||||||
}
|
}
|
||||||
|
@ -3077,9 +3083,9 @@ compare_parameters (struct type *t1, struct type *t2, int skip_artificial)
|
||||||
|
|
||||||
for (i = 0; i < TYPE_NFIELDS (t2); ++i)
|
for (i = 0; i < TYPE_NFIELDS (t2); ++i)
|
||||||
{
|
{
|
||||||
if (rank_one_type (TYPE_FIELD_TYPE (t1, start + i),
|
if (compare_ranks (rank_one_type (TYPE_FIELD_TYPE (t1, start + i),
|
||||||
TYPE_FIELD_TYPE (t2, i))
|
TYPE_FIELD_TYPE (t2, i)),
|
||||||
!= 0)
|
EXACT_MATCH_BADNESS) != 0)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue