Skip to content

Commit

Permalink
Add two new methods to Value_Range.
Browse files Browse the repository at this point in the history
This is for upcoming work in this area.

gcc/ChangeLog:

	* value-range.h (Value_Range::Value_Range): New.
	(Value_Range::contains_p): New.
  • Loading branch information
aldyh committed Apr 18, 2023
1 parent 027a94b commit d5904f3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions gcc/value-range.h
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,7 @@ class Value_Range
Value_Range ();
Value_Range (const vrange &r);
Value_Range (tree type);
Value_Range (tree, tree, value_range_kind kind = VR_RANGE);
Value_Range (const Value_Range &);
void set_type (tree type);
vrange& operator= (const vrange &);
Expand All @@ -526,6 +527,7 @@ class Value_Range
void set_undefined () { m_vrange->set_undefined (); }
bool union_ (const vrange &r) { return m_vrange->union_ (r); }
bool intersect (const vrange &r) { return m_vrange->intersect (r); }
bool contains_p (tree cst) const { return m_vrange->contains_p (cst); }
bool singleton_p (tree *result = NULL) const
{ return m_vrange->singleton_p (result); }
bool zero_p () const { return m_vrange->zero_p (); }
Expand Down Expand Up @@ -563,6 +565,13 @@ Value_Range::Value_Range (tree type)
init (type);
}

inline
Value_Range::Value_Range (tree min, tree max, value_range_kind kind)
{
init (TREE_TYPE (min));
set (min, max, kind);
}

inline
Value_Range::Value_Range (const Value_Range &r)
{
Expand Down

0 comments on commit d5904f3

Please sign in to comment.