* toplev.h (note_deferall_of_defined_inline_function): Declare.
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 24 Dec 1999 20:24:16 +0000 (20:24 +0000)
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 24 Dec 1999 20:24:16 +0000 (20:24 +0000)
* toplev.c (note_deferral_of_defined_inline_function): New
function, split out from ...
(rest_of_compilation): ... here.  Use it.

* semantics.c (expand_body): Use
note_deferral_of_defined_inline_function.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@31088 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/cp/ChangeLog
gcc/cp/semantics.c
gcc/toplev.c
gcc/toplev.h

index 75b33fb..9957580 100644 (file)
@@ -1,3 +1,10 @@
+1999-12-24  Mark Mitchell  <mark@codesourcery.com>
+
+       * toplev.h (note_deferall_of_defined_inline_function): Declare.
+       * toplev.c (note_deferral_of_defined_inline_function): New
+       function, split out from ...
+       (rest_of_compilation): ... here.  Use it.
+       
 Fri Dec 24 12:34:26 1999  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
 
        * expr.c (store_constructor): Don't call clear_storage if size is
index 64c7279..f8936b6 100644 (file)
@@ -1,3 +1,8 @@
+1999-12-24  Mark Mitchell  <mark@codesourcery.com>
+
+       * semantics.c (expand_body): Use
+       note_deferral_of_defined_inline_function.
+
 1999-12-22  Mark Mitchell  <mark@codesourcery.com>
 
        * dump.c (dequeue_and_dump): Handle CTOR_STMTs.
index 1790ef4..d55ee15 100644 (file)
@@ -2694,6 +2694,8 @@ expand_body (fn)
       /* Remember this function.  In finish_file we'll decide if
         we actually need to write this function out.  */
       mark_inline_for_output (fn);
+      /* Let the back-end know that this funtion exists.  */
+      note_deferral_of_defined_inline_function (fn);
       return;
     }
 
index a6e7c0e..2c0ffa2 100644 (file)
@@ -2729,6 +2729,42 @@ rest_of_type_compilation (type, toplev)
 #endif
 }
 
+/* DECL is an inline function, whose body is present, but which is not
+   being output at this point.  (We're putting that off until we need
+   to do it.)  If there are any actions that need to take place,
+   including the emission of debugging information for the function,
+   this is where they should go.  This function may be called by
+   language-dependent code for front-ends that do not even generate
+   RTL for functions that don't need to be put out.  */
+
+void
+note_deferral_of_defined_inline_function (decl)
+     tree decl;
+{
+#ifdef DWARF_DEBUGGING_INFO
+  /* Generate the DWARF info for the "abstract" instance of a function
+     which we may later generate inlined and/or out-of-line instances
+     of.  */
+  if (write_symbols == DWARF_DEBUG)
+    {
+      /* The front-end may not have set CURRENT_FUNCTION_DECL, but the
+        DWARF code expects it to be set in this case.  Intuitively,
+        DECL is the function we just finished defining, so setting
+        CURRENT_FUNCTION_DECL is sensible.  */
+      tree saved_cfd = current_function_decl;
+      current_function_decl = decl;
+
+      /* Let the DWARF code do its work.  */
+      set_decl_abstract_flags (decl, 1);
+      dwarfout_file_scope_decl (decl, 0);
+      set_decl_abstract_flags (decl, 0);
+
+      /* Reset CURRENT_FUNCTION_DECL.  */
+      current_function_decl = saved_cfd;
+    }
+#endif
+}
+
 /* This is called from finish_function (within yyparse)
    after each top-level definition is parsed.
    It is supposed to compile that function or variable
@@ -2857,17 +2893,7 @@ rest_of_compilation (decl)
              optimize = saved_optimize;
            }
 
-#ifdef DWARF_DEBUGGING_INFO
-         /* Generate the DWARF info for the "abstract" instance
-            of a function which we may later generate inlined and/or
-            out-of-line instances of.  */
-         if (write_symbols == DWARF_DEBUG)
-           {
-             set_decl_abstract_flags (decl, 1);
-             TIMEVAR (symout_time, dwarfout_file_scope_decl (decl, 0));
-             set_decl_abstract_flags (decl, 0);
-           }
-#endif
+         note_deferral_of_defined_inline_function (decl);
          TIMEVAR (integration_time, save_for_inline_nocopy (decl));
          DECL_SAVED_INSNS (decl)->inlinable = inlinable;
          goto exit_rest_of_compilation;
index 7165457..6fb9f70 100644 (file)
@@ -127,6 +127,7 @@ extern void fnotice                 PROTO ((FILE *, const char *, ...))
 
 extern int wrapup_global_declarations   PROTO ((union tree_node **, int));
 extern void check_global_declarations   PROTO ((union tree_node **, int));
+extern void note_deferral_of_defined_inline_function PROTO ((union tree_node *));
 extern int errorcount;
 extern int warningcount;
 extern int sorrycount;