From: Aldy Hernandez <aldyh@redhat.com>
To: GCC patches <gcc-patches@gcc.gnu.org>
Subject: [COMMITTED] const_tree conversion of vrange::supports_*
Date: Mon, 1 Aug 2022 08:15:39 +0200 [thread overview]
Message-ID: <20220801061540.229684-2-aldyh@redhat.com> (raw)
In-Reply-To: <20220801061540.229684-1-aldyh@redhat.com>
Make all vrange::supports_*_p methods const_tree as they can end up
being called from functions that are const_tree.
Tested on x86-64 Linux.
gcc/ChangeLog:
* value-range.cc (vrange::supports_type_p): Use const_tree.
(irange::supports_type_p): Same.
(frange::supports_type_p): Same.
* value-range.h (Value_Range::supports_type_p): Same.
(irange::supports_p): Same.
---
gcc/value-range.cc | 6 +++---
gcc/value-range.h | 16 ++++++++--------
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/gcc/value-range.cc b/gcc/value-range.cc
index 2923f4f5a0e..7adbf55c6a6 100644
--- a/gcc/value-range.cc
+++ b/gcc/value-range.cc
@@ -105,7 +105,7 @@ vrange::type () const
}
bool
-vrange::supports_type_p (tree) const
+vrange::supports_type_p (const_tree) const
{
return false;
}
@@ -229,7 +229,7 @@ vrange::dump (FILE *file) const
}
bool
-irange::supports_type_p (tree type) const
+irange::supports_type_p (const_tree type) const
{
return supports_p (type);
}
@@ -416,7 +416,7 @@ frange::operator== (const frange &src) const
}
bool
-frange::supports_type_p (tree type) const
+frange::supports_type_p (const_tree type) const
{
return supports_p (type);
}
diff --git a/gcc/value-range.h b/gcc/value-range.h
index e43fbe30f27..c6ab955c407 100644
--- a/gcc/value-range.h
+++ b/gcc/value-range.h
@@ -78,7 +78,7 @@ public:
virtual void accept (const class vrange_visitor &v) const = 0;
virtual void set (tree, tree, value_range_kind = VR_RANGE);
virtual tree type () const;
- virtual bool supports_type_p (tree type) const;
+ virtual bool supports_type_p (const_tree type) const;
virtual void set_varying (tree type);
virtual void set_undefined ();
virtual bool union_ (const vrange &);
@@ -122,8 +122,8 @@ public:
virtual void set_undefined () override;
// Range types.
- static bool supports_p (tree type);
- virtual bool supports_type_p (tree type) const override;
+ static bool supports_p (const_tree type);
+ virtual bool supports_type_p (const_tree type) const override;
virtual tree type () const override;
// Iteration over sub-ranges.
@@ -336,7 +336,7 @@ class frange : public vrange
public:
frange ();
frange (const frange &);
- static bool supports_p (tree type)
+ static bool supports_p (const_tree type)
{
// Disabled until floating point range-ops come live.
return 0 && SCALAR_FLOAT_TYPE_P (type);
@@ -347,7 +347,7 @@ public:
virtual void set_undefined () override;
virtual bool union_ (const vrange &) override;
virtual bool intersect (const vrange &) override;
- virtual bool supports_type_p (tree type) const override;
+ virtual bool supports_type_p (const_tree type) const override;
virtual void accept (const vrange_visitor &v) const override;
frange& operator= (const frange &);
bool operator== (const frange &) const;
@@ -457,7 +457,7 @@ public:
operator vrange &();
operator const vrange &() const;
void dump (FILE *) const;
- static bool supports_type_p (tree type);
+ static bool supports_type_p (const_tree type);
// Convenience methods for vrange compatability.
void set (tree min, tree max, value_range_kind kind = VR_RANGE)
@@ -588,7 +588,7 @@ Value_Range::operator const vrange &() const
// Return TRUE if TYPE is supported by the vrange infrastructure.
inline bool
-Value_Range::supports_type_p (tree type)
+Value_Range::supports_type_p (const_tree type)
{
return irange::supports_p (type) || frange::supports_p (type);
}
@@ -730,7 +730,7 @@ irange::nonzero_p () const
}
inline bool
-irange::supports_p (tree type)
+irange::supports_p (const_tree type)
{
return INTEGRAL_TYPE_P (type) || POINTER_TYPE_P (type);
}
--
2.37.1
next prev parent reply other threads:[~2022-08-01 6:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-01 6:15 [COMMITTED] Make irange dependency explicit for range_of_ssa_name_with_loop_info Aldy Hernandez
2022-08-01 6:15 ` Aldy Hernandez [this message]
2022-08-01 6:15 ` [COMMITTED] Cleanups to frange Aldy Hernandez
2022-08-02 7:19 ` [COMMITTED] Make irange dependency explicit for range_of_ssa_name_with_loop_info Richard Biener
2022-08-02 11:40 ` Aldy Hernandez
2022-08-02 12:06 ` Richard Biener
2022-08-02 12:11 ` Aldy Hernandez
2022-08-02 12:14 ` Richard Biener
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220801061540.229684-2-aldyh@redhat.com \
--to=aldyh@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).