]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Remove gimple_expr_type
authorRichard Biener <rguenther@suse.de>
Fri, 16 Jul 2021 12:56:38 +0000 (14:56 +0200)
committerRichard Biener <rguenther@suse.de>
Mon, 19 Jul 2021 08:02:14 +0000 (10:02 +0200)
This removes the transitional gimple_expr_type API.

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

* gimple.h (gimple_expr_type): Remove.
* doc/gimple.texi: Remove gimple_expr_type documentation.

gcc/doc/gimple.texi
gcc/gimple.h

index 4b3d7d7452e3af54dc9cf67f07c457b06ff402bb..5d89dbcc68d58b4cc715a60271ef4ac8ac6e908b 100644 (file)
@@ -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
index acf572b81be64153374bb14539fc3a1a129f13b5..29da9198547eede4cf62d726bcbdc3d7899ff9e1 100644 (file)
@@ -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.  */