declspecs = tree_cons (NULL_TREE, get_identifier ("void"), NULL_TREE);
d = build_parse_node (INDIRECT_REF, get_identifier ("__eh_pc"));
- d = start_decl (d, declspecs, 0, NULL_TREE);
+ d = start_decl (d, declspecs, 0);
DECL_COMMON (d) = 1;
cp_finish_decl (d, NULL_TREE, NULL_TREE, 1, 0);
saved_pc = lookup_name (get_identifier ("__eh_pc"), 0);
declspecs = tree_cons (NULL_TREE, get_identifier ("void"), NULL_TREE);
d = build_parse_node (INDIRECT_REF, get_identifier ("__eh_type"));
- d = start_decl (d, declspecs, 0, NULL_TREE);
+ d = start_decl (d, declspecs, 0);
DECL_COMMON (d) = 1;
cp_finish_decl (d, NULL_TREE, NULL_TREE, 1, 0);
saved_throw_type = lookup_name (get_identifier ("__eh_type"), 0);
declspecs = tree_cons (NULL_TREE, get_identifier ("void"), NULL_TREE);
d = build_parse_node (INDIRECT_REF, get_identifier ("__eh_value"));
- d = start_decl (d, declspecs, 0, NULL_TREE);
+ d = start_decl (d, declspecs, 0);
DECL_COMMON (d) = 1;
cp_finish_decl (d, NULL_TREE, NULL_TREE, 1, 0);
saved_throw_value = lookup_name (get_identifier ("__eh_value"), 0);
declspecs = tree_cons (NULL_TREE, get_identifier ("void"), NULL_TREE);
d = build_parse_node (INDIRECT_REF, get_identifier ("__eh_cleanup"));
- d = build_parse_node (CALL_EXPR, d, void_list_node, NULL_TREE);
- d = start_decl (d, declspecs, 0, NULL_TREE);
+ d = make_call_declarator (d, void_list_node, NULL_TREE, NULL_TREE);
+ d = start_decl (d, declspecs, 0);
DECL_COMMON (d) = 1;
cp_finish_decl (d, NULL_TREE, NULL_TREE, 1, 0);
saved_cleanup = lookup_name (get_identifier ("__eh_cleanup"), 0);
declspecs = tree_cons (NULL_TREE, get_identifier ("bool"), NULL_TREE);
d = get_identifier ("__eh_in_catch");
- d = start_decl (d, declspecs, 0, NULL_TREE);
+ d = start_decl (d, declspecs, 0);
DECL_COMMON (d) = 1;
cp_finish_decl (d, NULL_TREE, NULL_TREE, 1, 0);
saved_in_catch = lookup_name (get_identifier ("__eh_in_catch"), 0);
}
-/* Call this on start of a try block. */
-
-void
-expand_start_try_stmts ()
-{
- if (! doing_eh (1))
- return;
-
- expand_eh_region_start ();
-}
-
-void
-expand_end_try_stmts ()
-{
- expand_eh_region_end (integer_zero_node);
-}
-
/* Build a type value for use at runtime for a type that is matched
against by the exception handling system. */
return;
/* Create a binding level for the parm. */
+ pushlevel (0);
expand_start_bindings (0);
false_label_rtx = gen_label_rtx ();
rtx call_rtx, return_value_rtx;
tree init_type;
- decl = grokdeclarator (declarator, declspecs, CATCHPARM, 1,
- NULL_TREE, NULL_TREE);
+ decl = grokdeclarator (declarator, declspecs, CATCHPARM, 1, NULL_TREE);
if (decl == NULL_TREE)
{
expand_leftover_cleanups ();
/* Cleanup the EH parameter. */
- decls = getdecls ();
- expand_end_bindings (decls, decls != NULL_TREE, 0);
+ expand_end_bindings (getdecls (), kept_level_p (), 0);
+ poplevel (kept_level_p (), 1, 0);
/* label we emit to jump to if this catch block didn't match. */
/* This the closing } in the `if (eq) {' of the documentation. */
temp = gen_reg_rtx (Pmode);
emit_move_insn (temp, inner_throw_label);
emit_move_insn (return_val_rtx, plus_constant (temp, -8));
+ emit_insn (gen_rtx (USE, VOIDmode, gen_rtx (REG, SImode, 31)));
easy_expand_asm ("ret");
easy_expand_asm ("restore");
emit_barrier ();
return;
params = void_list_node;
- t = build_parse_node (CALL_EXPR, get_identifier ("__throw"), params, NULL_TREE);
+ t = make_call_declarator (get_identifier ("__throw"), params, NULL_TREE,
+ NULL_TREE);
start_function (decl_tree_cons (NULL_TREE, get_identifier ("static"),
void_list_node),
- t, NULL_TREE, NULL_TREE, 0);
+ t, NULL_TREE, 0);
store_parm_decls ();
pushlevel (0);
clear_last_expr ();
expand_exception_blocks ()
{
rtx funcend;
- rtx insns;
+ rtx insn, insns;
rtx eh_spec_insns = NULL_RTX;
start_sequence ();
store_after_parms (eh_spec_insns);
#endif
- emit_insns (insns);
+ insn = get_last_insn ();
+ while (GET_CODE (insn) == NOTE
+ || (GET_CODE (insn) == INSN
+ && (GET_CODE (PATTERN (insn)) == USE
+ || GET_CODE (PATTERN (insn)) == CLOBBER)))
+ insn = PREV_INSN (insn);
+
+ emit_insns_after (insns, insn);
}
tree
params = void_list_node;
/* tcf stands for throw clean funciton. */
sprintf (name, "__tcf_%d", counter++);
- t = build_parse_node (CALL_EXPR, get_identifier (name), params, NULL_TREE);
+ t = make_call_declarator (get_identifier (name), params, NULL_TREE,
+ NULL_TREE);
start_function (decl_tree_cons (NULL_TREE, get_identifier ("static"),
void_list_node),
- t, NULL_TREE, NULL_TREE, 0);
+ t, NULL_TREE, 0);
store_parm_decls ();
pushlevel (0);
clear_last_expr ();
start_sequence ();
object = build_reinterpret_cast (TREE_TYPE (exp), saved_throw_value);
object = build_indirect_ref (object, NULL_PTR);
- cleanup = maybe_build_cleanup (object);
+ cleanup = maybe_build_cleanup_and_delete (object);
if (cleanup)
expand_expr (cleanup, const0_rtx, VOIDmode, 0);
cleanup_insns = get_insns ();
{
cleanup = start_anon_func ();
- expand_expr (maybe_build_cleanup (object), const0_rtx, VOIDmode, 0);
+ expand_expr (maybe_build_cleanup_and_delete (object),
+ const0_rtx, VOIDmode, 0);
end_anon_func ();
{
if (e != error_mark_node)
{
- if (current_template_parms)
+ if (processing_template_decl)
return build_min (THROW_EXPR, void_type_node, e);
e = build1 (THROW_EXPR, void_type_node, e);
TREE_SIDE_EFFECTS (e) = 1;