]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Add an irange setter for wide_ints.
authorAldy Hernandez <aldyh@redhat.com>
Tue, 27 Sep 2022 06:00:40 +0000 (08:00 +0200)
committerAldy Hernandez <aldyh@redhat.com>
Tue, 27 Sep 2022 08:43:11 +0000 (10:43 +0200)
Just the same way as we have real_value setters for franges, we should
have a wide_int version for irange.  This matches the irange
constructor for wide_ints, and paves the way for the eventual
conversion of irange to wide ints.

gcc/ChangeLog:

* value-range.h (irange::set): New version taking wide_int_ref.

gcc/value-range.h

index 413e54bda6f47358a55bf0fe0f5778683da4d186..556e31aece1a8ca24cc6635f11ff54164edbddd6 100644 (file)
@@ -117,6 +117,8 @@ class GTY((user)) irange : public vrange
 public:
   // In-place setters.
   virtual void set (tree, tree, value_range_kind = VR_RANGE) override;
+  void set (tree type, const wide_int_ref &, const wide_int_ref &,
+           value_range_kind = VR_RANGE);
   virtual void set_nonzero (tree type) override;
   virtual void set_zero (tree type) override;
   virtual void set_nonnegative (tree type) override;
@@ -687,6 +689,13 @@ irange::varying_compatible_p () const
   return true;
 }
 
+inline void
+irange::set (tree type, const wide_int_ref &min, const wide_int_ref &max,
+            value_range_kind kind)
+{
+  set (wide_int_to_tree (type, min), wide_int_to_tree (type, max), kind);
+}
+
 inline bool
 vrange::varying_p () const
 {