oacc_clauses = gfc_trans_omp_clauses (&block, code->ext.omp_clauses,
code->loc, false, true);
stmt = gfc_trans_omp_code (code->block->next, true);
- stmt = build2_loc (input_location, construct_code, void_type_node, stmt,
- oacc_clauses);
+ stmt = build2_loc (gfc_get_location (&code->loc), construct_code,
+ void_type_node, stmt, oacc_clauses);
gfc_add_expr_to_block (&block, stmt);
return gfc_finish_block (&block);
}
}
else if (TREE_CODE (stmt) != BIND_EXPR)
stmt = build3_v (BIND_EXPR, NULL, stmt, NULL_TREE);
- stmt = build2_loc (input_location, OMP_PARALLEL, void_type_node, stmt,
- omp_clauses);
+ stmt = build2_loc (gfc_get_location (&code->loc), OMP_PARALLEL,
+ void_type_node, stmt, omp_clauses);
OMP_PARALLEL_COMBINED (stmt) = 1;
gfc_add_expr_to_block (&block, stmt);
return gfc_finish_block (&block);
stmt = build3_v (BIND_EXPR, NULL, stmt, NULL_TREE);
if (flag_openmp)
{
- stmt = build2_loc (input_location, OMP_PARALLEL, void_type_node, stmt,
- omp_clauses);
+ stmt = build2_loc (gfc_get_location (&code->loc), OMP_PARALLEL,
+ void_type_node, stmt, omp_clauses);
OMP_PARALLEL_COMBINED (stmt) = 1;
}
gfc_add_expr_to_block (&block, stmt);
stmt = build3_v (BIND_EXPR, NULL, stmt, poplevel (1, 0));
else
poplevel (0, 0);
- stmt = build2_loc (input_location, OMP_PARALLEL, void_type_node, stmt,
- omp_clauses);
+ stmt = build2_loc (gfc_get_location (&code->loc), OMP_PARALLEL,
+ void_type_node, stmt, omp_clauses);
OMP_PARALLEL_COMBINED (stmt) = 1;
gfc_add_expr_to_block (&block, stmt);
return gfc_finish_block (&block);
pushlevel ();
stmt = gfc_trans_omp_workshare (code, &workshare_clauses);
stmt = build3_v (BIND_EXPR, NULL, stmt, poplevel (1, 0));
- stmt = build2_loc (input_location, OMP_PARALLEL, void_type_node, stmt,
- omp_clauses);
+ stmt = build2_loc (gfc_get_location (&code->loc), OMP_PARALLEL,
+ void_type_node, stmt, omp_clauses);
OMP_PARALLEL_COMBINED (stmt) = 1;
gfc_add_expr_to_block (&block, stmt);
return gfc_finish_block (&block);
stmtblock_t block, body;
tree omp_clauses, stmt;
bool has_lastprivate = clauses->lists[OMP_LIST_LASTPRIVATE] != NULL;
+ location_t loc = gfc_get_location (&code->loc);
gfc_start_block (&block);
}
stmt = gfc_finish_block (&body);
- stmt = build2_loc (input_location, OMP_SECTIONS, void_type_node, stmt,
- omp_clauses);
+ stmt = build2_loc (loc, OMP_SECTIONS, void_type_node, stmt, omp_clauses);
gfc_add_expr_to_block (&block, stmt);
return gfc_finish_block (&block);
{
tree omp_clauses = gfc_trans_omp_clauses (NULL, clauses, code->loc);
tree stmt = gfc_trans_omp_code (code->block->next, true);
- stmt = build2_loc (input_location, OMP_SINGLE, void_type_node, stmt,
- omp_clauses);
+ stmt = build2_loc (gfc_get_location (&code->loc), OMP_SINGLE, void_type_node,
+ stmt, omp_clauses);
return stmt;
}
pushlevel ();
stmt = gfc_trans_omp_code (code->block->next, true);
stmt = build3_v (BIND_EXPR, NULL, stmt, poplevel (1, 0));
- stmt = build2_loc (input_location, OMP_TASK, void_type_node, stmt,
- omp_clauses);
+ stmt = build2_loc (gfc_get_location (&code->loc), OMP_TASK, void_type_node,
+ stmt, omp_clauses);
gfc_add_expr_to_block (&block, stmt);
return gfc_finish_block (&block);
}
if (flag_openmp)
{
stmt = build3_v (BIND_EXPR, NULL, stmt, poplevel (1, 0));
- stmt = build2_loc (input_location, OMP_TEAMS, void_type_node, stmt,
- omp_clauses);
+ stmt = build2_loc (gfc_get_location (&code->loc), OMP_TEAMS,
+ void_type_node, stmt, omp_clauses);
if (combined)
OMP_TEAMS_COMBINED (stmt) = 1;
}
}
if (flag_openmp)
{
- stmt = build2_loc (input_location, OMP_TARGET, void_type_node, stmt,
- omp_clauses);
+ stmt = build2_loc (gfc_get_location (&code->loc), OMP_TARGET,
+ void_type_node, stmt, omp_clauses);
if (code->op != EXEC_OMP_TARGET)
OMP_TARGET_COMBINED (stmt) = 1;
cfun->has_omp_target = true;
omp_clauses = gfc_trans_omp_clauses (&block, code->ext.omp_clauses,
code->loc);
stmt = gfc_trans_omp_code (code->block->next, true);
- stmt = build2_loc (input_location, OMP_TARGET_DATA, void_type_node, stmt,
- omp_clauses);
+ stmt = build2_loc (gfc_get_location (&code->loc), OMP_TARGET_DATA,
+ void_type_node, stmt, omp_clauses);
gfc_add_expr_to_block (&block, stmt);
return gfc_finish_block (&block);
}
bool singleblock_in_progress = false;
/* True if previous gfc_code in workshare construct is not workshared. */
bool prev_singleunit;
+ location_t loc = gfc_get_location (&code->loc);
code = code->block->next;
{
/* Finish single block and add it to pblock. */
tmp = gfc_finish_block (&singleblock);
- tmp = build2_loc (input_location, OMP_SINGLE,
+ tmp = build2_loc (loc, OMP_SINGLE,
void_type_node, tmp, NULL_TREE);
gfc_add_expr_to_block (pblock, tmp);
/* Add current gfc_code to pblock. */
gfc_init_block (&singleblock);
gfc_add_expr_to_block (&singleblock, res);
singleblock_in_progress = true;
+ loc = gfc_get_location (&code->loc);
}
else
/* Add the new statement to the block. */
{
/* Finish single block and add it to pblock. */
tmp = gfc_finish_block (&singleblock);
- tmp = build2_loc (input_location, OMP_SINGLE, void_type_node, tmp,
+ tmp = build2_loc (loc, OMP_SINGLE, void_type_node, tmp,
clauses->nowait
? build_omp_clause (input_location, OMP_CLAUSE_NOWAIT)
: NULL_TREE);