diff options
author | Aldy Hernandez <aldyh@redhat.com> | 2023-05-16 22:21:12 +0200 |
---|---|---|
committer | Aldy Hernandez <aldyh@redhat.com> | 2023-05-17 16:08:48 +0200 |
commit | f513a10e4df44d7bcc8d1c2659ec8660ac938f9e (patch) | |
tree | 7e7f8430c33034a3e00040a4296406ef2dd70147 /gcc/value-range.h | |
parent | 615e3d1e9306dbf27c5af3bc6ebabb697dcc4297 (diff) | |
download | gcc-f513a10e4df44d7bcc8d1c2659ec8660ac938f9e.zip gcc-f513a10e4df44d7bcc8d1c2659ec8660ac938f9e.tar.gz gcc-f513a10e4df44d7bcc8d1c2659ec8660ac938f9e.tar.bz2 |
Add Value_Range::operator=.
gcc/ChangeLog:
* value-range.h (Value_Range::operator=): New.
Diffstat (limited to 'gcc/value-range.h')
-rw-r--r-- | gcc/value-range.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/value-range.h b/gcc/value-range.h index ab982d1..af81d60 100644 --- a/gcc/value-range.h +++ b/gcc/value-range.h @@ -523,6 +523,7 @@ public: Value_Range (const Value_Range &); void set_type (tree type); vrange& operator= (const vrange &); + Value_Range& operator= (const Value_Range &); bool operator== (const Value_Range &r) const; bool operator!= (const Value_Range &r) const; operator vrange &(); @@ -642,6 +643,30 @@ Value_Range::operator= (const vrange &r) return *m_vrange; } +inline Value_Range & +Value_Range::operator= (const Value_Range &r) +{ + if (r.m_vrange == &r.m_irange) + { + m_irange = r.m_irange; + m_vrange = &m_irange; + } + else if (r.m_vrange == &r.m_frange) + { + m_frange = r.m_frange; + m_vrange = &m_frange; + } + else if (r.m_vrange == &r.m_unsupported) + { + m_unsupported = r.m_unsupported; + m_vrange = &m_unsupported; + } + else + gcc_unreachable (); + + return *this; +} + inline bool Value_Range::operator== (const Value_Range &r) const { |