diff mbox series

[3/3] Remove gimple_expr_type

Message ID s9q2pn4r-n066-n4pp-7o9s-r56r34964n25@fhfr.qr
State New
Headers show
Series [1/3] Remove gimple_expr_type uses from value-range code | expand

Commit Message

Richard Biener July 16, 2021, 1:02 p.m. UTC
This removes the transitional gimple_expr_type API.

Bootstrap & regtest running on x86_64-unknown-linux-gnu.

2021-07-16  Richard Biener  <rguenther@suse.de>

	* gimple.h (gimple_expr_type): Remove.
	* gcc/doc/gimple.texi: Remove gimple_expr_type documentation.
---
 gcc/doc/gimple.texi |  8 --------
 gcc/gimple.h        | 42 ------------------------------------------
 2 files changed, 50 deletions(-)
diff mbox series

Patch

diff --git a/gcc/doc/gimple.texi b/gcc/doc/gimple.texi
index 4b3d7d7452e..5d89dbcc68d 100644
--- a/gcc/doc/gimple.texi
+++ b/gcc/doc/gimple.texi
@@ -868,14 +868,6 @@  Return the basic block to which statement @code{G} belongs to.
 Return the lexical scope block holding statement @code{G}.
 @end deftypefn
 
-@deftypefn {GIMPLE function} tree gimple_expr_type (gimple stmt)
-Return the type of the main expression computed by @code{STMT}. Return
-@code{void_type_node} if @code{STMT} computes nothing. This will only return
-something meaningful for @code{GIMPLE_ASSIGN}, @code{GIMPLE_COND} and
-@code{GIMPLE_CALL}.  For all other tuple codes, it will return
-@code{void_type_node}.
-@end deftypefn
-
 @deftypefn {GIMPLE function} {enum tree_code} gimple_expr_code (gimple stmt)
 Return the tree code for the expression computed by @code{STMT}.  This
 is only meaningful for @code{GIMPLE_CALL}, @code{GIMPLE_ASSIGN} and
diff --git a/gcc/gimple.h b/gcc/gimple.h
index acf572b81be..29da9198547 100644
--- a/gcc/gimple.h
+++ b/gcc/gimple.h
@@ -6608,48 +6608,6 @@  is_gimple_resx (const gimple *gs)
   return gimple_code (gs) == GIMPLE_RESX;
 }
 
-/* Return the type of the main expression computed by STMT.  Return
-   void_type_node if the statement computes nothing.  */
-
-static inline tree
-gimple_expr_type (const gimple *stmt)
-{
-  enum gimple_code code = gimple_code (stmt);
-  /* In general we want to pass out a type that can be substituted
-     for both the RHS and the LHS types if there is a possibly
-     useless conversion involved.  That means returning the
-     original RHS type as far as we can reconstruct it.  */
-  if (code == GIMPLE_CALL)
-    {
-      const gcall *call_stmt = as_a <const gcall *> (stmt);
-      if (gimple_call_internal_p (call_stmt))
-	switch (gimple_call_internal_fn (call_stmt))
-	  {
-	  case IFN_MASK_STORE:
-	  case IFN_SCATTER_STORE:
-	    return TREE_TYPE (gimple_call_arg (call_stmt, 3));
-	  case IFN_MASK_SCATTER_STORE:
-	    return TREE_TYPE (gimple_call_arg (call_stmt, 4));
-	  default:
-	    break;
-	  }
-      return gimple_call_return_type (call_stmt);
-    }
-  else if (code == GIMPLE_ASSIGN)
-    {
-      if (gimple_assign_rhs_code (stmt) == POINTER_PLUS_EXPR)
-        return TREE_TYPE (gimple_assign_rhs1 (stmt));
-      else
-        /* As fallback use the type of the LHS.  */
-        return TREE_TYPE (gimple_get_lhs (stmt));
-    }
-  else if (code == GIMPLE_COND)
-    return boolean_type_node;
-  else if (code == GIMPLE_PHI)
-    return TREE_TYPE (gimple_phi_result (stmt));
-  else
-    return void_type_node;
-}
 
 /* Enum and arrays used for allocation stats.  Keep in sync with
    gimple.c:gimple_alloc_kind_names.  */