public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r15-87] Cleanups to unsupported_range.
@ 2024-05-01 7:41 Aldy Hernandez
0 siblings, 0 replies; only message in thread
From: Aldy Hernandez @ 2024-05-01 7:41 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:1b5732de7e3980aa5197b1ac818f48f1ce9f87ab
commit r15-87-g1b5732de7e3980aa5197b1ac818f48f1ce9f87ab
Author: Aldy Hernandez <aldyh@redhat.com>
Date: Tue Apr 30 18:54:11 2024 +0200
Cleanups to unsupported_range.
Here are some cleanups to unsupported_range so the assignment operator
takes an unsupported_range and behaves like the other ranges. This
makes subsequent cleanups easier.
gcc/ChangeLog:
* value-range.cc (unsupported_range::union_): Cast vrange to
unsupported_range.
(unsupported_range::intersect): Same.
(unsupported_range::operator=): Make argument an unsupported_range.
* value-range.h: New constructor.
Diff:
---
gcc/value-range.cc | 10 +++++++---
gcc/value-range.h | 7 ++++++-
2 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/gcc/value-range.cc b/gcc/value-range.cc
index ca6d521c625..7250115261f 100644
--- a/gcc/value-range.cc
+++ b/gcc/value-range.cc
@@ -147,8 +147,10 @@ unsupported_range::set_varying (tree)
}
bool
-unsupported_range::union_ (const vrange &r)
+unsupported_range::union_ (const vrange &v)
{
+ const unsupported_range &r = as_a <unsupported_range> (v);
+
if (r.undefined_p () || varying_p ())
return false;
if (undefined_p () || r.varying_p ())
@@ -161,8 +163,10 @@ unsupported_range::union_ (const vrange &r)
}
bool
-unsupported_range::intersect (const vrange &r)
+unsupported_range::intersect (const vrange &v)
{
+ const unsupported_range &r = as_a <unsupported_range> (v);
+
if (undefined_p () || r.varying_p ())
return false;
if (r.undefined_p ())
@@ -216,7 +220,7 @@ unsupported_range::fits_p (const vrange &) const
}
unsupported_range &
-unsupported_range::operator= (const vrange &r)
+unsupported_range::operator= (const unsupported_range &r)
{
if (r.undefined_p ())
set_undefined ();
diff --git a/gcc/value-range.h b/gcc/value-range.h
index 11c73faca1b..471f362f388 100644
--- a/gcc/value-range.h
+++ b/gcc/value-range.h
@@ -389,6 +389,11 @@ public:
{
set_undefined ();
}
+ unsupported_range (const unsupported_range &src)
+ : vrange (VR_UNKNOWN)
+ {
+ unsupported_range::operator= (src);
+ }
void set (tree min, tree, value_range_kind = VR_RANGE) final override;
tree type () const final override;
bool supports_type_p (const_tree) const final override;
@@ -405,7 +410,7 @@ public:
void set_zero (tree type) final override;
void set_nonnegative (tree type) final override;
bool fits_p (const vrange &) const final override;
- unsupported_range& operator= (const vrange &r);
+ unsupported_range& operator= (const unsupported_range &r);
tree lbound () const final override;
tree ubound () const final override;
};
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-05-01 7:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-01 7:41 [gcc r15-87] Cleanups to unsupported_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).