This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
C++ bootstrap (part 6/n): Also fix prototype of c_staticp().
- From: Bernardo Innocenti <bernie at develer dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 25 Jul 2004 04:48:43 +0200
- Subject: C++ bootstrap (part 6/n): Also fix prototype of c_staticp().
- Organization: Develer S.r.l.
Hello,
this ultimately fixes the mess I've caused with a C++ patch
bit that had slipped into an earlier patch.
These other bits had to go in too, but I was planning
them for a later patch.
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.
Index: c-common.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-common.h,v
retrieving revision 1.251
diff -u -p -r1.251 c-common.h
--- c-common.h 20 Jul 2004 09:56:59 -0000 1.251
+++ c-common.h 25 Jul 2004 02:40:42 -0000
@@ -832,7 +832,7 @@ extern int vector_types_convertible_p (t
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);
Index: tree.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree.c,v
retrieving revision 1.402
diff -u -p -r1.402 tree.c
--- tree.c 23 Jul 2004 22:37:23 -0000 1.402
+++ tree.c 25 Jul 2004 02:40:54 -0000
@@ -1267,10 +1267,10 @@ array_type_nelts (tree type)
: fold (build2 (MINUS_EXPR, TREE_TYPE (max), max, min)));
}
-/* 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))
@@ -1291,7 +1291,7 @@ staticp (tree 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
@@ -1302,12 +1302,12 @@ staticp (tree arg)
/* 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
@@ -1323,14 +1323,14 @@ staticp (tree arg)
&& 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;
}
}
Index: langhooks.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/langhooks.h,v
retrieving revision 1.93
diff -u -p -r1.93 langhooks.h
--- langhooks.h 17 Jul 2004 19:34:50 -0000 1.93
+++ langhooks.h 25 Jul 2004 02:40:54 -0000
@@ -304,7 +304,7 @@ struct lang_hooks
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. */
--
// Bernardo Innocenti - Develer S.r.l., R&D dept.
\X/ http://www.develer.com/