/* OpenMP directive translation -- generate GCC trees from gfc_code.
- Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 2005-2013 Free Software Foundation, Inc.
Contributed by Jakub Jelinek <jakub@redhat.com>
This file is part of GCC.
gcc_assert (t == SUCCESS);
/* Create the init statement list. */
- pushlevel (0);
+ pushlevel ();
if (GFC_DESCRIPTOR_TYPE_P (type)
&& GFC_TYPE_ARRAY_AKIND (type) == GFC_ARRAY_ALLOCATABLE)
{
else
stmt = gfc_trans_assignment (e1, e2, false, false);
if (TREE_CODE (stmt) != BIND_EXPR)
- stmt = build3_v (BIND_EXPR, NULL, stmt, poplevel (1, 0, 0));
+ stmt = build3_v (BIND_EXPR, NULL, stmt, poplevel (1, 0));
else
- poplevel (0, 0, 0);
+ poplevel (0, 0);
OMP_CLAUSE_REDUCTION_INIT (c) = stmt;
/* Create the merge statement list. */
- pushlevel (0);
+ pushlevel ();
if (GFC_DESCRIPTOR_TYPE_P (type)
&& GFC_TYPE_ARRAY_AKIND (type) == GFC_ARRAY_ALLOCATABLE)
{
else
stmt = gfc_trans_assignment (e3, e4, false, true);
if (TREE_CODE (stmt) != BIND_EXPR)
- stmt = build3_v (BIND_EXPR, NULL, stmt, poplevel (1, 0, 0));
+ stmt = build3_v (BIND_EXPR, NULL, stmt, poplevel (1, 0));
else
- poplevel (0, 0, 0);
+ poplevel (0, 0);
OMP_CLAUSE_REDUCTION_MERGE (c) = stmt;
/* And stick the placeholder VAR_DECL into the clause as well. */
{
tree stmt;
- pushlevel (0);
+ pushlevel ();
stmt = gfc_trans_code (code);
if (TREE_CODE (stmt) != BIND_EXPR)
{
if (!IS_EMPTY_STMT (stmt) || force_empty)
{
- tree block = poplevel (1, 0, 0);
+ tree block = poplevel (1, 0);
stmt = build3_v (BIND_EXPR, NULL, stmt, block);
}
else
- poplevel (0, 0, 0);
+ poplevel (0, 0);
}
else
- poplevel (0, 0, 0);
+ poplevel (0, 0);
return stmt;
}
tree init;
} dovar_init;
-DEF_VEC_O(dovar_init);
-DEF_VEC_ALLOC_O(dovar_init,heap);
static tree
gfc_trans_omp_do (gfc_code *code, stmtblock_t *pblock,
stmtblock_t body;
gfc_omp_clauses *clauses = code->ext.omp_clauses;
int i, collapse = clauses->collapse;
- VEC(dovar_init,heap) *inits = NULL;
+ vec<dovar_init> inits = vNULL;
dovar_init *di;
unsigned ix;
/* Initialize DOVAR. */
tmp = fold_build2_loc (input_location, MULT_EXPR, type, count, step);
tmp = fold_build2_loc (input_location, PLUS_EXPR, type, from, tmp);
- di = VEC_safe_push (dovar_init, heap, inits, NULL);
- di->var = dovar;
- di->init = tmp;
+ dovar_init e = {dovar, tmp};
+ inits.safe_push (e);
}
if (!dovar_found)
if (pblock != &block)
{
- pushlevel (0);
+ pushlevel ();
gfc_start_block (&block);
}
gfc_start_block (&body);
- FOR_EACH_VEC_ELT (dovar_init, inits, ix, di)
+ FOR_EACH_VEC_ELT (inits, ix, di)
gfc_add_modify (&body, di->var, di->init);
- VEC_free (dovar_init, heap, inits);
+ inits.release ();
/* Cycle statement is implemented with a goto. Exit statement must not be
present for this loop. */
if (!do_clauses.ordered && do_clauses.sched_kind != OMP_SCHED_STATIC)
pblock = █
else
- pushlevel (0);
+ pushlevel ();
stmt = gfc_trans_omp_do (code, pblock, &do_clauses, omp_clauses);
if (TREE_CODE (stmt) != BIND_EXPR)
- stmt = build3_v (BIND_EXPR, NULL, stmt, poplevel (1, 0, 0));
+ stmt = build3_v (BIND_EXPR, NULL, stmt, poplevel (1, 0));
else
- poplevel (0, 0, 0);
+ poplevel (0, 0);
stmt = build2_loc (input_location, OMP_PARALLEL, void_type_node, stmt,
omp_clauses);
OMP_PARALLEL_COMBINED (stmt) = 1;
gfc_start_block (&block);
omp_clauses = gfc_trans_omp_clauses (&block, code->ext.omp_clauses,
code->loc);
- pushlevel (0);
+ pushlevel ();
stmt = gfc_trans_omp_sections (code, §ion_clauses);
if (TREE_CODE (stmt) != BIND_EXPR)
- stmt = build3_v (BIND_EXPR, NULL, stmt, poplevel (1, 0, 0));
+ stmt = build3_v (BIND_EXPR, NULL, stmt, poplevel (1, 0));
else
- poplevel (0, 0, 0);
+ poplevel (0, 0);
stmt = build2_loc (input_location, OMP_PARALLEL, void_type_node, stmt,
omp_clauses);
OMP_PARALLEL_COMBINED (stmt) = 1;
gfc_start_block (&block);
omp_clauses = gfc_trans_omp_clauses (&block, code->ext.omp_clauses,
code->loc);
- pushlevel (0);
+ pushlevel ();
stmt = gfc_trans_omp_workshare (code, &workshare_clauses);
if (TREE_CODE (stmt) != BIND_EXPR)
- stmt = build3_v (BIND_EXPR, NULL, stmt, poplevel (1, 0, 0));
+ stmt = build3_v (BIND_EXPR, NULL, stmt, poplevel (1, 0));
else
- poplevel (0, 0, 0);
+ poplevel (0, 0);
stmt = build2_loc (input_location, OMP_PARALLEL, void_type_node, stmt,
omp_clauses);
OMP_PARALLEL_COMBINED (stmt) = 1;
code = code->block->next;
- pushlevel (0);
+ pushlevel ();
gfc_start_block (&block);
pblock = █
{
if (!IS_EMPTY_STMT (stmt))
{
- tree bindblock = poplevel (1, 0, 0);
+ tree bindblock = poplevel (1, 0);
stmt = build3_v (BIND_EXPR, NULL, stmt, bindblock);
}
else
- poplevel (0, 0, 0);
+ poplevel (0, 0);
}
else
- poplevel (0, 0, 0);
+ poplevel (0, 0);
if (IS_EMPTY_STMT (stmt) && !clauses->nowait)
stmt = gfc_trans_omp_barrier ();