diff options
author | Andrew MacLeod <amacleod@redhat.com> | 2013-10-17 17:41:07 +0000 |
---|---|---|
committer | Andrew Macleod <amacleod@gcc.gnu.org> | 2013-10-17 17:41:07 +0000 |
commit | 0645c1a22d29fcbe12ee8f774709b20b1bc3f594 (patch) | |
tree | 7581ded8e73540ef06a21726e484e189f067777a /gcc/tree-cfg.c | |
parent | 6f1abb55073c46b93155e13eb5308aee7f13dd5e (diff) | |
download | gcc-0645c1a22d29fcbe12ee8f774709b20b1bc3f594.zip gcc-0645c1a22d29fcbe12ee8f774709b20b1bc3f594.tar.gz gcc-0645c1a22d29fcbe12ee8f774709b20b1bc3f594.tar.bz2 |
tree-flow.h (struct omp_region): Move to omp-low.c.
* tree-flow.h (struct omp_region): Move to omp-low.c.
Remove omp_ prototypes and variables.
* gimple.h (omp_reduction_init): Move prototype to omp-low.h.
(copy_var_decl): Relocate prototype from tree-flow.h.
* gimple.c (copy_var_decl): Relocate from omp-low.c.
* tree.h: Move prototype to omp-low.h.
* omp-low.h: New File. Relocate prototypes here.
* omp-low.c (struct omp_region): Make local here.
(root_omp_region): Make static.
(copy_var_decl) Move to gimple.c.
(new_omp_region): Make static.
(make_gimple_omp_edges): New. Refactored from tree-cfg.c make_edges.
* tree-cfg.c: Include omp-low.h.
(make_edges): Factor out OMP specific bits to make_gimple_omp_edges.
* gimplify.c: Include omp-low.h.
* tree-parloops.c: Likewise.
c
* c-parser.c: Include omp-low.h.
* c-typeck.c: Likewise.
cp
* parser.c: Include omp-low.h.
* semantics.c: Likewise.
fortran
* trans-openmp.c: Include omp-low.h.
From-SVN: r203786
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r-- | gcc/tree-cfg.c | 97 |
1 files changed, 4 insertions, 93 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index 8b66791..9268615 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -42,6 +42,7 @@ along with GCC; see the file COPYING3. If not see #include "tree-inline.h" #include "target.h" #include "tree-ssa-live.h" +#include "omp-low.h" /* This file contains functions for building the Control Flow Graph (CFG) for a function tree. */ @@ -607,97 +608,8 @@ make_edges (void) fallthru = true; break; - case GIMPLE_OMP_PARALLEL: - case GIMPLE_OMP_TASK: - case GIMPLE_OMP_FOR: - case GIMPLE_OMP_SINGLE: - case GIMPLE_OMP_TEAMS: - case GIMPLE_OMP_MASTER: - case GIMPLE_OMP_TASKGROUP: - case GIMPLE_OMP_ORDERED: - case GIMPLE_OMP_CRITICAL: - case GIMPLE_OMP_SECTION: - cur_region = new_omp_region (bb, code, cur_region); - fallthru = true; - break; - - case GIMPLE_OMP_TARGET: - cur_region = new_omp_region (bb, code, cur_region); - fallthru = true; - if (gimple_omp_target_kind (last) == GF_OMP_TARGET_KIND_UPDATE) - cur_region = cur_region->outer; - break; - - case GIMPLE_OMP_SECTIONS: - cur_region = new_omp_region (bb, code, cur_region); - fallthru = true; - break; - - case GIMPLE_OMP_SECTIONS_SWITCH: - fallthru = false; - break; - - case GIMPLE_OMP_ATOMIC_LOAD: - case GIMPLE_OMP_ATOMIC_STORE: - fallthru = true; - break; - - case GIMPLE_OMP_RETURN: - /* In the case of a GIMPLE_OMP_SECTION, the edge will go - somewhere other than the next block. This will be - created later. */ - cur_region->exit = bb; - fallthru = cur_region->type != GIMPLE_OMP_SECTION; - cur_region = cur_region->outer; - break; - - case GIMPLE_OMP_CONTINUE: - cur_region->cont = bb; - switch (cur_region->type) - { - case GIMPLE_OMP_FOR: - /* Mark all GIMPLE_OMP_FOR and GIMPLE_OMP_CONTINUE - succs edges as abnormal to prevent splitting - them. */ - single_succ_edge (cur_region->entry)->flags |= EDGE_ABNORMAL; - /* Make the loopback edge. */ - make_edge (bb, single_succ (cur_region->entry), - EDGE_ABNORMAL); - - /* Create an edge from GIMPLE_OMP_FOR to exit, which - corresponds to the case that the body of the loop - is not executed at all. */ - make_edge (cur_region->entry, bb->next_bb, EDGE_ABNORMAL); - make_edge (bb, bb->next_bb, EDGE_FALLTHRU | EDGE_ABNORMAL); - fallthru = false; - break; - - case GIMPLE_OMP_SECTIONS: - /* Wire up the edges into and out of the nested sections. */ - { - basic_block switch_bb = single_succ (cur_region->entry); - - struct omp_region *i; - for (i = cur_region->inner; i ; i = i->next) - { - gcc_assert (i->type == GIMPLE_OMP_SECTION); - make_edge (switch_bb, i->entry, 0); - make_edge (i->exit, bb, EDGE_FALLTHRU); - } - - /* Make the loopback edge to the block with - GIMPLE_OMP_SECTIONS_SWITCH. */ - make_edge (bb, switch_bb, 0); - - /* Make the edge from the switch to exit. */ - make_edge (switch_bb, bb->next_bb, 0); - fallthru = false; - } - break; - - default: - gcc_unreachable (); - } + CASE_GIMPLE_OMP: + fallthru = make_gimple_omp_edges (bb, &cur_region); break; case GIMPLE_TRANSACTION: @@ -721,8 +633,7 @@ make_edges (void) make_edge (bb, bb->next_bb, EDGE_FALLTHRU); } - if (root_omp_region) - free_omp_regions (); + free_omp_regions (); /* Fold COND_EXPR_COND of each COND_EXPR. */ fold_cond_expr_cond (); |