aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorSteven Bosscher <steven@gcc.gnu.org>2003-04-10 08:07:13 +0000
committerSteven Bosscher <steven@gcc.gnu.org>2003-04-10 08:07:13 +0000
commit009ed91036a508ccaa07c95f246adc3d763cc93c (patch)
tree1dde01740299a69072dd80110dc8eeb2a9b2789c /gcc/cp
parent23cac8856600b027fe0397d99dbacb939675c11f (diff)
downloadgcc-009ed91036a508ccaa07c95f246adc3d763cc93c.zip
gcc-009ed91036a508ccaa07c95f246adc3d763cc93c.tar.gz
gcc-009ed91036a508ccaa07c95f246adc3d763cc93c.tar.bz2
c-common.h (lang_statement_code_p): Remove declaration.
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. From-SVN: r65422
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/cp-tree.h4
-rw-r--r--gcc/cp/lex.c9
-rw-r--r--gcc/cp/parser.c2
-rw-r--r--gcc/cp/pt.c2
-rw-r--r--gcc/cp/tree.c25
5 files changed, 15 insertions, 27 deletions
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 2986d6b..0e9a201 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -902,6 +902,10 @@ enum cplus_tree_code {
};
#undef DEFTREECODE
+#define cp_stmt_codes \
+ CTOR_INITIALIZER, TRY_BLOCK, HANDLER, \
+ EH_SPEC_BLOCK, USING_STMT, TAG_DEFN
+
enum languages { lang_c, lang_cplusplus, lang_java };
/* Macros to make error reporting functions' lives easier. */
diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c
index 6433f2b..617be82 100644
--- a/gcc/cp/lex.c
+++ b/gcc/cp/lex.c
@@ -401,7 +401,7 @@ init_cp_pragma ()
c_register_pragma ("GCC", "implementation", handle_pragma_implementation);
c_register_pragma ("GCC", "java_exceptions", handle_pragma_java_exceptions);
}
-
+
/* Initialize the C++ front end. This function is very sensitive to
the exact order that things are done here. It would be nice if the
initialization done by this routine were moved to its subroutines,
@@ -409,6 +409,13 @@ init_cp_pragma ()
bool
cxx_init (void)
{
+ static const enum tree_code stmt_codes[] = {
+ c_common_stmt_codes,
+ cp_stmt_codes
+ };
+
+ INIT_STATEMENT_CODES (stmt_codes);
+
input_filename = "<internal>";
init_reswords ();
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 8cc46f9..8f992c5 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -5660,7 +5660,7 @@ cp_parser_statement (cp_parser* parser)
}
/* Set the line number for the statement. */
- if (statement && statement_code_p (TREE_CODE (statement)))
+ if (statement && STATEMENT_CODE_P (TREE_CODE (statement)))
STMT_LINENO (statement) = statement_line_number;
}
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index b5ea239..b373329 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -7569,7 +7569,7 @@ tsubst_expr (t, args, complain, in_decl)
if (processing_template_decl)
return tsubst_copy (t, args, complain, in_decl);
- if (!statement_code_p (TREE_CODE (t)))
+ if (!STATEMENT_CODE_P (TREE_CODE (t)))
return tsubst_copy_and_build (t, args, complain, in_decl);
switch (TREE_CODE (t))
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 97d297a..edb4ca0 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -49,7 +49,6 @@ static tree build_target_expr PARAMS ((tree, tree));
static tree count_trees_r PARAMS ((tree *, int *, void *));
static tree verify_stmt_tree_r PARAMS ((tree *, int *, void *));
static tree find_tree_r PARAMS ((tree *, int *, void *));
-extern int cp_statement_code_p PARAMS ((enum tree_code));
static tree handle_java_interface_attribute PARAMS ((tree *, tree, tree, int, bool *));
static tree handle_com_interface_attribute PARAMS ((tree *, tree, tree, int, bool *));
@@ -1119,27 +1118,6 @@ is_aggr_type_2 (t1, t2)
return 0;
return IS_AGGR_TYPE (t1) && IS_AGGR_TYPE (t2);
}
-
-/* Returns nonzero if CODE is the code for a statement. */
-
-int
-cp_statement_code_p (code)
- enum tree_code code;
-{
- switch (code)
- {
- case CTOR_INITIALIZER:
- case TRY_BLOCK:
- case HANDLER:
- case EH_SPEC_BLOCK:
- case USING_STMT:
- case TAG_DEFN:
- return 1;
-
- default:
- return 0;
- }
-}
#define PRINT_RING_SIZE 4
@@ -1275,7 +1253,7 @@ verify_stmt_tree_r (tp, walk_subtrees, data)
htab_t *statements = (htab_t *) data;
void **slot;
- if (!statement_code_p (TREE_CODE (t)))
+ if (!STATEMENT_CODE_P (TREE_CODE (t)))
return NULL_TREE;
/* If this statement is already present in the hash table, then
@@ -2406,7 +2384,6 @@ cp_end_inlining (fn)
void
init_tree ()
{
- lang_statement_code_p = cp_statement_code_p;
list_hash_table = htab_create_ggc (31, list_hash, list_hash_eq, NULL);
}