public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [COMMITTED] Add two new methods to Value_Range.
@ 2023-04-18  5:43 Aldy Hernandez
  0 siblings, 0 replies; only message in thread
From: Aldy Hernandez @ 2023-04-18  5:43 UTC (permalink / raw)
  To: GCC patches; +Cc: Andrew MacLeod, Aldy Hernandez

This is for upcoming work in this area.

gcc/ChangeLog:

	* value-range.h (Value_Range::Value_Range): New.
	(Value_Range::contains_p): New.
---
 gcc/value-range.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/gcc/value-range.h b/gcc/value-range.h
index e9439bb7d3c..f8aa0ca7bec 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)
 {
-- 
2.39.2


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-04-18  5:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-18  5:43 [COMMITTED] Add two new methods to Value_Range Aldy Hernandez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).