diff options
author | Aldy Hernandez <aldyh@redhat.com> | 2024-04-30 18:54:11 +0200 |
---|---|---|
committer | Aldy Hernandez <aldyh@redhat.com> | 2024-05-01 09:37:04 +0200 |
commit | 1b5732de7e3980aa5197b1ac818f48f1ce9f87ab (patch) | |
tree | fdd78a646962322edc664c7442e8328782f34702 /gcc/value-range.cc | |
parent | 3032ebf0c9b769f02f494e97417a1b68ad59c884 (diff) | |
download | gcc-1b5732de7e3980aa5197b1ac818f48f1ce9f87ab.zip gcc-1b5732de7e3980aa5197b1ac818f48f1ce9f87ab.tar.gz gcc-1b5732de7e3980aa5197b1ac818f48f1ce9f87ab.tar.bz2 |
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.
Diffstat (limited to 'gcc/value-range.cc')
-rw-r--r-- | gcc/value-range.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/value-range.cc b/gcc/value-range.cc index ca6d521..7250115 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 (); |