+2004-07-25 Bernardo Innocenti <bernie@develer.com>
+
+ * c-common.h (c_staticp): Change return type from int to bool.
+ * tree.c (staticp): Likewise.
+ * langhooks.h (staticp): Likewise.
+
2004-07-25 Bernardo Innocenti <bernie@develer.com>
* langhooks-def.h (lhd_staticp): Change return type from int to
extern rtx c_expand_expr (tree, rtx, enum machine_mode, int, rtx *);
-extern int c_staticp (tree);
+extern bool c_staticp (tree);
extern int c_common_unsafe_for_reeval (tree);
bool (*mark_addressable) (tree);
/* Hook called by staticp for language-specific tree codes. */
- int (*staticp) (tree);
+ bool (*staticp) (tree);
/* Replace the DECL_LANG_SPECIFIC data, which may be NULL, of the
DECL_NODE with a newly GC-allocated copy. */
: fold (build2 (MINUS_EXPR, TREE_TYPE (max), max, min)));
}
\f
-/* Return nonzero if arg is static -- a reference to an object in
+/* Return true if arg is static -- a reference to an object in
static storage. This is not the same as the C meaning of `static'. */
-int
+bool
staticp (tree arg)
{
switch (TREE_CODE (arg))
case LABEL_DECL:
case STRING_CST:
- return 1;
+ return true;
case COMPONENT_REF:
/* If the thing being referenced is not a field, then it is
/* If we are referencing a bitfield, we can't evaluate an
ADDR_EXPR at compile time and so it isn't a constant. */
if (DECL_BIT_FIELD (TREE_OPERAND (arg, 1)))
- return 0;
+ return false;
return staticp (TREE_OPERAND (arg, 0));
case BIT_FIELD_REF:
- return 0;
+ return false;
#if 0
/* This case is technically correct, but results in setting
&& TREE_CODE (TREE_OPERAND (arg, 1)) == INTEGER_CST)
return staticp (TREE_OPERAND (arg, 0));
else
- return 0;
+ return false;
default:
if ((unsigned int) TREE_CODE (arg)
>= (unsigned int) LAST_AND_UNUSED_TREE_CODE)
return lang_hooks.staticp (arg);
else
- return 0;
+ return false;
}
}
\f