diff mbox series

[COMMITTED,1/3] Make fur_edge accessible.

Message ID cd1da941-c26b-449f-9733-eee05d958f04@redhat.com
State New
Headers show
Series [COMMITTED,1/3] Make fur_edge accessible. | expand

Commit Message

Andrew MacLeod Nov. 1, 2024, 7:25 p.m. UTC
The next patch requires a fur_edge class.  It needs to calculate ranges 
on both edges and statements, and this provides a way to do both without 
having different routines.

This patch simply moves it out of the source file and into 
gimple-range-fold.h where it is generally accessible.

Bootstrapped on x86_64-pc-linux-gnu with no regressions.  Pushed.

Andrew
diff mbox series

Patch

From 548a78d0e4c02f1e5d07c8812d4324fef581d14b Mon Sep 17 00:00:00 2001
From: Andrew MacLeod <amacleod@redhat.com>
Date: Thu, 31 Oct 2024 15:44:15 -0400
Subject: [PATCH 1/3] Make fur_edge accessible.

Move the decl of fur_edge out of the source file into the header file.

	* gimple-range-fold.cc (class fur_edge): Relocate from here.
	(fur_edge::fur_edge): Also move to:
	* gimple-range-fold.h (class fur_edge): Relocate to here.
	(fur_edge::fur_edge): Likewise.
---
 gcc/gimple-range-fold.cc | 20 --------------------
 gcc/gimple-range-fold.h  | 14 ++++++++++++++
 2 files changed, 14 insertions(+), 20 deletions(-)

diff --git a/gcc/gimple-range-fold.cc b/gcc/gimple-range-fold.cc
index 82dd363f2ec..a4063b718f6 100644
--- a/gcc/gimple-range-fold.cc
+++ b/gcc/gimple-range-fold.cc
@@ -109,26 +109,6 @@  fur_source::register_relation (edge e ATTRIBUTE_UNUSED,
 {
 }
 
-// This version of fur_source will pick a range up off an edge.
-
-class fur_edge : public fur_source
-{
-public:
-  fur_edge (edge e, range_query *q = NULL);
-  virtual bool get_operand (vrange &r, tree expr) override;
-  virtual bool get_phi_operand (vrange &r, tree expr, edge e) override;
-private:
-  edge m_edge;
-};
-
-// Instantiate an edge based fur_source.
-
-inline
-fur_edge::fur_edge (edge e, range_query *q) : fur_source (q)
-{
-  m_edge = e;
-}
-
 // Get the value of EXPR on edge m_edge.
 
 bool
diff --git a/gcc/gimple-range-fold.h b/gcc/gimple-range-fold.h
index 37c49596c33..109510853a2 100644
--- a/gcc/gimple-range-fold.h
+++ b/gcc/gimple-range-fold.h
@@ -150,6 +150,20 @@  public:
 				  tree op2) override;
 };
 
+
+// This version of fur_source will pick a range up off an edge.
+
+class fur_edge : public fur_source
+{
+public:
+  fur_edge (edge e, range_query *q = NULL) : fur_source (q)
+    { m_edge = e; }
+  virtual bool get_operand (vrange &r, tree expr) override;
+  virtual bool get_phi_operand (vrange &r, tree expr, edge e) override;
+private:
+  edge m_edge;
+};
+
 // This class uses ranges to fold a gimple statement producing a range for
 // the LHS.  The source of all operands is supplied via the fur_source class
 // which provides a range_query as well as a source location and any other
-- 
2.45.0