From: Aldy Hernandez Date: Thu, 23 Feb 2023 08:00:04 +0000 (+0100) Subject: Add two new methods to Value_Range. X-Git-Tag: basepoints/gcc-15~10122 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d5904f356ce327a45964eac449fc3bdd4787b24b;p=thirdparty%2Fgcc.git 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. --- diff --git a/gcc/value-range.h b/gcc/value-range.h index e9439bb7d3c2..f8aa0ca7bec2 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 (); } @@ -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) {