aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-range.h
diff options
context:
space:
mode:
authorAndrew MacLeod <amacleod@redhat.com>2021-07-30 15:15:29 -0400
committerAndrew MacLeod <amacleod@redhat.com>2021-08-17 19:28:42 -0400
commite68c8280fa2e1b7071378cfdd876155c73ec944f (patch)
tree0ae12a1714e30ae84386e81130f2902117bf71bd /gcc/gimple-range.h
parentb48d4e6818674898f90d9358378c127511ef0f9f (diff)
downloadgcc-e68c8280fa2e1b7071378cfdd876155c73ec944f.zip
gcc-e68c8280fa2e1b7071378cfdd876155c73ec944f.tar.gz
gcc-e68c8280fa2e1b7071378cfdd876155c73ec944f.tar.bz2
Abstract tracing routines into a class.
Generalize range tracing into a class and integrae it with gimple_ranger. Remove the old derived trace_ranger class. * Makefile.in (OBJS): Add gimple-range-trace.o. * gimple-range-cache.h (enable_new_values): Remove unused prototype. * gimple-range-fold.cc: Adjust headers. * gimple-range-trace.cc: New. * gimple-range-trace.h: New. * gimple-range.cc (gimple_ranger::gimple_ranger): Enable tracer. (gimple_ranger::range_of_expr): Add tracing. (gimple_ranger::range_on_entry): Ditto. (gimple_ranger::range_on_exit): Ditto. (gimple_ranger::range_on_edge): Ditto. (gimple_ranger::fold_range_internal): Ditto. (gimple_ranger::dump_bb): Do not calculate edge range twice. (trace_ranger::*): Remove. (enable_ranger): Never create a trace_ranger. (debug_seed_ranger): Move to gimple-range-trace.cc. (dump_ranger): Ditto. (debug_ranger): Ditto. * gimple-range.h: Include gimple-range-trace.h. (range_on_entry, range_on_exit): No longer virtual. (class trace_ranger): Remove. (DEBUG_RANGE_CACHE): Move to gimple-range-trace.h.
Diffstat (limited to 'gcc/gimple-range.h')
-rw-r--r--gcc/gimple-range.h34
1 files changed, 4 insertions, 30 deletions
diff --git a/gcc/gimple-range.h b/gcc/gimple-range.h
index aa62039..41845b1 100644
--- a/gcc/gimple-range.h
+++ b/gcc/gimple-range.h
@@ -22,10 +22,10 @@ along with GCC; see the file COPYING3. If not see
#ifndef GCC_GIMPLE_RANGE_H
#define GCC_GIMPLE_RANGE_H
-
#include "range.h"
#include "value-query.h"
#include "range-op.h"
+#include "gimple-range-trace.h"
#include "gimple-range-edge.h"
#include "gimple-range-fold.h"
#include "gimple-range-gori.h"
@@ -43,7 +43,6 @@ along with GCC; see the file COPYING3. If not see
// type is not supported, then false is returned. Non-statement
// related methods return whatever the current global value is.
-
class gimple_ranger : public range_query
{
public:
@@ -51,8 +50,8 @@ public:
virtual bool range_of_stmt (irange &r, gimple *, tree name = NULL) OVERRIDE;
virtual bool range_of_expr (irange &r, tree name, gimple * = NULL) OVERRIDE;
virtual bool range_on_edge (irange &r, edge e, tree name) OVERRIDE;
- virtual void range_on_entry (irange &r, basic_block bb, tree name);
- virtual void range_on_exit (irange &r, basic_block bb, tree name);
+ void range_on_entry (irange &r, basic_block bb, tree name);
+ void range_on_exit (irange &r, basic_block bb, tree name);
void export_global_ranges ();
inline gori_compute &gori () { return m_cache.m_gori; }
virtual void dump (FILE *f) OVERRIDE;
@@ -60,34 +59,9 @@ public:
protected:
bool fold_range_internal (irange &r, gimple *s, tree name);
ranger_cache m_cache;
+ range_tracer tracer;
};
-
-// This class overloads the ranger routines to provide tracing facilties
-// Entry and exit values to each of the APIs is placed in the dumpfile.
-
-class trace_ranger : public gimple_ranger
-{
-public:
- trace_ranger ();
- virtual bool range_of_stmt (irange &r, gimple *s, tree name = NULL_TREE);
- virtual bool range_of_expr (irange &r, tree name, gimple *s = NULL);
- virtual bool range_on_edge (irange &r, edge e, tree name);
- virtual void range_on_entry (irange &r, basic_block bb, tree name);
- virtual void range_on_exit (irange &r, basic_block bb, tree name);
-private:
- static const unsigned bump = 2;
- unsigned indent;
- unsigned trace_count; // Current trace index count.
-
- bool dumping (unsigned counter, bool trailing = false);
- bool trailer (unsigned counter, const char *caller, bool result, tree name,
- const irange &r);
-};
-
-// Flag to enable debugging the various internal Caches.
-#define DEBUG_RANGE_CACHE (dump_file && (param_evrp_mode & EVRP_MODE_DEBUG))
-
extern gimple_ranger *enable_ranger (struct function *);
extern void disable_ranger (struct function *);