|| rhs->is_error_expression())
return Expression::make_error(location);
- bool are_identical = Type::are_identical(lhs_type, rhs_type, false, NULL);
+ bool are_identical = Type::are_identical(lhs_type, rhs_type,
+ (Type::COMPARE_ERRORS
+ | Type::COMPARE_TAGS),
+ NULL);
if (!are_identical && lhs_type->interface_type() != NULL)
{
if (rhs_type->interface_type() == NULL)
bool for_type_guard,
Location location)
{
- if (Type::are_identical(lhs_type, rhs->type(), false, NULL))
+ if (Type::are_identical(lhs_type, rhs->type(),
+ Type::COMPARE_ERRORS | Type::COMPARE_TAGS,
+ NULL))
return rhs;
Interface_type* lhs_interface_type = lhs_type->interface_type();
if (!this->expr_->is_static_initializer())
return false;
- if (Type::are_identical(type, expr_type, false, NULL))
+ if (Type::are_identical(type, expr_type,
+ Type::COMPARE_ERRORS | Type::COMPARE_TAGS,
+ NULL))
return true;
if (type->is_string_type() && expr_type->is_string_type())
Btype* btype = type->get_backend(gogo);
Location loc = this->location();
- if (Type::are_identical(type, expr_type, false, NULL))
+ if (Type::are_identical(type, expr_type,
+ Type::COMPARE_ERRORS | Type::COMPARE_TAGS,
+ NULL))
{
Bexpression* bexpr = this->expr_->get_backend(context);
return gogo->backend()->convert_expression(btype, bexpr, loc);
Struct_type* st2 = this->right_->type()->struct_type();
if (st2 == NULL)
return this;
- if (st != st2 && !Type::are_identical(st, st2, false, NULL))
+ if (st != st2
+ && !Type::are_identical(st, st2,
+ Type::COMPARE_ERRORS | Type::COMPARE_TAGS,
+ NULL))
return this;
if (!Type::are_compatible_for_comparison(true, this->left_->type(),
this->right_->type(), NULL))
Array_type* at2 = this->right_->type()->array_type();
if (at2 == NULL)
return this;
- if (at != at2 && !Type::are_identical(at, at2, false, NULL))
+ if (at != at2
+ && !Type::are_identical(at, at2,
+ Type::COMPARE_ERRORS | Type::COMPARE_TAGS,
+ NULL))
return this;
if (!Type::are_compatible_for_comparison(true, this->left_->type(),
this->right_->type(), NULL))
? this->expr_type_
: this->expr_->type());
etype = etype->deref();
- if (!Type::are_identical(rtype, etype, true, NULL))
+ if (!Type::are_identical(rtype, etype, Type::COMPARE_TAGS, NULL))
this->report_error(_("method type does not match object type"));
}
&& !rnc.type()->is_abstract()
&& inc.type() != NULL
&& !inc.type()->is_abstract()
- && !Type::are_identical(rnc.type(), inc.type(), false, NULL))
+ && !Type::are_identical(rnc.type(), inc.type(),
+ Type::COMPARE_ERRORS | Type::COMPARE_TAGS,
+ NULL))
return false;
mpfr_t r;
if (arg2_type->is_slice_type())
{
Type* e2 = arg2_type->array_type()->element_type();
- if (!Type::are_identical(e1, e2, true, NULL))
+ if (!Type::are_identical(e1, e2, Type::COMPARE_TAGS, NULL))
this->report_error(_("element types must be the same"));
}
else if (arg2_type->is_string_type())
|| args->back()->type()->is_error())
this->set_is_error();
else if (!Type::are_identical(args->front()->type(),
- args->back()->type(), true, NULL))
+ args->back()->type(),
+ Type::COMPARE_TAGS, NULL))
this->report_error(_("complex arguments must have identical types"));
else if (args->front()->type()->float_type() == NULL)
this->report_error(_("complex arguments must have "
for (; pa != this->args_->end(); ++pa, ++pp)
{
go_assert(pp != fntype->parameters()->end());
- if (Type::are_identical(pp->type(), (*pa)->type(), true, NULL))
+ if (Type::are_identical(pp->type(), (*pa)->type(),
+ Type::COMPARE_TAGS, NULL))
args->push_back(*pa);
else
{
return Expression::make_error(loc);
}
- if (!Type::are_identical(mt->key_type(), this->index_->type(), false, NULL))
+ if (!Type::are_identical(mt->key_type(), this->index_->type(),
+ Type::COMPARE_ERRORS | Type::COMPARE_TAGS,
+ NULL))
{
if (this->index_->type()->interface_type() != NULL
&& !this->index_->is_variable())
Conditional_expression::do_type()
{
Type* result_type = Type::make_void_type();
- if (Type::are_identical(this->then_->type(), this->else_->type(), false,
+ if (Type::are_identical(this->then_->type(), this->else_->type(),
+ Type::COMPARE_ERRORS | Type::COMPARE_TAGS,
NULL))
result_type = this->then_->type();
else if (this->then_->is_nil_expression()
return TRAVERSE_CONTINUE;
}
-// Return whether two types are identical. If ERRORS_ARE_IDENTICAL,
-// then return true for all erroneous types; this is used to avoid
-// cascading errors. If REASON is not NULL, optionally set *REASON to
-// the reason the types are not identical.
+// Return whether two types are identical. If REASON is not NULL,
+// optionally set *REASON to the reason the types are not identical.
bool
-Type::are_identical(const Type* t1, const Type* t2, bool errors_are_identical,
+Type::are_identical(const Type* t1, const Type* t2, int flags,
std::string* reason)
-{
- return Type::are_identical_cmp_tags(t1, t2, COMPARE_TAGS,
- errors_are_identical, reason);
-}
-
-// Like are_identical, but with a CMP_TAGS parameter.
-
-bool
-Type::are_identical_cmp_tags(const Type* t1, const Type* t2, Cmp_tags cmp_tags,
- bool errors_are_identical, std::string* reason)
{
if (t1 == NULL || t2 == NULL)
{
// Something is wrong.
- return errors_are_identical ? true : t1 == t2;
+ return (flags & COMPARE_ERRORS) == 0 ? true : t1 == t2;
}
// Skip defined forward declarations. Ignore aliases.
// An undefined forward declaration is an error.
if (t1->forward_declaration_type() != NULL
|| t2->forward_declaration_type() != NULL)
- return errors_are_identical;
+ return (flags & COMPARE_ERRORS) == 0;
// Avoid cascading errors with error types.
if (t1->is_error_type() || t2->is_error_type())
{
- if (errors_are_identical)
+ if ((flags & COMPARE_ERRORS) == 0)
return true;
return t1->is_error_type() && t2->is_error_type();
}
case TYPE_FUNCTION:
return t1->function_type()->is_identical(t2->function_type(),
- false,
- cmp_tags,
- errors_are_identical,
- reason);
+ false, flags, reason);
case TYPE_POINTER:
- return Type::are_identical_cmp_tags(t1->points_to(), t2->points_to(),
- cmp_tags, errors_are_identical,
- reason);
+ return Type::are_identical(t1->points_to(), t2->points_to(), flags,
+ reason);
case TYPE_STRUCT:
- return t1->struct_type()->is_identical(t2->struct_type(), cmp_tags,
- errors_are_identical);
+ return t1->struct_type()->is_identical(t2->struct_type(), flags);
case TYPE_ARRAY:
- return t1->array_type()->is_identical(t2->array_type(), cmp_tags,
- errors_are_identical);
+ return t1->array_type()->is_identical(t2->array_type(), flags);
case TYPE_MAP:
- return t1->map_type()->is_identical(t2->map_type(), cmp_tags,
- errors_are_identical);
+ return t1->map_type()->is_identical(t2->map_type(), flags);
case TYPE_CHANNEL:
- return t1->channel_type()->is_identical(t2->channel_type(), cmp_tags,
- errors_are_identical);
+ return t1->channel_type()->is_identical(t2->channel_type(), flags);
case TYPE_INTERFACE:
- return t1->interface_type()->is_identical(t2->interface_type(), cmp_tags,
- errors_are_identical);
+ return t1->interface_type()->is_identical(t2->interface_type(), flags);
case TYPE_CALL_MULTIPLE_RESULT:
if (reason != NULL)
bool
Type::are_compatible_for_binop(const Type* lhs, const Type* rhs)
{
- if (Type::are_identical(lhs, rhs, true, NULL))
+ if (Type::are_identical(lhs, rhs, Type::COMPARE_TAGS, NULL))
return true;
// A constant of abstract bool type may be mixed with any bool type.
return true;
// Identical types are assignable.
- if (Type::are_identical(lhs, rhs, true, reason))
+ if (Type::are_identical(lhs, rhs, Type::COMPARE_TAGS, reason))
return true;
// Ignore aliases, except for error messages.
// and either LHS or RHS is not a named type.
if (((lhs->named_type() != NULL && rhs->named_type() == NULL)
|| (rhs->named_type() != NULL && lhs->named_type() == NULL))
- && Type::are_identical(lhs->base(), rhs->base(), true, reason))
+ && Type::are_identical(lhs->base(), rhs->base(), Type::COMPARE_TAGS,
+ reason))
return true;
// The types are assignable if LHS is an interface type and RHS
&& (lhs->named_type() == NULL || rhs->named_type() == NULL)
&& Type::are_identical(lhs->channel_type()->element_type(),
rhs->channel_type()->element_type(),
- true,
+ Type::COMPARE_TAGS,
reason))
return true;
// The types are convertible if they have identical underlying
// types, ignoring struct field tags.
if ((lhs->named_type() != NULL || rhs->named_type() != NULL)
- && Type::are_identical_cmp_tags(lhs->base(), rhs->base(), IGNORE_TAGS,
- true, reason))
+ && Type::are_identical(lhs->base(), rhs->base(), 0, reason))
return true;
// The types are convertible if they are both unnamed pointer types
&& rhs->points_to() != NULL
&& (lhs->points_to()->named_type() != NULL
|| rhs->points_to()->named_type() != NULL)
- && Type::are_identical_cmp_tags(lhs->points_to()->base(),
- rhs->points_to()->base(),
- IGNORE_TAGS,
- true,
- reason))
+ && Type::are_identical(lhs->points_to()->base(),
+ rhs->points_to()->base(),
+ 0, reason))
return true;
// Integer and floating point types are convertible to each other.
// Return a hash code for the type to be used for method lookup.
unsigned int
-Type::hash_for_method(Gogo* gogo) const
+Type::hash_for_method(Gogo* gogo, int flags) const
{
if (this->named_type() != NULL && this->named_type()->is_alias())
- return this->named_type()->real_type()->hash_for_method(gogo);
+ return this->named_type()->real_type()->hash_for_method(gogo, flags);
unsigned int ret = 0;
if (this->classification_ != TYPE_FORWARD)
ret += this->classification_;
- return ret + this->do_hash_for_method(gogo);
+ return ret + this->do_hash_for_method(gogo, flags);
}
// Default implementation of do_hash_for_method. This is appropriate
// for types with no subfields.
unsigned int
-Type::do_hash_for_method(Gogo*) const
+Type::do_hash_for_method(Gogo*, int) const
{
return 0;
}
go_assert(p->is_field_name("hash"));
unsigned int h;
if (name != NULL)
- h = name->hash_for_method(gogo);
+ h = name->hash_for_method(gogo, Type::COMPARE_TAGS);
else
- h = this->hash_for_method(gogo);
+ h = this->hash_for_method(gogo, Type::COMPARE_TAGS);
vals->push_back(Expression::make_integer_ul(h, p->type(), bloc));
++p;
// Hash code.
unsigned int
-Integer_type::do_hash_for_method(Gogo*) const
+Integer_type::do_hash_for_method(Gogo*, int) const
{
return ((this->bits_ << 4)
+ ((this->is_unsigned_ ? 1 : 0) << 8)
// Hash code.
unsigned int
-Float_type::do_hash_for_method(Gogo*) const
+Float_type::do_hash_for_method(Gogo*, int) const
{
return (this->bits_ << 4) + ((this->is_abstract_ ? 1 : 0) << 8);
}
// Hash code.
unsigned int
-Complex_type::do_hash_for_method(Gogo*) const
+Complex_type::do_hash_for_method(Gogo*, int) const
{
return (this->bits_ << 4) + ((this->is_abstract_ ? 1 : 0) << 8);
}
Function_type::is_valid_redeclaration(const Function_type* t,
std::string* reason) const
{
- if (!this->is_identical(t, false, COMPARE_TAGS, true, reason))
+ if (!this->is_identical(t, false, COMPARE_TAGS, reason))
return false;
// A redeclaration of a function is required to use the same names
bool
Function_type::is_identical(const Function_type* t, bool ignore_receiver,
- Cmp_tags cmp_tags, bool errors_are_identical,
- std::string* reason) const
+ int flags, std::string* reason) const
{
if (this->is_backend_function_type() != t->is_backend_function_type())
return false;
}
if (r1 != NULL)
{
- if (!Type::are_identical_cmp_tags(r1->type(), r2->type(), cmp_tags,
- errors_are_identical, reason))
+ if (!Type::are_identical(r1->type(), r2->type(), flags, reason))
{
if (reason != NULL && !reason->empty())
*reason = "receiver: " + *reason;
return false;
}
- if (!Type::are_identical_cmp_tags(p1->type(), p2->type(), cmp_tags,
- errors_are_identical, NULL))
+ if (!Type::are_identical(p1->type(), p2->type(), flags, NULL))
{
if (reason != NULL)
*reason = _("different parameter types");
return false;
}
- if (!Type::are_identical_cmp_tags(res1->type(), res2->type(),
- cmp_tags, errors_are_identical,
- NULL))
+ if (!Type::are_identical(res1->type(), res2->type(), flags, NULL))
{
if (reason != NULL)
*reason = _("different result types");
// Hash code.
unsigned int
-Function_type::do_hash_for_method(Gogo* gogo) const
+Function_type::do_hash_for_method(Gogo* gogo, int flags) const
{
unsigned int ret = 0;
// We ignore the receiver type for hash codes, because we need to
for (Typed_identifier_list::const_iterator p = this->parameters_->begin();
p != this->parameters_->end();
++p, ++shift)
- ret += p->type()->hash_for_method(gogo) << shift;
+ ret += p->type()->hash_for_method(gogo, flags) << shift;
}
if (this->results_ != NULL)
{
for (Typed_identifier_list::const_iterator p = this->results_->begin();
p != this->results_->end();
++p, ++shift)
- ret += p->type()->hash_for_method(gogo) << shift;
+ ret += p->type()->hash_for_method(gogo, flags) << shift;
}
if (this->is_varargs_)
ret += 1;
{
hash <<= 2;
hash = Type::hash_string(p->name(), hash);
- hash += p->type()->hash_for_method(NULL);
+ hash += p->type()->hash_for_method(NULL, Type::COMPARE_TAGS);
}
return hash;
}
++pa, ++pb)
{
if (pa->name() != pb->name()
- || !Type::are_identical(pa->type(), pb->type(), true, NULL))
+ || !Type::are_identical(pa->type(), pb->type(), Type::COMPARE_TAGS,
+ NULL))
return false;
}
return true;
// Hash code.
unsigned int
-Pointer_type::do_hash_for_method(Gogo* gogo) const
+Pointer_type::do_hash_for_method(Gogo* gogo, int flags) const
{
- return this->to_type_->hash_for_method(gogo) << 4;
+ return this->to_type_->hash_for_method(gogo, flags) << 4;
}
// Get the backend representation for a pointer type.
// Whether this type is identical to T.
bool
-Struct_type::is_identical(const Struct_type* t, Cmp_tags cmp_tags,
- bool errors_are_identical) const
+Struct_type::is_identical(const Struct_type* t, int flags) const
{
if (this->is_struct_incomparable_ != t->is_struct_incomparable_)
return false;
if (pf1->field_name() != pf2->field_name())
return false;
if (pf1->is_anonymous() != pf2->is_anonymous()
- || !Type::are_identical_cmp_tags(pf1->type(), pf2->type(), cmp_tags,
- errors_are_identical, NULL))
+ || !Type::are_identical(pf1->type(), pf2->type(), flags, NULL))
return false;
- if (cmp_tags == COMPARE_TAGS)
+ if ((flags & Type::COMPARE_TAGS) != 0)
{
if (!pf1->has_tag())
{
// Hash code.
unsigned int
-Struct_type::do_hash_for_method(Gogo* gogo) const
+Struct_type::do_hash_for_method(Gogo* gogo, int flags) const
{
unsigned int ret = 0;
if (this->fields() != NULL)
for (Struct_field_list::const_iterator pf = this->fields()->begin();
pf != this->fields()->end();
++pf)
- ret = (ret << 1) + pf->type()->hash_for_method(gogo);
+ ret = (ret << 1) + pf->type()->hash_for_method(gogo, flags);
}
ret <<= 2;
if (this->is_struct_incomparable_)
// Whether two array types are identical.
bool
-Array_type::is_identical(const Array_type* t, Cmp_tags cmp_tags,
- bool errors_are_identical) const
+Array_type::is_identical(const Array_type* t, int flags) const
{
- if (!Type::are_identical_cmp_tags(this->element_type(), t->element_type(),
- cmp_tags, errors_are_identical, NULL))
+ if (!Type::are_identical(this->element_type(), t->element_type(),
+ flags, NULL))
return false;
if (this->is_array_incomparable_ != t->is_array_incomparable_)
// Array type hash code.
unsigned int
-Array_type::do_hash_for_method(Gogo* gogo) const
+Array_type::do_hash_for_method(Gogo* gogo, int flags) const
{
unsigned int ret;
// There is no very convenient way to get a hash code for the
// length.
- ret = this->element_type_->hash_for_method(gogo) + 1;
+ ret = this->element_type_->hash_for_method(gogo, flags) + 1;
if (this->is_array_incomparable_)
ret <<= 1;
return ret;
// Whether two map types are identical.
bool
-Map_type::is_identical(const Map_type* t, Cmp_tags cmp_tags,
- bool errors_are_identical) const
+Map_type::is_identical(const Map_type* t, int flags) const
{
- return (Type::are_identical_cmp_tags(this->key_type(), t->key_type(),
- cmp_tags, errors_are_identical, NULL)
- && Type::are_identical_cmp_tags(this->val_type(), t->val_type(),
- cmp_tags, errors_are_identical,
- NULL));
+ return (Type::are_identical(this->key_type(), t->key_type(), flags, NULL)
+ && Type::are_identical(this->val_type(), t->val_type(), flags,
+ NULL));
}
// Hash code.
unsigned int
-Map_type::do_hash_for_method(Gogo* gogo) const
+Map_type::do_hash_for_method(Gogo* gogo, int flags) const
{
- return (this->key_type_->hash_for_method(gogo)
- + this->val_type_->hash_for_method(gogo)
+ return (this->key_type_->hash_for_method(gogo, flags)
+ + this->val_type_->hash_for_method(gogo, flags)
+ 2);
}
// Hash code.
unsigned int
-Channel_type::do_hash_for_method(Gogo* gogo) const
+Channel_type::do_hash_for_method(Gogo* gogo, int flags) const
{
unsigned int ret = 0;
if (this->may_send_)
if (this->may_receive_)
ret += 2;
if (this->element_type_ != NULL)
- ret += this->element_type_->hash_for_method(gogo) << 2;
+ ret += this->element_type_->hash_for_method(gogo, flags) << 2;
return ret << 3;
}
// Whether this type is the same as T.
bool
-Channel_type::is_identical(const Channel_type* t, Cmp_tags cmp_tags,
- bool errors_are_identical) const
+Channel_type::is_identical(const Channel_type* t, int flags) const
{
- if (!Type::are_identical_cmp_tags(this->element_type(), t->element_type(),
- cmp_tags, errors_are_identical, NULL))
+ if (!Type::are_identical(this->element_type(), t->element_type(), flags,
+ NULL))
return false;
return (this->may_send_ == t->may_send_
&& this->may_receive_ == t->may_receive_);
// Whether this type is identical with T.
bool
-Interface_type::is_identical(const Interface_type* t, Cmp_tags cmp_tags,
- bool errors_are_identical) const
+Interface_type::is_identical(const Interface_type* t, int flags) const
{
// If methods have not been finalized, then we are asking whether
// func redeclarations are the same. This is an error, so for
if (p1 == this->all_methods_->end())
break;
if (p1->name() != p2->name()
- || !Type::are_identical_cmp_tags(p1->type(), p2->type(), cmp_tags,
- errors_are_identical, NULL))
+ || !Type::are_identical(p1->type(), p2->type(), flags, NULL))
break;
}
}
std::string subreason;
- if (!Type::are_identical(p->type(), m->type(), true, &subreason))
+ if (!Type::are_identical(p->type(), m->type(), Type::COMPARE_TAGS,
+ &subreason))
{
if (reason != NULL)
{
// Hash code.
unsigned int
-Interface_type::do_hash_for_method(Gogo*) const
+Interface_type::do_hash_for_method(Gogo*, int) const
{
go_assert(this->methods_are_finalized_);
unsigned int ret = 0;
Function_type* m_fn_type = m->type()->function_type();
go_assert(p_fn_type != NULL && m_fn_type != NULL);
std::string subreason;
- if (!p_fn_type->is_identical(m_fn_type, true, COMPARE_TAGS, true,
+ if (!p_fn_type->is_identical(m_fn_type, true, Type::COMPARE_TAGS,
&subreason))
{
if (reason != NULL)
// hash on the name itself.
unsigned int
-Named_type::do_hash_for_method(Gogo* gogo) const
+Named_type::do_hash_for_method(Gogo* gogo, int) const
{
if (this->is_error_)
return 0;
verify()
{ return this->do_verify(); }
- // Return true if two types are identical. If ERRORS_ARE_IDENTICAL,
- // returns that an erroneous type is identical to any other type;
- // this is used to avoid cascading errors. If this returns false,
- // and REASON is not NULL, it may set *REASON.
- static bool
- are_identical(const Type* lhs, const Type* rhs, bool errors_are_identical,
- std::string* reason);
+ // Bit flags to pass to are_identical and friends.
- // An argument to are_identical_cmp_tags, indicating whether or not
- // to compare struct field tags.
- enum Cmp_tags {
- COMPARE_TAGS,
- IGNORE_TAGS
- };
+ // Treat error types as their own distinct type. Sometimes we
+ // ignore error types--treat them as identical to every other
+ // type--to avoid cascading errors.
+ static const int COMPARE_ERRORS = 1;
+
+ // Compare struct field tags when comparing structs. We ignore
+ // struct field tags for purposes of type conversion.
+ static const int COMPARE_TAGS = 2;
- // Return true if two types are identical. This is like the
- // are_identical function, but also takes a CMP_TAGS argument
- // indicating whether to compare struct tags. Otherwise the
- // parameters are as for are_identical.
+ // Return true if two types are identical. If this returns false,
+ // and REASON is not NULL, it may set *REASON.
static bool
- are_identical_cmp_tags(const Type* lhs, const Type* rhs,
- Cmp_tags, bool errors_are_identical,
- std::string* reason);
+ are_identical(const Type* lhs, const Type* rhs, int flags,
+ std::string* reason);
// Return true if two types are compatible for use in a binary
// operation, other than a shift, comparison, or channel send. This
// Types which are equivalent according to are_identical will have
// the same hash code.
unsigned int
- hash_for_method(Gogo*) const;
+ hash_for_method(Gogo*, int) const;
// Return the type classification.
Type_classification
{ return true; }
virtual unsigned int
- do_hash_for_method(Gogo*) const;
+ do_hash_for_method(Gogo*, int) const;
virtual Btype*
do_get_backend(Gogo*) = 0;
bool in_heap_;
};
-// Type hash table operations.
+// Type hash table operations, treating aliases as identical to the
+// types that they alias.
class Type_hash_identical
{
public:
unsigned int
operator()(const Type* type) const
- { return type->hash_for_method(NULL); }
+ {
+ return type->hash_for_method(NULL,
+ Type::COMPARE_ERRORS | Type::COMPARE_TAGS);
+ }
};
class Type_identical
public:
bool
operator()(const Type* t1, const Type* t2) const
- { return Type::are_identical(t1, t2, false, NULL); }
+ {
+ return Type::are_identical(t1, t2,
+ Type::COMPARE_ERRORS | Type::COMPARE_TAGS,
+ NULL);
+ }
};
// An identifier with a type.
{ return true; }
unsigned int
- do_hash_for_method(Gogo*) const;
+ do_hash_for_method(Gogo*, int) const;
Btype*
do_get_backend(Gogo*);
{ return true; }
unsigned int
- do_hash_for_method(Gogo*) const;
+ do_hash_for_method(Gogo*, int) const;
Btype*
do_get_backend(Gogo*);
{ return true; }
unsigned int
- do_hash_for_method(Gogo*) const;
+ do_hash_for_method(Gogo*, int) const;
Btype*
do_get_backend(Gogo*);
// Whether this type is the same as T.
bool
- is_identical(const Function_type* t, bool ignore_receiver,
- Cmp_tags, bool errors_are_identical, std::string*) const;
+ is_identical(const Function_type* t, bool ignore_receiver, int flags,
+ std::string*) const;
// Record that this is a varargs function.
void
{ return false; }
unsigned int
- do_hash_for_method(Gogo*) const;
+ do_hash_for_method(Gogo*, int) const;
Btype*
do_get_backend(Gogo*);
{ return true; }
unsigned int
- do_hash_for_method(Gogo*) const;
+ do_hash_for_method(Gogo*, int) const;
Btype*
do_get_backend(Gogo*);
// Whether this type is identical with T.
bool
- is_identical(const Struct_type* t, Cmp_tags,
- bool errors_are_identical) const;
+ is_identical(const Struct_type* t, int) const;
// Return whether NAME is a local field which is not exported. This
// is only used for better error reporting.
has_any_methods() const
{ return this->all_methods_ != NULL; }
- // Return the methods for tihs type. This should only be called
+ // Return the methods for this type. This should only be called
// after the finalize_methods pass.
const Methods*
methods() const
do_in_heap();
unsigned int
- do_hash_for_method(Gogo*) const;
+ do_hash_for_method(Gogo*, int) const;
Btype*
do_get_backend(Gogo*);
// Whether this type is identical with T.
bool
- is_identical(const Array_type* t, Cmp_tags,
- bool errors_are_identical) const;
+ is_identical(const Array_type* t, int) const;
// Return an expression for the pointer to the values in an array.
Expression*
{ return this->length_ == NULL || this->element_type_->in_heap(); }
unsigned int
- do_hash_for_method(Gogo*) const;
+ do_hash_for_method(Gogo*, int) const;
Btype*
do_get_backend(Gogo*);
// Whether this type is identical with T.
bool
- is_identical(const Map_type* t, Cmp_tags,
- bool errors_are_identical) const;
+ is_identical(const Map_type* t, int) const;
// Import a map type.
static Map_type*
}
unsigned int
- do_hash_for_method(Gogo*) const;
+ do_hash_for_method(Gogo*, int) const;
Btype*
do_get_backend(Gogo*);
// Whether this type is identical with T.
bool
- is_identical(const Channel_type* t, Cmp_tags,
- bool errors_are_identical) const;
+ is_identical(const Channel_type* t, int) const;
// Import a channel type.
static Channel_type*
{ return true; }
unsigned int
- do_hash_for_method(Gogo*) const;
+ do_hash_for_method(Gogo*, int) const;
Btype*
do_get_backend(Gogo*);
// Whether this type is identical with T. REASON is as in
// implements_interface.
bool
- is_identical(const Interface_type* t, Cmp_tags,
- bool errors_are_identical) const;
+ is_identical(const Interface_type* t, int) const;
// Whether we can assign T to this type. is_identical is known to
// be false.
{ return true; }
unsigned int
- do_hash_for_method(Gogo*) const;
+ do_hash_for_method(Gogo*, int) const;
Btype*
do_get_backend(Gogo*);
{ return this->in_heap_ && this->type_->in_heap(); }
unsigned int
- do_hash_for_method(Gogo*) const;
+ do_hash_for_method(Gogo*, int) const;
Btype*
do_get_backend(Gogo*);
{ return this->real_type()->in_heap(); }
unsigned int
- do_hash_for_method(Gogo* gogo) const
- { return this->real_type()->hash_for_method(gogo); }
+ do_hash_for_method(Gogo* gogo, int flags) const
+ { return this->real_type()->hash_for_method(gogo, flags); }
Btype*
do_get_backend(Gogo* gogo);