void gimplify_cilk_sync (tree *expr_p, gimple_seq *pre_p) { tree sync_expr = expand_cilk_sync (); *expr_p = NULL_TREE; gimplify_and_add (sync_expr, pre_p); }
static enum gimplify_status gimplify_must_not_throw_expr (tree *expr_p, gimple_seq *pre_p) { tree stmt = *expr_p; tree temp = voidify_wrapper_expr (stmt, NULL); tree body = TREE_OPERAND (stmt, 0); gimple_seq try_ = NULL; gimple_seq catch_ = NULL; gimple mnt; gimplify_and_add (body, &try_); mnt = gimple_build_eh_must_not_throw (terminate_node); gimple_seq_add_stmt_without_update (&catch_, mnt); mnt = gimple_build_try (try_, catch_, GIMPLE_TRY_CATCH); gimple_seq_add_stmt_without_update (pre_p, mnt); if (temp) { *expr_p = temp; return GS_OK; } *expr_p = NULL; return GS_ALL_DONE; }
static enum gimplify_status cp_gimplify_omp_for (tree *expr_p, gimple_seq *pre_p) { tree for_stmt = *expr_p; tree cont_block; gimple stmt; gimple_seq seq = NULL; /* Protect ourselves from recursion. */ if (OMP_FOR_GIMPLIFYING_P (for_stmt)) return GS_UNHANDLED; OMP_FOR_GIMPLIFYING_P (for_stmt) = 1; /* Note that while technically the continue label is enabled too soon here, we should have already diagnosed invalid continues nested within statement expressions within the INIT, COND, or INCR expressions. */ cont_block = begin_bc_block (bc_continue); gimplify_and_add (for_stmt, &seq); stmt = gimple_seq_last_stmt (seq); if (gimple_code (stmt) == GIMPLE_OMP_FOR) gimple_omp_set_body (stmt, finish_bc_block (bc_continue, cont_block, gimple_omp_body (stmt))); else seq = finish_bc_block (bc_continue, cont_block, seq); gimple_seq_add_seq (pre_p, seq); OMP_FOR_GIMPLIFYING_P (for_stmt) = 0; return GS_ALL_DONE; }
static void gimplify_for_stmt (tree *stmt_p, tree *pre_p) { tree stmt = *stmt_p; if (FOR_INIT_STMT (stmt)) gimplify_and_add (FOR_INIT_STMT (stmt), pre_p); *stmt_p = gimplify_cp_loop (FOR_COND (stmt), FOR_BODY (stmt), FOR_EXPR (stmt), 1); }
static void gimplify_for_stmt (tree *stmt_p, gimple_seq *pre_p) { tree stmt = *stmt_p; if (FOR_INIT_STMT (stmt)) gimplify_and_add (FOR_INIT_STMT (stmt), pre_p); gimple_seq_add_seq (pre_p, gimplify_cp_loop (FOR_COND (stmt), FOR_BODY (stmt), FOR_EXPR (stmt), 1)); *stmt_p = NULL_TREE; }
static enum gimplify_status gimplify_for_stmt (tree *stmt_p, tree *pre_p) { tree stmt = *stmt_p; if (FOR_INIT_STMT (stmt)) gimplify_and_add (FOR_INIT_STMT (stmt), pre_p); *stmt_p = gimplify_c_loop (FOR_COND (stmt), FOR_BODY (stmt), FOR_EXPR (stmt), 1); return GS_ALL_DONE; }
static void gimplify_for_stmt (tree *stmt_p, tree *pre_p) { tree stmt = *stmt_p; if (FOR_INIT_STMT (stmt)) gimplify_and_add (FOR_INIT_STMT (stmt), pre_p); /* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ *stmt_p = gimplify_cp_loop (FOR_COND (stmt), FOR_BODY (stmt), FOR_EXPR (stmt), FOR_ATTRIBUTES (stmt), 1, NULL_TREE); /* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ }
static enum gimplify_status gimplify_compound_literal_expr (tree *expr_p, tree *pre_p) { tree decl_s = COMPOUND_LITERAL_EXPR_DECL_STMT (*expr_p); tree decl = DECL_EXPR_DECL (decl_s); /* This decl isn't mentioned in the enclosing block, so add it to the list of temps. FIXME it seems a bit of a kludge to say that anonymous artificial vars aren't pushed, but everything else is. */ if (DECL_NAME (decl) == NULL_TREE && !DECL_SEEN_IN_BIND_EXPR_P (decl)) gimple_add_tmp_var (decl); gimplify_and_add (decl_s, pre_p); *expr_p = decl; return GS_OK; }
static enum gimplify_status cp_gimplify_omp_for (tree *expr_p, gimple_seq *pre_p) { tree for_stmt = *expr_p; gimple_seq seq = NULL; /* Protect ourselves from recursion. */ if (OMP_FOR_GIMPLIFYING_P (for_stmt)) return GS_UNHANDLED; OMP_FOR_GIMPLIFYING_P (for_stmt) = 1; gimplify_and_add (for_stmt, &seq); gimple_seq_add_seq (pre_p, seq); OMP_FOR_GIMPLIFYING_P (for_stmt) = 0; return GS_ALL_DONE; }
tree force_gimple_operand_1 (tree expr, gimple_seq *stmts, gimple_predicate gimple_test_f, tree var) { enum gimplify_status ret; location_t saved_location; *stmts = NULL; /* gimple_test_f might be more strict than is_gimple_val, make sure we pass both. Just checking gimple_test_f doesn't work because most gimple predicates do not work recursively. */ if (is_gimple_val (expr) && (*gimple_test_f) (expr)) return expr; push_gimplify_context (gimple_in_ssa_p (cfun), true); saved_location = input_location; input_location = UNKNOWN_LOCATION; if (var) { if (gimple_in_ssa_p (cfun) && is_gimple_reg (var)) var = make_ssa_name (var, NULL); expr = build2 (MODIFY_EXPR, TREE_TYPE (var), var, expr); } if (TREE_CODE (expr) != MODIFY_EXPR && TREE_TYPE (expr) == void_type_node) { gimplify_and_add (expr, stmts); expr = NULL_TREE; } else { ret = gimplify_expr (&expr, stmts, NULL, gimple_test_f, fb_rvalue); gcc_assert (ret != GS_ERROR); } input_location = saved_location; pop_gimplify_context (NULL); return expr; }
static enum gimplify_status gimplify_must_not_throw_expr (tree *expr_p, gimple_seq *pre_p) { tree stmt = *expr_p; tree temp = voidify_wrapper_expr (stmt, NULL); tree body = TREE_OPERAND (stmt, 0); stmt = build_gimple_eh_filter_tree (body, NULL_TREE, build_call_n (terminate_node, 0)); gimplify_and_add (stmt, pre_p); if (temp) { *expr_p = temp; return GS_OK; } *expr_p = NULL; return GS_ALL_DONE; }
static void gimplify_switch_stmt (tree *stmt_p, gimple_seq *pre_p) { tree stmt = *stmt_p; tree break_block, body, t; location_t stmt_locus = input_location; gimple_seq seq = NULL; break_block = begin_bc_block (bc_break); body = SWITCH_STMT_BODY (stmt); if (!body) body = build_empty_stmt (); t = build3 (SWITCH_EXPR, SWITCH_STMT_TYPE (stmt), SWITCH_STMT_COND (stmt), body, NULL_TREE); SET_EXPR_LOCATION (t, stmt_locus); gimplify_and_add (t, &seq); seq = finish_bc_block (bc_break, break_block, seq); gimple_seq_add_seq (pre_p, seq); *stmt_p = NULL_TREE; }