summaryrefslogtreecommitdiffstats
path: root/gcc/c-common.h
diff options
context:
space:
mode:
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