protected:
bool
- do_compare_is_identity(Gogo*) const
+ do_compare_is_identity(Gogo*)
{ return false; }
Btype*
protected:
bool
- do_compare_is_identity(Gogo*) const
+ do_compare_is_identity(Gogo*)
{ return false; }
Btype*
protected:
bool
- do_compare_is_identity(Gogo*) const
+ do_compare_is_identity(Gogo*)
{ return true; }
Btype*
protected:
bool
- do_compare_is_identity(Gogo*) const
+ do_compare_is_identity(Gogo*)
{ return false; }
Btype*
protected:
bool
- do_compare_is_identity(Gogo*) const
+ do_compare_is_identity(Gogo*)
{ return false; }
Btype*
}
bool
- do_compare_is_identity(Gogo*) const
+ do_compare_is_identity(Gogo*)
{ return false; }
Btype*
// comparisons.
bool
-Struct_type::do_compare_is_identity(Gogo* gogo) const
+Struct_type::do_compare_is_identity(Gogo* gogo)
{
const Struct_field_list* fields = this->fields_;
if (fields == NULL)
return false;
offset += field_size;
}
+
+ unsigned int struct_size;
+ if (!this->backend_type_size(gogo, &struct_size))
+ return false;
+ if (offset != struct_size)
+ {
+ // Trailing padding may not be zero when on the stack.
+ return false;
+ }
+
return true;
}
// Whether we can use memcmp to compare this array.
bool
-Array_type::do_compare_is_identity(Gogo* gogo) const
+Array_type::do_compare_is_identity(Gogo* gogo)
{
if (this->length_ == NULL)
return false;
// function.
bool
-Named_type::do_compare_is_identity(Gogo* gogo) const
+Named_type::do_compare_is_identity(Gogo* gogo)
{
// We don't use this->seen_ here because compare_is_identity may
// call base() later, and that will mess up if seen_ is set here.
// identity function which gets nothing but a pointer to the value
// and a size.
bool
- compare_is_identity(Gogo* gogo) const
+ compare_is_identity(Gogo* gogo)
{ return this->do_compare_is_identity(gogo); }
// Return a hash code for this type for the method hash table.
{ return false; }
virtual bool
- do_compare_is_identity(Gogo*) const = 0;
+ do_compare_is_identity(Gogo*) = 0;
virtual unsigned int
do_hash_for_method(Gogo*) const;
protected:
bool
- do_compare_is_identity(Gogo*) const
+ do_compare_is_identity(Gogo*)
{ return true; }
unsigned int
protected:
bool
- do_compare_is_identity(Gogo*) const
+ do_compare_is_identity(Gogo*)
{ return false; }
unsigned int
protected:
bool
- do_compare_is_identity(Gogo*) const
+ do_compare_is_identity(Gogo*)
{ return false; }
unsigned int
{ return true; }
bool
- do_compare_is_identity(Gogo*) const
+ do_compare_is_identity(Gogo*)
{ return false; }
Btype*
{ return true; }
bool
- do_compare_is_identity(Gogo*) const
+ do_compare_is_identity(Gogo*)
{ return false; }
unsigned int
{ return true; }
bool
- do_compare_is_identity(Gogo*) const
+ do_compare_is_identity(Gogo*)
{ return true; }
unsigned int
do_has_pointer() const;
bool
- do_compare_is_identity(Gogo*) const;
+ do_compare_is_identity(Gogo*);
unsigned int
do_hash_for_method(Gogo*) const;
}
bool
- do_compare_is_identity(Gogo*) const;
+ do_compare_is_identity(Gogo*);
unsigned int
do_hash_for_method(Gogo*) const;
{ return true; }
bool
- do_compare_is_identity(Gogo*) const
+ do_compare_is_identity(Gogo*)
{ return false; }
unsigned int
{ return true; }
bool
- do_compare_is_identity(Gogo*) const
+ do_compare_is_identity(Gogo*)
{ return true; }
unsigned int
{ return true; }
bool
- do_compare_is_identity(Gogo*) const
+ do_compare_is_identity(Gogo*)
{ return false; }
unsigned int
do_has_pointer() const;
bool
- do_compare_is_identity(Gogo*) const;
+ do_compare_is_identity(Gogo*);
unsigned int
do_hash_for_method(Gogo*) const;
// function exits.
mutable bool seen_;
// Like seen_, but used only by do_compare_is_identity.
- mutable bool seen_in_compare_is_identity_;
+ bool seen_in_compare_is_identity_;
// Like seen_, but used only by do_get_backend.
bool seen_in_get_backend_;
};
{ return this->real_type()->has_pointer(); }
bool
- do_compare_is_identity(Gogo* gogo) const
+ do_compare_is_identity(Gogo* gogo)
{ return this->real_type()->compare_is_identity(gogo); }
unsigned int