From aaf46ef9792bbc562175b606bd1c3f225ea56924 Mon Sep 17 00:00:00 2001 From: Diego Novillo Date: Thu, 26 Jan 2006 02:53:01 +0000 Subject: re PR middle-end/25886 (up to 256 tree codes for Objective-C++) * tree.h (TREE_RANGE_CHECK): Fix range predicate. (TREE_BLOCK): Add call to EXPR_CHECK. PR 25886 * tree-dump.c (dequeue_and_dump): Handle OMP_CLAUSE. * tree-pretty-print.c (dump_omp_clause): Extract from ... (dump_omp_clauses): ... here. (dump_generic_node): Handle OMP_CLAUSE. * tree.c (omp_clause_num_ops): New. (omp_clause_code_name): New. (tree_code_size): Handle OMP_CLAUSE. (tree_size): Likewise. (make_node): Document handling of OMP_CLAUSE. (tree_node_structure): Handle OMP_CLAUSE. (omp_clause_check_failed): New. (omp_clause_range_check_failed): New. (omp_clause_operand_check_failed): New. (build_omp_clause): New. (walk_tree): Adjust handling of OMP_CLAUSE_* nodes. * tree.h (enum omp_clause_code): Declare. (OMP_CLAUSE_SUBCODE): Define. (OMP_CLAUSE_RANGE_CHECK): Define. (OMP_CLAUSE_ELT_CHECK): Define. (omp_clause_check_failed): Declare. (omp_clause_operand_check_failed): Declare. (omp_clause_range_check_failed): Declare. (OMP_CLAUSE_CHAIN): Do not use TREE_RANGE_CHECK. (OMP_CLAUSE_OPERAND): Use OMP_CLAUSE_RANGE_CHECK. (OMP_CLAUSE_PRIVATE_DEBUG): Use OMP_CLAUSE_SUBCODE_CHECK. (OMP_CLAUSE_LASTPRIVATE): Likewise. (OMP_CLAUSE_IF_EXPR): Likewise. (OMP_CLAUSE_NUM_THREADS_EXPR): Likewise. (OMP_CLAUSE_SCHEDULE_CHUNK_EXPR): Likewise. (OMP_CLAUSE_REDUCTION_CODE): Likewise. (OMP_CLAUSE_REDUCTION_INIT): Likewise. (OMP_CLAUSE_REDUCTION_MERGE): Likewise. (OMP_CLAUSE_REDUCTION_PLACEHOLDER): Likewise. Use tree_node.omp_clause.subcode instead of TREE_COMPLEXITY. (OMP_CLAUSE_SCHEDULE_KIND): Likewise. (OMP_CLAUSE_DEFAULT_KIND): Likewise. (OMP_CLAUSE_CODE): Define. (OMP_CLAUSE_SET_CODE): Define. (OMP_CLAUSE_CODE): Define. (OMP_CLAUSE_OPERAND): Define. (struct tree_omp_clause): Declare. (union tree_node): Add field 'omp_clause'. * treestruct.def (TS_OMP_CLAUSE): Define. * tree.def (OMP_CLAUSE_PRIVATE, OMP_CLAUSE_SHARED OMP_CLAUSE_FIRSTPRIVATE, OMP_CLAUSE_LASTPRIVATE, OMP_CLAUSE_REDUCTION, OMP_CLAUSE_COPYIN, OMP_CLAUSE_COPYPRIVATE, OMP_CLAUSE_IF, OMP_CLAUSE_NUM_THREADS, OMP_CLAUSE_SCHEDULE, OMP_CLAUSE_NOWAIT, OMP_CLAUSE_ORDERED, OMP_CLAUSE_DEFAULT): Remove. (OMP_CLAUSE): Define. * print-tree.c (print_node): Handle OMP_CLAUSE. * omp-low.c: Adapt all uses of OMP_CLAUSE_* nodes. * c-typeck.c: Likewise. * gimplify.c: Likewise. * c-omp.c: Likewise. * tree-nested.c: Likewise. * tree-inline.c: Likewise. * c-parser.c: Likewise. * gimple-low.c (lower_omp_directive): Do not set TREE_BLOCK on clauses. From-SVN: r110243 --- gcc/c-parser.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'gcc/c-parser.c') diff --git a/gcc/c-parser.c b/gcc/c-parser.c index a5fa523..b572273 100644 --- a/gcc/c-parser.c +++ b/gcc/c-parser.c @@ -6625,7 +6625,7 @@ check_no_duplicate_clause (tree clauses, enum tree_code code, const char *name) tree c; for (c = clauses; c ; c = OMP_CLAUSE_CHAIN (c)) - if (TREE_CODE (c) == code) + if (OMP_CLAUSE_CODE (c) == code) { error ("too many %qs clauses", name); break; @@ -6644,7 +6644,8 @@ check_no_duplicate_clause (tree clauses, enum tree_code code, const char *name) return the list created. */ static tree -c_parser_omp_variable_list (c_parser *parser, enum tree_code kind, tree list) +c_parser_omp_variable_list (c_parser *parser, enum omp_clause_code kind, + tree list) { if (c_parser_next_token_is_not (parser, CPP_NAME) || c_parser_peek_token (parser)->id_kind != C_ID_ID) @@ -6662,7 +6663,7 @@ c_parser_omp_variable_list (c_parser *parser, enum tree_code kind, tree list) ; else if (kind != 0) { - tree u = make_node (kind); + tree u = build_omp_clause (kind); OMP_CLAUSE_DECL (u) = t; OMP_CLAUSE_CHAIN (u) = list; list = u; @@ -6759,7 +6760,7 @@ c_parser_omp_clause_default (c_parser *parser, tree list) return list; check_no_duplicate_clause (list, OMP_CLAUSE_DEFAULT, "default"); - c = make_node (OMP_CLAUSE_DEFAULT); + c = build_omp_clause (OMP_CLAUSE_DEFAULT); OMP_CLAUSE_CHAIN (c) = list; OMP_CLAUSE_DEFAULT_KIND (c) = kind; @@ -6788,7 +6789,7 @@ c_parser_omp_clause_if (c_parser *parser, tree list) check_no_duplicate_clause (list, OMP_CLAUSE_IF, "if"); - c = make_node (OMP_CLAUSE_IF); + c = build_omp_clause (OMP_CLAUSE_IF); OMP_CLAUSE_IF_EXPR (c) = t; OMP_CLAUSE_CHAIN (c) = list; list = c; @@ -6818,7 +6819,7 @@ c_parser_omp_clause_nowait (c_parser *parser ATTRIBUTE_UNUSED, tree list) check_no_duplicate_clause (list, OMP_CLAUSE_NOWAIT, "nowait"); - c = make_node (OMP_CLAUSE_NOWAIT); + c = build_omp_clause (OMP_CLAUSE_NOWAIT); OMP_CLAUSE_CHAIN (c) = list; return c; } @@ -6852,7 +6853,7 @@ c_parser_omp_clause_num_threads (c_parser *parser, tree list) check_no_duplicate_clause (list, OMP_CLAUSE_NUM_THREADS, "num_threads"); - c = make_node (OMP_CLAUSE_NUM_THREADS); + c = build_omp_clause (OMP_CLAUSE_NUM_THREADS); OMP_CLAUSE_NUM_THREADS_EXPR (c) = t; OMP_CLAUSE_CHAIN (c) = list; list = c; @@ -6871,7 +6872,7 @@ c_parser_omp_clause_ordered (c_parser *parser ATTRIBUTE_UNUSED, tree list) check_no_duplicate_clause (list, OMP_CLAUSE_ORDERED, "ordered"); - c = make_node (OMP_CLAUSE_ORDERED); + c = build_omp_clause (OMP_CLAUSE_ORDERED); OMP_CLAUSE_CHAIN (c) = list; return c; } @@ -6963,7 +6964,7 @@ c_parser_omp_clause_schedule (c_parser *parser, tree list) if (!c_parser_require (parser, CPP_OPEN_PAREN, "expected %<(%>")) return list; - c = make_node (OMP_CLAUSE_SCHEDULE); + c = build_omp_clause (OMP_CLAUSE_SCHEDULE); if (c_parser_next_token_is (parser, CPP_NAME)) { -- cgit v1.1