errfn.c (cp_pedwarn, [...]): Replace extern decls with casts.
authorJason Merrill <jason@yorick.cygnus.com>
Sat, 13 Dec 1997 00:28:00 +0000 (00:28 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Sat, 13 Dec 1997 00:28:00 +0000 (19:28 -0500)
* 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
gcc/cp/cp-tree.h
gcc/cp/decl.c
gcc/cp/errfn.c

index c532a87747b01e72b5ae8f53aa03b0b93ea4641c..7d1ab25fa9e9c12b63c683804229bad62aa9c9eb 100644 (file)
@@ -1,3 +1,13 @@
+Fri Dec 12 16:09:14 1997  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * 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  <jason@yorick.cygnus.com>
 
        * decl2.c (comdat_linkage): Also set DECL_COMDAT.
index e1653020194cccea7170650eb318b4a5ac3365c9..79172c2cfc7dfe031e924f3b7f36f2d4c6c7ddcc 100644 (file)
@@ -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));
index 7ece1d33d38d82f5cb1ade17206cf5d871e33159..c38445f64c773e4a20fecb69570bf8f1bf709cd9 100644 (file)
@@ -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;
 }
 \f
-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.
index b5ab8f7b676123ab7599f21bf610374647c39b53..63de7b8fea2a1ab55550ad12ecbd3e2fc737d680 100644 (file)
@@ -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);
 }