aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
authorDiego Novillo <dnovillo@redhat.com>2006-01-26 02:53:01 +0000
committerDiego Novillo <dnovillo@gcc.gnu.org>2006-01-25 21:53:01 -0500
commitaaf46ef9792bbc562175b606bd1c3f225ea56924 (patch)
tree6b35ae8b0d86fdf04a2e7d85a967d4e8e0d276fd /gcc/gimplify.c
parentd89b36e1a2179df76edf089cc2a11f5f3409cb72 (diff)
downloadgcc-aaf46ef9792bbc562175b606bd1c3f225ea56924.zip
gcc-aaf46ef9792bbc562175b606bd1c3f225ea56924.tar.gz
gcc-aaf46ef9792bbc562175b606bd1c3f225ea56924.tar.bz2
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
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r--gcc/gimplify.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 7d7b80f..cb1b95e 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -4443,7 +4443,7 @@ gimplify_scan_omp_clauses (tree *list_p, tree *pre_p, bool in_parallel)
unsigned int flags;
tree decl;
- switch (TREE_CODE (c))
+ switch (OMP_CLAUSE_CODE (c))
{
case OMP_CLAUSE_PRIVATE:
flags = GOVD_PRIVATE | GOVD_EXPLICIT;
@@ -4504,7 +4504,7 @@ gimplify_scan_omp_clauses (tree *list_p, tree *pre_p, bool in_parallel)
case OMP_CLAUSE_SCHEDULE:
case OMP_CLAUSE_IF:
case OMP_CLAUSE_NUM_THREADS:
- gs = gimplify_expr (&TREE_OPERAND (c, 0), pre_p, NULL,
+ gs = gimplify_expr (&OMP_CLAUSE_OPERAND (c, 0), pre_p, NULL,
is_gimple_val, fb_rvalue);
if (gs == GS_ERROR)
remove = true;
@@ -4540,7 +4540,7 @@ gimplify_adjust_omp_clauses_1 (splay_tree_node n, void *data)
tree *list_p = (tree *) data;
tree decl = (tree) n->key;
unsigned flags = n->value;
- enum tree_code code;
+ enum omp_clause_code code;
tree clause;
bool private_debug;
@@ -4572,7 +4572,8 @@ gimplify_adjust_omp_clauses_1 (splay_tree_node n, void *data)
else
gcc_unreachable ();
- clause = build1 (code, void_type_node, decl);
+ clause = build_omp_clause (code);
+ OMP_CLAUSE_DECL (clause) = decl;
OMP_CLAUSE_CHAIN (clause) = *list_p;
if (private_debug)
OMP_CLAUSE_PRIVATE_DEBUG (clause) = 1;
@@ -4592,7 +4593,7 @@ gimplify_adjust_omp_clauses (tree *list_p)
splay_tree_node n;
bool remove = false;
- switch (TREE_CODE (c))
+ switch (OMP_CLAUSE_CODE (c))
{
case OMP_CLAUSE_PRIVATE:
case OMP_CLAUSE_SHARED:
@@ -4602,14 +4603,14 @@ gimplify_adjust_omp_clauses (tree *list_p)
remove = !(n->value & GOVD_SEEN);
if (! remove)
{
- bool shared = TREE_CODE (c) == OMP_CLAUSE_SHARED;
+ bool shared = OMP_CLAUSE_CODE (c) == OMP_CLAUSE_SHARED;
if ((n->value & GOVD_DEBUG_PRIVATE)
|| lang_hooks.decls.omp_private_debug_clause (decl, shared))
{
gcc_assert ((n->value & GOVD_DEBUG_PRIVATE) == 0
|| ((n->value & GOVD_DATA_SHARE_CLASS)
== GOVD_PRIVATE));
- TREE_SET_CODE (c, OMP_CLAUSE_PRIVATE);
+ OMP_CLAUSE_SET_CODE (c, OMP_CLAUSE_PRIVATE);
OMP_CLAUSE_PRIVATE_DEBUG (c) = 1;
}
}