+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.
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)
/* 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)
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})
}
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;
}
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
/* 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
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