From 9664b89edd5858fc7bda86c077f15adad71d7046 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Sat, 13 Dec 1997 00:28:00 +0000 Subject: [PATCH] errfn.c (cp_pedwarn, [...]): Replace extern decls with casts. * errfn.c (cp_pedwarn, cp_pedwarn_at, cp_error_at, cp_warning_at): Replace extern decls with casts. * decl.c (expand_start_early_try_stmts): Don't mess with a sequence. Update last_parm_cleanup_insn. (store_after_parms): Remove. * cp-tree.h: Adjust. Fixes eh{39,40}.C From-SVN: r17083 --- gcc/cp/ChangeLog | 10 ++++++++++ gcc/cp/cp-tree.h | 1 - gcc/cp/decl.c | 43 +++++++------------------------------------ gcc/cp/errfn.c | 12 ++++-------- 4 files changed, 21 insertions(+), 45 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index c532a87747b..7d1ab25fa9e 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,13 @@ +Fri Dec 12 16:09:14 1997 Jason Merrill + + * errfn.c (cp_pedwarn, cp_pedwarn_at, cp_error_at, cp_warning_at): + Replace extern decls with casts. + + * decl.c (expand_start_early_try_stmts): Don't mess with a sequence. + Update last_parm_cleanup_insn. + (store_after_parms): Remove. + * cp-tree.h: Adjust. + Thu Dec 11 22:18:37 1997 Jason Merrill * decl2.c (comdat_linkage): Also set DECL_COMDAT. diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index e1653020194..79172c2cfc7 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -2085,7 +2085,6 @@ extern tree finish_enum PROTO((tree, tree)); extern tree build_enumerator PROTO((tree, tree)); extern tree grok_enum_decls PROTO((tree, tree)); extern int start_function PROTO((tree, tree, tree, int)); -extern void store_after_parms PROTO((struct rtx_def *)); extern void expand_start_early_try_stmts PROTO((void)); extern void store_parm_decls PROTO((void)); extern void store_return_init PROTO((tree, tree)); diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 7ece1d33d38..c38445f64c7 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -324,8 +324,9 @@ tree dtor_label; static rtx last_dtor_insn; /* In a constructor, the last insn emitted after the start of the - function and the parms, but before the start of the exception - specification. */ + function and the parms, the exception specification and any + function-try-block. The constructor initializers are emitted after + this insn. */ static rtx last_parm_cleanup_insn; @@ -11658,45 +11659,15 @@ start_function (declspecs, declarator, attrs, pre_parsed_p) return 1; } -void -store_after_parms (insns) - rtx insns; -{ - rtx x; - - for (x = get_insns (); x; x = next_insn (x)) - { - if (GET_CODE (x) == NOTE && NOTE_LINE_NUMBER (x) == NOTE_INSN_FUNCTION_BEG) - { - emit_insns_after (insns, x); - return; - } - } -#if 0 - /* This doesn't work, because the inline output routine doesn't reset - last_parm_insn correctly for get_first_nonparm_insn () to work. */ - - last_parm_insn = get_first_nonparm_insn (); - if (last_parm_insn == NULL_RTX) - emit_insns (insns); - else - emit_insns_before (insns, last_parm_insn); -#endif -} +/* Called after store_parm_decls for a function-try-block. We need to update + last_parm_cleanup_insn so that the base initializers for a constructor + are run within this block, not before it. */ void expand_start_early_try_stmts () { - rtx insns; - start_sequence (); expand_start_try_stmts (); - insns = get_insns (); - end_sequence (); -#if 1 - emit_insns_after (insns, get_insns ()); -#else - store_after_parms (insns); -#endif + last_parm_cleanup_insn = get_last_insn (); } /* Store the parameter declarations into the current function declaration. diff --git a/gcc/cp/errfn.c b/gcc/cp/errfn.c index b5ab8f7b676..63de7b8fea2 100644 --- a/gcc/cp/errfn.c +++ b/gcc/cp/errfn.c @@ -177,9 +177,8 @@ cp_pedwarn (format, arglist) char *format; arglist_dcl { - extern errorfn pedwarn; if (! cp_silent) - cp_thing (pedwarn, 0, format, arglist); + cp_thing ((errorfn *) pedwarn, 0, format, arglist); } void @@ -205,9 +204,8 @@ cp_error_at (format, arglist) char *format; arglist_dcl { - extern errorfn error_with_file_and_line; if (! cp_silent) - cp_thing (error_with_file_and_line, 1, format, arglist); + cp_thing ((errorfn *) error_with_file_and_line, 1, format, arglist); } void @@ -215,9 +213,8 @@ cp_warning_at (format, arglist) char *format; arglist_dcl { - extern errorfn warning_with_file_and_line; if (! cp_silent) - cp_thing (warning_with_file_and_line, 1, format, arglist); + cp_thing ((errorfn *) warning_with_file_and_line, 1, format, arglist); } void @@ -225,7 +222,6 @@ cp_pedwarn_at (format, arglist) char *format; arglist_dcl { - extern errorfn pedwarn_with_file_and_line; if (! cp_silent) - cp_thing (pedwarn_with_file_and_line, 1, format, arglist); + cp_thing ((errorfn *) pedwarn_with_file_and_line, 1, format, arglist); }