Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 21 additions & 7 deletions gcc/jit/jit-recording.h
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,14 @@ class type : public memento

virtual bool is_same_type_as (type *other)
{
if (is_int ()
&& other->is_int ()
&& get_size () == other->get_size ()
&& is_signed () == other->is_signed ())
{
/* LHS (this) is an integer of the same size and sign as rtype. */
return true;
}
return this == other;
}

Expand All @@ -609,6 +617,7 @@ class type : public memento
virtual type *is_volatile () { return NULL; }
virtual type *is_restrict () { return NULL; }
virtual type *is_const () { return NULL; }
virtual type *is_aligned () { return NULL; }
virtual type *is_array () = 0;
virtual struct_ *is_struct () { return NULL; }
virtual bool is_union () const { return false; }
Expand Down Expand Up @@ -672,13 +681,6 @@ class memento_of_get_type : public type
accept it: */
return true;
}
} else if (is_int ()
&& rtype->is_int ()
&& get_size () == rtype->get_size ()
&& is_signed () == rtype->is_signed ())
{
/* LHS (this) is an integer of the same size and sign as rtype. */
return true;
}

return type::accepts_writes_from (rtype);
Expand Down Expand Up @@ -882,6 +884,18 @@ class memento_of_get_aligned : public decorated_type
return result;
}

bool is_same_type_as (type *other) final override
{
// TODO: check if outermost alignment is equal?
if (!other->is_aligned ())
{
return m_other_type->is_same_type_as (other);
}
return m_other_type->is_same_type_as (other->is_aligned ());
}

type *is_aligned () final override { return m_other_type; }

/* Strip off the alignment, giving the underlying type. */
type *unqualified () final override { return m_other_type; }

Expand Down