public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-1359] Adjust variable names and comments in value-query.*
@ 2021-06-10 11:10 Aldy Hernandez
  0 siblings, 0 replies; only message in thread
From: Aldy Hernandez @ 2021-06-10 11:10 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:7c097d18c11dc7cccd38537d6d8641e2d5913dee

commit r12-1359-g7c097d18c11dc7cccd38537d6d8641e2d5913dee
Author: Aldy Hernandez <aldyh@redhat.com>
Date:   Thu Jun 10 13:03:33 2021 +0200

    Adjust variable names and comments in value-query.*
    
    Now that range_of_expr can take arbitrary tree expressions, not just
    SSA names or constants, the method names and comments are slightly out
    of date.  This patch adjusts them to reflect reality.
    
    gcc/ChangeLog:
    
            * value-query.cc (value_query::value_on_edge): Rename name to
            expr.
            (range_query::range_on_edge): Same.
            (range_query::value_of_expr): Same.
            (range_query::value_on_edge): Same.
            * value-query.h (class value_query): Same.
            (class range_query): Same.

Diff:
---
 gcc/value-query.cc | 24 ++++++++++++------------
 gcc/value-query.h  | 18 +++++++++---------
 2 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/gcc/value-query.cc b/gcc/value-query.cc
index 821f224d4ab..9047e271b5b 100644
--- a/gcc/value-query.cc
+++ b/gcc/value-query.cc
@@ -36,9 +36,9 @@ along with GCC; see the file COPYING3.  If not see
 // value_query default methods.
 
 tree
-value_query::value_on_edge (edge, tree name)
+value_query::value_on_edge (edge, tree expr)
 {
-  return value_of_expr (name);
+  return value_of_expr (expr);
 }
 
 tree
@@ -57,9 +57,9 @@ value_query::value_of_stmt (gimple *stmt, tree name)
 // range_query default methods.
 
 bool
-range_query::range_on_edge (irange &r, edge, tree name)
+range_query::range_on_edge (irange &r, edge, tree expr)
 {
-  return range_of_expr (r, name);
+  return range_of_expr (r, expr);
 }
 
 bool
@@ -76,20 +76,20 @@ range_query::range_of_stmt (irange &r, gimple *stmt, tree name)
 }
 
 tree
-range_query::value_of_expr (tree name, gimple *stmt)
+range_query::value_of_expr (tree expr, gimple *stmt)
 {
   tree t;
   int_range_max r;
 
-  if (!irange::supports_type_p (TREE_TYPE (name)))
+  if (!irange::supports_type_p (TREE_TYPE (expr)))
     return NULL_TREE;
 
-  if (range_of_expr (r, name, stmt))
+  if (range_of_expr (r, expr, stmt))
     {
       // A constant used in an unreachable block oftens returns as UNDEFINED.
       // If the result is undefined, check the global value for a constant.
       if (r.undefined_p ())
-	range_of_expr (r, name);
+	range_of_expr (r, expr);
       if (r.singleton_p (&t))
 	return t;
     }
@@ -97,19 +97,19 @@ range_query::value_of_expr (tree name, gimple *stmt)
 }
 
 tree
-range_query::value_on_edge (edge e, tree name)
+range_query::value_on_edge (edge e, tree expr)
 {
   tree t;
   int_range_max r;
 
-  if (!irange::supports_type_p (TREE_TYPE (name)))
+  if (!irange::supports_type_p (TREE_TYPE (expr)))
     return NULL_TREE;
-  if (range_on_edge (r, e, name))
+  if (range_on_edge (r, e, expr))
     {
       // A constant used in an unreachable block oftens returns as UNDEFINED.
       // If the result is undefined, check the global value for a constant.
       if (r.undefined_p ())
-	range_of_expr (r, name);
+	range_of_expr (r, expr);
       if (r.singleton_p (&t))
 	return t;
     }
diff --git a/gcc/value-query.h b/gcc/value-query.h
index 77e49e9a906..54af031ea42 100644
--- a/gcc/value-query.h
+++ b/gcc/value-query.h
@@ -39,12 +39,12 @@ class value_query
 {
 public:
   value_query () { }
-  // Return the singleton expression for NAME at a gimple statement,
+  // Return the singleton expression for EXPR at a gimple statement,
   // or NULL if none found.
-  virtual tree value_of_expr (tree name, gimple * = NULL) = 0;
-  // Return the singleton expression for NAME at an edge, or NULL if
+  virtual tree value_of_expr (tree expr, gimple * = NULL) = 0;
+  // Return the singleton expression for EXPR at an edge, or NULL if
   // none found.
-  virtual tree value_on_edge (edge, tree name);
+  virtual tree value_on_edge (edge, tree expr);
   // Return the singleton expression for the LHS of a gimple
   // statement, assuming an (optional) initial value of NAME.  Returns
   // NULL if none found.
@@ -77,8 +77,8 @@ public:
   range_query ();
   virtual ~range_query ();
 
-  virtual tree value_of_expr (tree name, gimple * = NULL) OVERRIDE;
-  virtual tree value_on_edge (edge, tree name) OVERRIDE;
+  virtual tree value_of_expr (tree expr, gimple * = NULL) OVERRIDE;
+  virtual tree value_on_edge (edge, tree expr) OVERRIDE;
   virtual tree value_of_stmt (gimple *, tree name = NULL) OVERRIDE;
 
   // These are the range equivalents of the value_* methods.  Instead
@@ -86,9 +86,9 @@ public:
   // R.  TRUE is returned on success or FALSE if no range was found.
   //
   // Note that range_of_expr must always return TRUE unless ranges are
-  // unsupported for NAME's type (supports_type_p is false).
-  virtual bool range_of_expr (irange &r, tree name, gimple * = NULL) = 0;
-  virtual bool range_on_edge (irange &r, edge, tree name);
+  // unsupported for EXPR's type (supports_type_p is false).
+  virtual bool range_of_expr (irange &r, tree expr, gimple * = NULL) = 0;
+  virtual bool range_on_edge (irange &r, edge, tree expr);
   virtual bool range_of_stmt (irange &r, gimple *, tree name = NULL);
 
   // DEPRECATED: This method is used from vr-values.  The plan is to


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-06-10 11:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-10 11:10 [gcc r12-1359] Adjust variable names and comments in value-query.* Aldy Hernandez

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).