builtins.c (fold_builtin_1): Update a call to targetm.fold_builtin.
authorKazu Hirata <kazu@cs.umass.edu>
Sun, 20 Mar 2005 15:54:41 +0000 (15:54 +0000)
committerKazu Hirata <kazu@gcc.gnu.org>
Sun, 20 Mar 2005 15:54:41 +0000 (15:54 +0000)
* builtins.c (fold_builtin_1): Update a call to
targetm.fold_builtin.
* hooks.c (hook_tree_tree_bool_null): Rename to
hook_tree_tree_tree_bool_null.  Take one more argument of type
tree.
* hooks.h: Update the prototype of hook_tree_tree_bool_null.
* target-def.h (TARGET_FOLD_BUILTIN): Define it as
hook_tree_tree_tree_bool_null.
* target.h (gcc_target): Update the prototype of fold_builtin.
* config/alpha/alpha.c (alpha_fold_builtin): Take decomposed
arguments of CALL_EXPR.
* doc/tm.texi (TARGET_FOLD_BUILTIN): Update.  Mention the
new prototype.

From-SVN: r96762

gcc/ChangeLog
gcc/builtins.c
gcc/config/alpha/alpha.c
gcc/doc/tm.texi
gcc/hooks.c
gcc/hooks.h
gcc/target-def.h
gcc/target.h

index 379ac7fdee98b1ff30dd8776df9a004167ba1618..7efd3180139ea5ad1f033c366903afde54bdd25b 100644 (file)
@@ -1,3 +1,19 @@
+2005-03-20  Kazu Hirata  <kazu@cs.umass.edu>
+
+       * builtins.c (fold_builtin_1): Update a call to
+       targetm.fold_builtin.
+       * hooks.c (hook_tree_tree_bool_null): Rename to
+       hook_tree_tree_tree_bool_null.  Take one more argument of type
+       tree.
+       * hooks.h: Update the prototype of hook_tree_tree_bool_null.
+       * target-def.h (TARGET_FOLD_BUILTIN): Define it as
+       hook_tree_tree_tree_bool_null.
+       * target.h (gcc_target): Update the prototype of fold_builtin.
+       * config/alpha/alpha.c (alpha_fold_builtin): Take decomposed
+       arguments of CALL_EXPR.
+       * doc/tm.texi (TARGET_FOLD_BUILTIN): Update.  Mention the
+       new prototype.
+
 2005-03-20  Jan Hubicka  <jh@suse.cz>
 
        * cgraph.h (cgraph_node): Add prev_clone pointer.
index 0f39ec36edbed0942fcf3bb517dd0b8ff4d9ddd9..a2b08f6d749bcd68abf01353b1d1af7f25f8dccb 100644 (file)
@@ -7947,7 +7947,7 @@ fold_builtin_1 (tree exp, bool ignore)
   enum built_in_function fcode;
 
   if (DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_MD)
-    return targetm.fold_builtin (exp, ignore);
+    return targetm.fold_builtin (fndecl, arglist, ignore);
 
   fcode = DECL_FUNCTION_CODE (fndecl);
   switch (fcode)
index 102f568e2a4fbf653aecfd7c36dfde428afdff36..67575e62dacb9f4df7d46910eb5d0ddd109333b4 100644 (file)
@@ -6499,14 +6499,13 @@ alpha_fold_builtin_ctpop (unsigned HOST_WIDE_INT opint[], long op_const)
 /* Fold one of our builtin functions.  */
 
 static tree
-alpha_fold_builtin (tree exp, bool ignore ATTRIBUTE_UNUSED)
+alpha_fold_builtin (tree fndecl, tree arglist, bool ignore ATTRIBUTE_UNUSED)
 {
-  tree fndecl = get_callee_fndecl (exp);
   tree op[MAX_ARGS], t;
   unsigned HOST_WIDE_INT opint[MAX_ARGS];
   long op_const = 0, arity = 0;
 
-  for (t = TREE_OPERAND (exp, 1); t ; t = TREE_CHAIN (t), ++arity)
+  for (t = arglist; t ; t = TREE_CHAIN (t), ++arity)
     {
       tree arg = TREE_VALUE (t);
       if (arg == error_mark_node)
index aa5c929f048ef806e15cf24609b578849b952569..799a0f854d3093fa301254d31733b6104817fb44 100644 (file)
@@ -9446,13 +9446,14 @@ ignored.  This function should return the result of the call to the
 built-in function.
 @end deftypefn
 
-@deftypefn {Target Hook} tree TARGET_FOLD_BUILTIN (tree @var{exp}, bool @var{ignore})
-
-Expand a call to a machine specific built-in function that was set up by
-@samp{TARGET_INIT_BUILTINS}.  @var{exp} is the expression for the
-function call; the result is another tree containing a simplified
-expression for the call's result.  If @var{ignore} is true the
-value will be ignored.
+@deftypefn {Target Hook} tree TARGET_FOLD_BUILTIN (tree @var{fndecl}, tree @var{arglist}, bool @var{ignore})
+
+Fold a call to a machine specific built-in function that was set up by
+@samp{TARGET_INIT_BUILTINS}.  @var{fndecl} is the declaration of the
+built-in function.  @var{arglist} is the list of arguments passed to
+the built-in function.  The result is another tree containing a
+simplified expression for the call's result.  If @var{ignore} is true
+the value will be ignored.
 @end deftypefn
 
 @defmac MD_CAN_REDIRECT_BRANCH (@var{branch1}, @var{branch2})
index 471901f303dea6be62dbfdadc084f783fd0b22f2..274d427a9315b14836bbb3776dfad62d1c11f04a 100644 (file)
@@ -243,7 +243,8 @@ hook_constcharptr_tree_null (tree t ATTRIBUTE_UNUSED)
 }
 
 tree
-hook_tree_tree_bool_null (tree t ATTRIBUTE_UNUSED, bool ignore ATTRIBUTE_UNUSED)
+hook_tree_tree_tree_bool_null (tree t0 ATTRIBUTE_UNUSED, tree t1 ATTRIBUTE_UNUSED,
+                              bool ignore ATTRIBUTE_UNUSED)
 {
   return NULL;
 }
index 5642b560939c154b61258371056d3a1a157bd00b..133ea2a1b80d8f0c0ecc11404902c409b077f8ec 100644 (file)
@@ -64,5 +64,5 @@ extern rtx hook_rtx_rtx_null (rtx);
 extern rtx hook_rtx_tree_int_null (tree, int);
 extern tree hook_tree_tree_identity (tree a);
 extern const char *hook_constcharptr_tree_null (tree);
-extern tree hook_tree_tree_bool_null (tree, bool);
+extern tree hook_tree_tree_tree_bool_null (tree, tree, bool);
 #endif
index e4e2b36a3d090ca48a8a6120ffd19d02fc00d2fa..bb989f943459b7b119b882806c981a8d44df03b3 100644 (file)
@@ -296,7 +296,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 /* In builtins.c.  */
 #define TARGET_INIT_BUILTINS hook_void_void
 #define TARGET_EXPAND_BUILTIN default_expand_builtin
-#define TARGET_FOLD_BUILTIN hook_tree_tree_bool_null
+#define TARGET_FOLD_BUILTIN hook_tree_tree_tree_bool_null
 
 /* In varasm.c.  */
 #ifndef TARGET_SECTION_TYPE_FLAGS
index 35135501b167e93e53a349993b325dcc524d3e07..152cb7d358465aa0e8015d4f84230d46e58c56b1 100644 (file)
@@ -344,7 +344,7 @@ struct gcc_target
                          enum machine_mode mode, int ignore);
 
   /* Fold a target-specific builtin.  */
-  tree (* fold_builtin) (tree exp, bool ignore);
+  tree (* fold_builtin) (tree fndecl, tree arglist, bool ignore);
 
   /* For a vendor-specific fundamental TYPE, return a pointer to
      a statically-allocated string containing the C++ mangling for