summaryrefslogtreecommitdiffstats
path: root/gcc/c-common.h
diff options
context:
space:
mode:
authorsteven <steven@138bc75d-0d04-0410-961f-82ee72b054a4>2003-04-10 08:07:13 +0000
committersteven <steven@138bc75d-0d04-0410-961f-82ee72b054a4>2003-04-10 08:07:13 +0000
commitbac624360b7b8c029b92989befa0f56e704094cf (patch)
tree1dde01740299a69072dd80110dc8eeb2a9b2789c /gcc/c-common.h
parenta2febbfb2b290b8238dcba21e7df3788c2bb86ab (diff)
downloadppe42-gcc-bac624360b7b8c029b92989befa0f56e704094cf.tar.gz
ppe42-gcc-bac624360b7b8c029b92989befa0f56e704094cf.zip
2003-04-09 Steven Bosscher <steven@gcc.gnu.org>
* c-common.h (lang_statement_code_p): Remove declaration. (statement_code_p): Ditto. (c_common_stmt_codes): Define; list of c-common statement codes. (statement_code_p): New extern declaration. (STATEMENT_CODE_P): Define. (INIT_STATEMENT_CODES): Define. * c-common.c (statement_code_p): Kill the function, declare as an array of bools instead. (lang_statement_code_p): Remove. (walk_stmt_tree): Use STATEMENT_CODE_P not statement_code_p. (c_safe_from_p): Ditto. * c-objc-common.c (c_objc_common_init): Use INIT_STATEMENT_CODES to initialize the statement_code_p array. * tree-inline.c (walk_tree): Use STATEMENT_CODE_P instead of statement_code_p. (copy_tree_r): Ditto. * cp/cp-tree.h (cp_stmt_codes): Define; list of C++ specific statement tree codes. * cp/lex.c (cxx_init): Add missing print line break. Use INIT_STATEMENT_CODES to initialize the statement_code_p array. * cp/parser.c (cp_parser_statement): Use STATEMENT_CODE_P instead of statement_code_p. * cp/pt.c (tsubst_expr): Ditto. * cp/tree.c (verify_stmt_tree_r): Ditto. (cp_statement_code_p): Remove. (init_tree): Don't set lang_statement_code_p, it's gone. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@65422 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-common.h')
-rw-r--r--gcc/c-common.h24
1 files changed, 22 insertions, 2 deletions
diff --git a/gcc/c-common.h b/gcc/c-common.h
index 20c7c394aa0..ed67ce6f7d4 100644
--- a/gcc/c-common.h
+++ b/gcc/c-common.h
@@ -305,7 +305,6 @@ struct c_language_function GTY(()) {
/* Language-specific hooks. */
-extern int (*lang_statement_code_p) PARAMS ((enum tree_code));
extern void (*lang_expand_stmt) PARAMS ((tree));
extern void (*lang_expand_decl_stmt) PARAMS ((tree));
extern void (*lang_expand_function_end) PARAMS ((void));
@@ -326,7 +325,6 @@ extern void add_decl_stmt PARAMS ((tree));
extern tree add_scope_stmt PARAMS ((int, int));
extern void finish_stmt_tree PARAMS ((tree *));
-extern int statement_code_p PARAMS ((enum tree_code));
extern tree walk_stmt_tree PARAMS ((tree *,
walk_tree_fn,
void *));
@@ -1152,6 +1150,28 @@ enum c_tree_code {
#undef DEFTREECODE
+#define c_common_stmt_codes \
+ CLEANUP_STMT, EXPR_STMT, COMPOUND_STMT, \
+ DECL_STMT, IF_STMT, FOR_STMT, \
+ WHILE_STMT, DO_STMT, RETURN_STMT, \
+ BREAK_STMT, CONTINUE_STMT, SCOPE_STMT, \
+ SWITCH_STMT, GOTO_STMT, LABEL_STMT, \
+ ASM_STMT, FILE_STMT, CASE_LABEL
+
+/* TRUE if a code represents a statement. The front end init
+ langhook should take care of initialization of this array. */
+extern bool statement_code_p[MAX_TREE_CODES];
+
+#define STATEMENT_CODE_P(CODE) statement_code_p[(int) (CODE)]
+
+#define INIT_STATEMENT_CODES(STMT_CODES) \
+ do { \
+ unsigned int i; \
+ memset (&statement_code_p, 0, sizeof (statement_code_p)); \
+ for (i = 0; i < ARRAY_SIZE (STMT_CODES); i++) \
+ statement_code_p[STMT_CODES[i]] = true; \
+ } while (0)
+
extern void genrtl_do_pushlevel PARAMS ((void));
extern void genrtl_goto_stmt PARAMS ((tree));
extern void genrtl_expr_stmt PARAMS ((tree));
OpenPOWER on IntegriCloud