* c-decl.c (grokdeclarator): Update.
* c-lang.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine.
* c-tree.h (c_mark_addressable): New.
* c-typeck.c (default_function_array_conversion, build_unary_op,
build_array_ref, convert_for_assignment): Update.
(mark_addressable): Rename.
* calls.c (try_to_integrate, expand_call): Use langhook.
* expr.c (expand_expr): Use langhook.
* langhooks-def.h (LANG_HOOKS_INITIALIZER): Update.
* langhooks.h (struct lang_hooks): New hook.
* stmt.c (expand_asm_operands): Use langhook.
* tree.h (mark_addressable): Remove.
ada:
* decl.c (gnat_to_gnu_entity): Update.
* gigi.h (mark_addressable): Rename.
* misc.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine.
* trans.c (tree_transform): Update.
* utils.c (create_var_decl): Update.
* util2.c (build_binary_op, build_unary_op,
fill_vms_descriptor): Update.
(mark_addressable): Rename, update.
cp:
* call.c (build_addr_func): Update.
* class.c (resolve_address_of_overloaded_function): Update.
* cp-lang.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine.
* cp-tree.h (cxx_mark_addressable): New.
* decl.c (register_dtor_fn, cxx_maybe_build_cleanup): Update.
* decl2.c (build_cleanup): Update.
* except.c (build_throw): Update.
* init.c (resolve_offset_ref): Update.
* pt.c (convert_nontype_argument): Update.
* semantics.c (finish_asm_stmt, simplify_affr_init_exprs_r): Update.
* typeck.c (decay_conversion, build_array_ref, build_unary_op,
unary_complex_lvalue): Update.
(mark_addressable): Rename.
f:
* com.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine.
(mark_addressable): Rename.
(ffecom_arrayref_, ffecom_1): Update.
java:
* java-tree.h (java_mark_addressable): New.
* lang.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine.
* typeck.c (mark_addressable): Rename, update.
objc:
* objc-lang.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine.
From-SVN: r51705
+2002-04-01 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * c-decl.c (grokdeclarator): Update.
+ * c-lang.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine.
+ * c-tree.h (c_mark_addressable): New.
+ * c-typeck.c (default_function_array_conversion, build_unary_op,
+ build_array_ref, convert_for_assignment): Update.
+ (mark_addressable): Rename.
+ * calls.c (try_to_integrate, expand_call): Use langhook.
+ * expr.c (expand_expr): Use langhook.
+ * langhooks-def.h (LANG_HOOKS_INITIALIZER): Update.
+ * langhooks.h (struct lang_hooks): New hook.
+ * stmt.c (expand_asm_operands): Use langhook.
+ * tree.h (mark_addressable): Remove.
+objc:
+ * objc-lang.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine.
+
2002-04-01 Bob Wilson <bob.wilson@acm.org>
* config/xtensa/xtensa.c (xtensa_va_arg): Fix compiler warning
+2002-04-01 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * decl.c (gnat_to_gnu_entity): Update.
+ * gigi.h (mark_addressable): Rename.
+ * misc.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine.
+ * trans.c (tree_transform): Update.
+ * utils.c (create_var_decl): Update.
+ * util2.c (build_binary_op, build_unary_op,
+ fill_vms_descriptor): Update.
+ (mark_addressable): Rename, update.
+
2002-04-01 Neil Booth <neil@daikokuya.demon.co.uk>
* gigi.h (unsigned_type, signed_type, signed_or_unsigned_type):
if (Has_Nested_Block_With_Handler (Scope (gnat_entity))
&& Exception_Mechanism != GCC_ZCX)
{
- mark_addressable (gnu_decl);
+ gnat_mark_addressable (gnu_decl);
flush_addressof (gnu_decl);
}
extern tree fill_vms_descriptor PARAMS((tree, Entity_Id));
/* Indicate that we need to make the address of EXPR_NODE and it therefore
- should not be allocated in a register. Return 1 if successful. */
-extern int mark_addressable PARAMS((tree));
+ should not be allocated in a register. Return true if successful. */
+extern bool gnat_mark_addressable PARAMS((tree));
/* These functions return the basic data type sizes and related parameters
about the target machine. */
#define LANG_HOOKS_GET_ALIAS_SET gnat_get_alias_set
#undef LANG_HOOKS_EXPAND_EXPR
#define LANG_HOOKS_EXPAND_EXPR gnat_expand_expr
+#undef LANG_HOOKS_MARK_ADDRESSABLE
+#define LANG_HOOKS_MARK_ADDRESSABLE gnat_mark_addressable
#undef LANG_HOOKS_PRINT_DECL
#define LANG_HOOKS_PRINT_DECL gnat_print_decl
#undef LANG_HOOKS_PRINT_TYPE
right now. */
if (TREE_VALUE (gnu_except_ptr_stack) != 0)
{
- mark_addressable (gnu_result);
+ gnat_mark_addressable (gnu_result);
flush_addressof (gnu_result);
}
return convert (gnu_type, gnu_result);
}
\f
-/* Return 1 if GNU_EXPR can be directly addressed. This is the case unless
- it is an expression involving computation or if it involves a bitfield
- reference. This returns the same as mark_addressable in most cases. */
+/* Return 1 if GNU_EXPR can be directly addressed. This is the case
+ unless it is an expression involving computation or if it involves
+ a bitfield reference. This returns the same as
+ gnat_mark_addressable in most cases. */
static int
addressable_p (gnu_expr)
/* If this is volatile, force it into memory. */
if (TREE_SIDE_EFFECTS (var_decl))
- mark_addressable (var_decl);
+ gnat_mark_addressable (var_decl);
if (TREE_CODE (var_decl) != CONST_DECL)
rest_of_decl_compilation (var_decl, 0, global_bindings_p (), 0);
if (! TREE_CONSTANT (right_operand)
|| ! TREE_CONSTANT (TYPE_MIN_VALUE (right_type))
|| op_code == ARRAY_RANGE_REF)
- mark_addressable (left_operand);
+ gnat_mark_addressable (left_operand);
modulus = 0;
break;
if (type != error_mark_node)
operation_type = build_pointer_type (type);
- mark_addressable (operand);
+ gnat_mark_addressable (operand);
result = fold (build1 (ADDR_EXPR, operation_type, operand));
}
tree const_list = 0;
expr = maybe_unconstrained_array (expr);
- mark_addressable (expr);
+ gnat_mark_addressable (expr);
for (field = TYPE_FIELDS (record_type); field; field = TREE_CHAIN (field))
{
}
/* Indicate that we need to make the address of EXPR_NODE and it therefore
- should not be allocated in a register. Return 1 if successful. */
+ should not be allocated in a register. Returns true if successful. */
-int
-mark_addressable (expr_node)
+bool
+gnat_mark_addressable (expr_node)
tree expr_node;
{
while (1)
case CONSTRUCTOR:
TREE_ADDRESSABLE (expr_node) = 1;
- return 1;
+ return true;
case VAR_DECL:
case PARM_DECL:
case RESULT_DECL:
put_var_into_stack (expr_node);
TREE_ADDRESSABLE (expr_node) = 1;
- return 1;
+ return true;
case FUNCTION_DECL:
TREE_ADDRESSABLE (expr_node) = 1;
- return 1;
+ return true;
case CONST_DECL:
return (DECL_CONST_CORRESPONDING_VAR (expr_node) != 0
- && (mark_addressable
+ && (gnat_mark_addressable
(DECL_CONST_CORRESPONDING_VAR (expr_node))));
default:
- return 1;
+ return true;
}
}
Otherwise, the fact that those components are volatile
will be ignored, and would even crash the compiler. */
if (C_TYPE_FIELDS_VOLATILE (TREE_TYPE (decl)))
- mark_addressable (decl);
+ c_mark_addressable (decl);
decl_attributes (&decl, returned_attrs, 0);
#define LANG_HOOKS_MARK_TREE c_mark_tree
#undef LANG_HOOKS_EXPAND_EXPR
#define LANG_HOOKS_EXPAND_EXPR c_expand_expr
+#undef LANG_HOOKS_MARK_ADDRESSABLE
+#define LANG_HOOKS_MARK_ADDRESSABLE c_mark_addressable
#undef LANG_HOOKS_PARSE_FILE
#define LANG_HOOKS_PARSE_FILE c_common_parse_file
#undef LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES
extern int comptypes PARAMS ((tree, tree));
extern tree c_sizeof_nowarn PARAMS ((tree));
extern tree c_size_in_bytes PARAMS ((tree));
+extern bool c_mark_addressable PARAMS ((tree));
extern tree build_component_ref PARAMS ((tree, tree));
extern tree build_indirect_ref PARAMS ((tree, const char *));
extern tree build_array_ref PARAMS ((tree, tree));
is not the target type of the type of the ADDR_EXPR itself.
Question is, can this lossage be avoided? */
adr = build1 (ADDR_EXPR, ptrtype, exp);
- if (mark_addressable (exp) == 0)
+ if (!c_mark_addressable (exp))
return error_mark_node;
TREE_CONSTANT (adr) = staticp (exp);
TREE_SIDE_EFFECTS (adr) = 0; /* Default would be, same as EXP. */
|| (COMPLETE_TYPE_P (TREE_TYPE (TREE_TYPE (array)))
&& TREE_CODE (TYPE_SIZE (TREE_TYPE (TREE_TYPE (array)))) != INTEGER_CST))
{
- if (mark_addressable (array) == 0)
+ if (!c_mark_addressable (array))
return error_mark_node;
}
/* An array that is indexed by a constant value which is not within
&& TYPE_VALUES (TREE_TYPE (array))
&& ! int_fits_type_p (index, TYPE_VALUES (TREE_TYPE (array))))
{
- if (mark_addressable (array) == 0)
+ if (!c_mark_addressable (array))
return error_mark_node;
}
/* For &x[y], return x+y */
if (TREE_CODE (arg) == ARRAY_REF)
{
- if (mark_addressable (TREE_OPERAND (arg, 0)) == 0)
+ if (!c_mark_addressable (TREE_OPERAND (arg, 0)))
return error_mark_node;
return build_binary_op (PLUS_EXPR, TREE_OPERAND (arg, 0),
TREE_OPERAND (arg, 1), 1);
argtype = build_pointer_type (argtype);
- if (mark_addressable (arg) == 0)
+ if (!c_mark_addressable (arg))
return error_mark_node;
{
\f
/* Mark EXP saying that we need to be able to take the
address of it; it should not be allocated in a register.
- Value is 1 if successful. */
+ Returns true if successful. */
-int
-mark_addressable (exp)
+bool
+c_mark_addressable (exp)
tree exp;
{
tree x = exp;
+
while (1)
switch (TREE_CODE (x))
{
{
error ("cannot take address of bit-field `%s'",
IDENTIFIER_POINTER (DECL_NAME (TREE_OPERAND (x, 1))));
- return 0;
+ return false;
}
/* ... fall through ... */
case COMPOUND_LITERAL_EXPR:
case CONSTRUCTOR:
TREE_ADDRESSABLE (x) = 1;
- return 1;
+ return true;
case VAR_DECL:
case CONST_DECL:
{
error ("global register variable `%s' used in nested function",
IDENTIFIER_POINTER (DECL_NAME (x)));
- return 0;
+ return false;
}
pedwarn ("register variable `%s' used in nested function",
IDENTIFIER_POINTER (DECL_NAME (x)));
{
error ("address of global register variable `%s' requested",
IDENTIFIER_POINTER (DECL_NAME (x)));
- return 0;
+ return false;
}
/* If we are making this addressable due to its having
else if (C_TYPE_FIELDS_VOLATILE (TREE_TYPE (x)))
{
error ("cannot put object with volatile field into register");
- return 0;
+ return false;
}
pedwarn ("address of register variable `%s' requested",
#endif
default:
- return 1;
+ return true;
}
}
\f
error ("cannot pass rvalue to reference parameter");
return error_mark_node;
}
- if (mark_addressable (rhs) == 0)
+ if (!c_mark_addressable (rhs))
return error_mark_node;
rhs = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (rhs)), rhs);
warning_with_decl (fndecl, "inlining failed in call to `%s'");
warning ("called from here");
}
- mark_addressable (fndecl);
+ (*lang_hooks.mark_addressable) (fndecl);
return (rtx) (size_t) - 1;
}
warning_with_decl (fndecl, "can't inline call to `%s'");
warning ("called from here");
}
- mark_addressable (fndecl);
+ (*lang_hooks.mark_addressable) (fndecl);
}
flags |= flags_from_decl_or_type (fndecl);
/* In case this is a static function, note that it has been
used. */
if (! TREE_ADDRESSABLE (fndecl))
- mark_addressable (fndecl);
+ (*lang_hooks.mark_addressable) (fndecl);
is_integrable = 0;
}
}
+2002-04-01 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * call.c (build_addr_func): Update.
+ * class.c (resolve_address_of_overloaded_function): Update.
+ * cp-lang.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine.
+ * cp-tree.h (cxx_mark_addressable): New.
+ * decl.c (register_dtor_fn, cxx_maybe_build_cleanup): Update.
+ * decl2.c (build_cleanup): Update.
+ * except.c (build_throw): Update.
+ * init.c (resolve_offset_ref): Update.
+ * pt.c (convert_nontype_argument): Update.
+ * semantics.c (finish_asm_stmt, simplify_affr_init_exprs_r): Update.
+ * typeck.c (decay_conversion, build_array_ref, build_unary_op,
+ unary_complex_lvalue): Update.
+ (mark_addressable): Rename.
+
2002-04-01 Roger Sayle <roger@eyesopen.com>
PR c++/5998:
type = build_pointer_type (type);
- if (mark_addressable (function) == 0)
+ if (!cxx_mark_addressable (function))
return error_mark_node;
addr = build1 (ADDR_EXPR, type, function);
/* The target must be a REFERENCE_TYPE. Above, build_unary_op
will mark the function as addressed, but here we must do it
explicitly. */
- mark_addressable (fn);
+ cxx_mark_addressable (fn);
return fn;
}
#define LANG_HOOKS_MARK_TREE cxx_mark_tree
#undef LANG_HOOKS_UNSAFE_FOR_REEVAL
#define LANG_HOOKS_UNSAFE_FOR_REEVAL c_common_unsafe_for_reeval
+#undef LANG_HOOKS_MARK_ADDRESSABLE
+#define LANG_HOOKS_MARK_ADDRESSABLE cxx_mark_addressable
#undef LANG_HOOKS_PRINT_STATISTICS
#define LANG_HOOKS_PRINT_STATISTICS cxx_print_statistics
#undef LANG_HOOKS_PRINT_XNODE
extern void cxx_init_decl_processing PARAMS ((void));
extern void cxx_mark_tree PARAMS ((tree));
extern void cxx_insert_default_attributes PARAMS ((tree));
+extern bool cxx_mark_addressable PARAMS ((tree));
extern int toplevel_bindings_p PARAMS ((void));
extern int namespace_bindings_p PARAMS ((void));
extern void keep_next_level PARAMS ((int));
end_cleanup_fn ();
/* Call atexit with the cleanup function. */
- mark_addressable (cleanup);
+ cxx_mark_addressable (cleanup);
cleanup = build_unary_op (ADDR_EXPR, cleanup, 0);
if (flag_use_cxa_atexit)
{
rval = decl;
else
{
- mark_addressable (decl);
+ cxx_mark_addressable (decl);
rval = build_unary_op (ADDR_EXPR, decl, 0);
}
temp = decl;
else
{
- mark_addressable (decl);
+ cxx_mark_addressable (decl);
temp = build1 (ADDR_EXPR, build_pointer_type (type), decl);
}
temp = build_delete (TREE_TYPE (temp), temp,
complete_dtor_identifier, 0);
cleanup = TREE_VALUE (cleanup);
mark_used (cleanup);
- mark_addressable (cleanup);
+ cxx_mark_addressable (cleanup);
/* Pretend it's a normal function. */
cleanup = build1 (ADDR_EXPR, cleanup_type, cleanup);
}
|| TREE_CODE (TREE_TYPE (member)) == FUNCTION_TYPE)
{
/* These were static members. */
- if (mark_addressable (member) == 0)
+ if (!cxx_mark_addressable (member))
return error_mark_node;
return member;
}
return error_mark_node;
}
- mark_addressable (expr);
+ cxx_mark_addressable (expr);
return build1 (ADDR_EXPR, type, expr);
}
break;
DECL_RTL for the OPERAND -- which we don't have at this
point. */
if (!allows_reg && DECL_P (operand))
- mark_addressable (operand);
+ cxx_mark_addressable (operand);
}
}
{
/* Replace the first argument with the address of the third
argument to the AGGR_INIT_EXPR. */
- mark_addressable (slot);
+ cxx_mark_addressable (slot);
args = tree_cons (NULL_TREE,
build1 (ADDR_EXPR,
build_pointer_type (TREE_TYPE (slot)),
is not the target type of the type of the ADDR_EXPR itself.
Question is, can this lossage be avoided? */
adr = build1 (ADDR_EXPR, ptrtype, exp);
- if (mark_addressable (exp) == 0)
+ if (!cxx_mark_addressable (exp))
return error_mark_node;
TREE_CONSTANT (adr) = staticp (exp);
TREE_SIDE_EFFECTS (adr) = 0; /* Default would be, same as EXP. */
&& (TREE_CODE (TYPE_SIZE (TREE_TYPE (TREE_TYPE (array))))
!= INTEGER_CST)))
{
- if (mark_addressable (array) == 0)
+ if (!cxx_mark_addressable (array))
return error_mark_node;
}
&& TYPE_VALUES (TREE_TYPE (array))
&& ! int_fits_type_p (idx, TYPE_VALUES (TREE_TYPE (array))))
{
- if (mark_addressable (array) == 0)
+ if (!cxx_mark_addressable (array))
return error_mark_node;
}
/* For &x[y], return x+y */
if (TREE_CODE (arg) == ARRAY_REF)
{
- if (mark_addressable (TREE_OPERAND (arg, 0)) == 0)
+ if (!cxx_mark_addressable (TREE_OPERAND (arg, 0)))
return error_mark_node;
return cp_build_binary_op (PLUS_EXPR, TREE_OPERAND (arg, 0),
TREE_OPERAND (arg, 1));
if (argtype != error_mark_node)
argtype = build_pointer_type (argtype);
- if (mark_addressable (arg) == 0)
+ if (!cxx_mark_addressable (arg))
return error_mark_node;
{
\f
/* Mark EXP saying that we need to be able to take the
address of it; it should not be allocated in a register.
- Value is 1 if successful.
+ Value is true if successful.
C++: we do not allow `current_class_ptr' to be addressable. */
-int
-mark_addressable (exp)
+bool
+cxx_mark_addressable (exp)
tree exp;
{
register tree x = exp;
if (TREE_ADDRESSABLE (x) == 1)
- return 1;
+ return true;
while (1)
switch (TREE_CODE (x))
{
error ("cannot take the address of `this', which is an rvalue expression");
TREE_ADDRESSABLE (x) = 1; /* so compiler doesn't die later */
- return 1;
+ return true;
}
case VAR_DECL:
/* Caller should not be trying to mark initialized
warning ("address requested for `%D', which is declared `register'",
x);
TREE_ADDRESSABLE (x) = 1;
- return 1;
+ return true;
case FUNCTION_DECL:
TREE_ADDRESSABLE (x) = 1;
TREE_ADDRESSABLE (DECL_ASSEMBLER_NAME (x)) = 1;
- return 1;
+ return true;
case CONSTRUCTOR:
TREE_ADDRESSABLE (x) = 1;
- return 1;
+ return true;
case TARGET_EXPR:
TREE_ADDRESSABLE (x) = 1;
- mark_addressable (TREE_OPERAND (x, 0));
- return 1;
+ cxx_mark_addressable (TREE_OPERAND (x, 0));
+ return true;
default:
- return 1;
+ return true;
}
}
\f
DECL_NONLOCAL (exp) = 1;
if (DECL_NO_STATIC_CHAIN (current_function_decl))
abort ();
- mark_addressable (exp);
+ (*lang_hooks.mark_addressable) (exp);
if (GET_CODE (DECL_RTL (exp)) != MEM)
abort ();
addr = XEXP (DECL_RTL (exp), 0);
+Mon Apr 1 21:39:36 2002 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * com.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine.
+ (mark_addressable): Rename.
+ (ffecom_arrayref_, ffecom_1): Update.
+
Mon Apr 1 09:59:53 2002 Neil Booth <neil@daikokuya.demon.co.uk>
* com.c (LANG_HOOKS_SIGNED_TYPE, LANG_HOOKS_UNSIGNED_TYPE,
static tree ffe_unsigned_type PARAMS ((tree));
static tree ffe_signed_type PARAMS ((tree));
static tree ffe_signed_or_unsigned_type PARAMS ((int, tree));
+static bool ffe_mark_addressable PARAMS ((tree));
static void ffecom_init_decl_processing PARAMS ((void));
static tree ffecom_arglist_expr_ (const char *argstring, ffebld args);
static tree ffecom_widest_expr_type_ (ffebld list);
return item;
if (ffeinfo_where (ffebld_info (expr)) == FFEINFO_whereFLEETING
- && ! mark_addressable (item))
+ && ! ffe_mark_addressable (item))
return error_mark_node;
}
if (code == ADDR_EXPR)
{
- if (!mark_addressable (node))
+ if (!ffe_mark_addressable (node))
assert ("can't mark_addressable this node!" == NULL);
}
#define LANG_HOOKS_PARSE_FILE ffe_parse_file
#undef LANG_HOOKS_MARK_TREE
#define LANG_HOOKS_MARK_TREE ffe_mark_tree
+#undef LANG_HOOKS_MARK_ADDRESSABLE
+#define LANG_HOOKS_MARK_ADDRESSABLE ffe_mark_addressable
#undef LANG_HOOKS_PRINT_IDENTIFIER
#define LANG_HOOKS_PRINT_IDENTIFIER ffe_print_identifier
#undef LANG_HOOKS_DECL_PRINTABLE_NAME
flag_complex_divide_method = 1;
}
-int
-mark_addressable (exp)
+static bool
+ffe_mark_addressable (exp)
tree exp;
{
register tree x = exp;
case CONSTRUCTOR:
TREE_ADDRESSABLE (x) = 1;
- return 1;
+ return true;
case VAR_DECL:
case CONST_DECL:
if (TREE_PUBLIC (x))
{
assert ("address of global register var requested" == NULL);
- return 0;
+ return false;
}
assert ("address of register variable requested" == NULL);
}
if (TREE_PUBLIC (x))
{
assert ("address of global register var requested" == NULL);
- return 0;
+ return false;
}
assert ("address of register var requested" == NULL);
}
#endif
default:
- return 1;
+ return true;
}
}
+2002-04-01 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * java-tree.h (java_mark_addressable): New.
+ * lang.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine.
+ * typeck.c (mark_addressable): Rename, update.
+
2002-04-01 Neil Booth <neil@daikokuya.demon.co.uk>
* expr.c (build_java_binop): Update.
extern void java_set_yydebug PARAMS ((int));
extern void java_parse_file PARAMS ((void));
extern void java_mark_tree PARAMS ((tree));
+extern bool java_mark_addressable PARAMS ((tree));
extern tree java_type_for_mode PARAMS ((enum machine_mode, int));
extern tree java_type_for_size PARAMS ((unsigned int, int));
extern tree java_unsigned_type PARAMS ((tree));
#define LANG_HOOKS_PARSE_FILE java_parse_file
#undef LANG_HOOKS_MARK_TREE
#define LANG_HOOKS_MARK_TREE java_mark_tree
+#undef LANG_HOOKS_MARK_ADDRESSABLE
+#define LANG_HOOKS_MARK_ADDRESSABLE java_mark_addressable
#undef LANG_HOOKS_EXPAND_EXPR
#define LANG_HOOKS_EXPAND_EXPR java_expand_expr
#undef LANG_HOOKS_DUP_LANG_SPECIFIC_DECL
/* Mark EXP saying that we need to be able to take the
address of it; it should not be allocated in a register.
- Value is 1 if successful. */
+ Value is true if successful. */
-int
-mark_addressable (exp)
+bool
+java_mark_addressable (exp)
tree exp;
{
register tree x = exp;
break;
case COND_EXPR:
- return mark_addressable (TREE_OPERAND (x, 1))
- & mark_addressable (TREE_OPERAND (x, 2));
+ return java_mark_addressable (TREE_OPERAND (x, 1))
+ && java_mark_addressable (TREE_OPERAND (x, 2));
case CONSTRUCTOR:
TREE_ADDRESSABLE (x) = 1;
- return 1;
+ return true;
case INDIRECT_REF:
/* We sometimes add a cast *(TYPE*)&FOO to handle type and mode
x = TREE_OPERAND (x, 0);
break;
}
- return 1;
+ return true;
case VAR_DECL:
case CONST_DECL:
#endif
/* drops through */
default:
- return 1;
+ return true;
}
}
LANG_HOOKS_SAFE_FROM_P, \
LANG_HOOKS_FINISH_INCOMPLETE_DECL, \
LANG_HOOKS_UNSAFE_FOR_REEVAL, \
+ LANG_HOOKS_MARK_ADDRESSABLE, \
LANG_HOOKS_STATICP, \
LANG_HOOKS_DUP_LANG_SPECIFIC_DECL, \
LANG_HOOKS_UNSAVE_EXPR_NOW, \
through. The default hook returns a negative number. */
int (*unsafe_for_reeval) PARAMS ((tree));
+ /* Mark EXP saying that we need to be able to take the address of
+ it; it should not be allocated in a register. Return true if
+ successful. */
+ bool (*mark_addressable) PARAMS ((tree));
+
/* Hook called by staticp for language-specific tree codes. */
int (*staticp) PARAMS ((tree));
#define LANG_HOOKS_MARK_TREE c_mark_tree
#undef LANG_HOOKS_EXPAND_EXPR
#define LANG_HOOKS_EXPAND_EXPR c_expand_expr
+#undef LANG_HOOKS_MARK_ADDRESSABLE
+#define LANG_HOOKS_MARK_ADDRESSABLE c_mark_addressable
#undef LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES
#define LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES c_insert_default_attributes
#undef LANG_HOOKS_FINISH_INCOMPLETE_DECL
|| (DECL_P (val)
&& GET_CODE (DECL_RTL (val)) == REG
&& GET_MODE (DECL_RTL (val)) != TYPE_MODE (type))))
- mark_addressable (val);
+ (*lang_hooks.mark_addressable) (val);
if (is_inout)
ninout++;
return;
if (! allows_reg && allows_mem)
- mark_addressable (TREE_VALUE (tail));
+ (*lang_hooks.mark_addressable) (TREE_VALUE (tail));
}
/* Second pass evaluates arguments. */
/* In front end. */
-extern int mark_addressable PARAMS ((tree));
extern void incomplete_type_error PARAMS ((tree, tree));
extern tree truthvalue_conversion PARAMS ((tree));