return false;
}
-// Return TRUE if the range in storage is equal to R.
+// Return TRUE if the range in storage is equal to R. It is the
+// caller's responsibility to verify that the type of the range in
+// storage matches that of R.
bool
-vrange_storage::equal_p (const vrange &r, tree type) const
+vrange_storage::equal_p (const vrange &r) const
{
if (is_a <irange> (r))
{
const irange_storage *s = static_cast <const irange_storage *> (this);
- return s->equal_p (as_a <irange> (r), type);
+ return s->equal_p (as_a <irange> (r));
}
if (is_a <frange> (r))
{
const frange_storage *s = static_cast <const frange_storage *> (this);
- return s->equal_p (as_a <frange> (r), type);
+ return s->equal_p (as_a <frange> (r));
}
gcc_unreachable ();
}
}
bool
-irange_storage::equal_p (const irange &r, tree type) const
+irange_storage::equal_p (const irange &r) const
{
if (m_kind == VR_UNDEFINED || r.undefined_p ())
return m_kind == r.m_kind;
if (m_kind == VR_VARYING || r.varying_p ())
- return m_kind == r.m_kind && types_compatible_p (r.type (), type);
-
- tree rtype = r.type ();
- if (!types_compatible_p (rtype, type))
- return false;
+ return m_kind == r.m_kind;
// ?? We could make this faster by doing the comparison in place,
// without going through get_irange.
int_range_max tmp;
- get_irange (tmp, rtype);
+ get_irange (tmp, r.type ());
return tmp == r;
}
}
bool
-frange_storage::equal_p (const frange &r, tree type) const
+frange_storage::equal_p (const frange &r) const
{
if (r.undefined_p ())
return m_kind == VR_UNDEFINED;
- tree rtype = type;
- if (!types_compatible_p (rtype, type))
- return false;
-
frange tmp;
- get_frange (tmp, rtype);
+ get_frange (tmp, r.type ());
return tmp == r;
}
void get_vrange (vrange &r, tree type) const;
void set_vrange (const vrange &r);
bool fits_p (const vrange &r) const;
- bool equal_p (const vrange &r, tree type) const;
+ bool equal_p (const vrange &r) const;
protected:
// Stack initialization disallowed.
vrange_storage () { }
static irange_storage *alloc (vrange_internal_alloc &, const irange &);
void set_irange (const irange &r);
void get_irange (irange &r, tree type) const;
- bool equal_p (const irange &r, tree type) const;
+ bool equal_p (const irange &r) const;
bool fits_p (const irange &r) const;
void dump () const;
private:
static frange_storage *alloc (vrange_internal_alloc &, const frange &r);
void set_frange (const frange &r);
void get_frange (frange &r, tree type) const;
- bool equal_p (const frange &r, tree type) const;
+ bool equal_p (const frange &r) const;
bool fits_p (const frange &) const;
private:
frange_storage (const frange &r) { set_frange (r); }