diff options
author | Aldy Hernandez <aldyh@redhat.com> | 2022-07-14 19:04:09 +0200 |
---|---|---|
committer | Aldy Hernandez <aldyh@redhat.com> | 2022-07-15 11:41:03 +0200 |
commit | 64864aa9e6ea347a4f9c7027941be898ce993f85 (patch) | |
tree | f26899fcf6deec978749c35d04c96ba9b5469fa2 /gcc/value-range.h | |
parent | 91a7f30662cd8da14f0ae5eec1ce13aa29f1817c (diff) | |
download | gcc-64864aa9e6ea347a4f9c7027941be898ce993f85.zip gcc-64864aa9e6ea347a4f9c7027941be898ce993f85.tar.gz gcc-64864aa9e6ea347a4f9c7027941be898ce993f85.tar.bz2 |
Convert vrange dumping facilities to pretty_printer.
We need to dump global ranges from the gimple pretty printer code, but
all the vrange dumping facilities work with FILE handles. This patch
converts all the dumping methods to work with pretty printers, and
provides a wrapper so the FILE * methods continue to work for
debugging. I also cleaned up the code a bit.
Tested on x86-64 Linux.
gcc/ChangeLog:
* Makefile.in (OBJS): Add value-range-pretty-print.o.
* pretty-print.h (pp_vrange): New.
* value-range.cc (vrange::dump): Call pp version.
(unsupported_range::dump): Move to its own file.
(dump_bound_with_infinite_markers): Same.
(irange::dump): Same.
(irange::dump_bitmasks): Same.
(vrange::debug): Remove.
* value-range.h: Remove virtual designation for dump methods.
Remove dump_bitmasks method.
* value-range-pretty-print.cc: New file.
* value-range-pretty-print.h: New file.
Diffstat (limited to 'gcc/value-range.h')
-rw-r--r-- | gcc/value-range.h | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/gcc/value-range.h b/gcc/value-range.h index a7da8c5..4af92fd 100644 --- a/gcc/value-range.h +++ b/gcc/value-range.h @@ -79,7 +79,6 @@ public: virtual bool supports_type_p (tree type) const; virtual void set_varying (tree type); virtual void set_undefined (); - virtual void dump (FILE * = stderr) const = 0; virtual bool union_ (const vrange &); virtual bool intersect (const vrange &); virtual bool singleton_p (tree *result = NULL) const; @@ -96,9 +95,9 @@ public: vrange& operator= (const vrange &); bool operator== (const vrange &) const; bool operator!= (const vrange &r) const { return !(*this == r); } + void dump (FILE *) const; enum value_range_kind kind () const; // DEPRECATED - void debug () const; protected: ENUM_BITFIELD(value_range_kind) m_kind : 8; @@ -149,7 +148,6 @@ public: // Misc methods. virtual bool fits_p (const vrange &r) const override; - virtual void dump (FILE * = stderr) const override; virtual void accept (const vrange_visitor &v) const override; // Nonzero masks. @@ -206,7 +204,6 @@ private: void set_nonzero_bits (tree mask); bool intersect_nonzero_bits (const irange &r); bool union_nonzero_bits (const irange &r); - void dump_bitmasks (FILE *) const; bool intersect (const wide_int& lb, const wide_int& ub); unsigned char m_num_ranges; @@ -252,7 +249,6 @@ class unsupported_range : public vrange { public: unsupported_range (); - virtual void dump (FILE *) const override; virtual void accept (const vrange_visitor &v) const override; }; @@ -339,7 +335,7 @@ public: bool operator!= (const Value_Range &r) const; operator vrange &(); operator const vrange &() const; - void dump (FILE *out = stderr) const; + void dump (FILE *) const; static bool supports_type_p (tree type); // Convenience methods for vrange compatability. |