aboutsummaryrefslogtreecommitdiff
path: root/gcc/value-range.h
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@redhat.com>2023-02-23 09:00:04 +0100
committerAldy Hernandez <aldyh@redhat.com>2023-04-18 07:39:40 +0200
commitd5904f356ce327a45964eac449fc3bdd4787b24b (patch)
treebd2ef64e14c22f7f4b0fecc47e06d55fd33dfbb9 /gcc/value-range.h
parent027a94b00759ad19a9b8b99b36819b6f60d5560e (diff)
downloadgcc-d5904f356ce327a45964eac449fc3bdd4787b24b.zip
gcc-d5904f356ce327a45964eac449fc3bdd4787b24b.tar.gz
gcc-d5904f356ce327a45964eac449fc3bdd4787b24b.tar.bz2
Add two new methods to Value_Range.
This is for upcoming work in this area. gcc/ChangeLog: * value-range.h (Value_Range::Value_Range): New. (Value_Range::contains_p): New.
Diffstat (limited to 'gcc/value-range.h')
-rw-r--r--gcc/value-range.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/value-range.h b/gcc/value-range.h
index e9439bb..f8aa0ca 100644
--- a/gcc/value-range.h
+++ b/gcc/value-range.h
@@ -505,6 +505,7 @@ public:
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 &);
@@ -526,6 +527,7 @@ public:
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 (); }
@@ -564,6 +566,13 @@ Value_Range::Value_Range (tree 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)
{
m_vrange = r.m_vrange;