diff options
author | Mark Mitchell <mark@codesourcery.com> | 1999-12-24 20:24:16 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 1999-12-24 20:24:16 +0000 |
commit | de23a892abbc9af353ebbaf9e0021445deb27638 (patch) | |
tree | 3d273b67279f2daebabe8587668ca4ef7df11f20 | |
parent | 9376fcd631f21656c9544b5a9355f31618b2d63a (diff) | |
download | gcc-de23a892abbc9af353ebbaf9e0021445deb27638.zip gcc-de23a892abbc9af353ebbaf9e0021445deb27638.tar.gz gcc-de23a892abbc9af353ebbaf9e0021445deb27638.tar.bz2 |
toplev.h (note_deferall_of_defined_inline_function): Declare.
* 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.
* semantics.c (expand_body): Use
note_deferral_of_defined_inline_function.
From-SVN: r31088
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/semantics.c | 2 | ||||
-rw-r--r-- | gcc/toplev.c | 48 | ||||
-rw-r--r-- | gcc/toplev.h | 1 |
5 files changed, 52 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 75b33fb..9957580 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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 diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 64c7279..f8936b6 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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. diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 1790ef4..d55ee15 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -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; } diff --git a/gcc/toplev.c b/gcc/toplev.c index a6e7c0e..2c0ffa2 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -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; diff --git a/gcc/toplev.h b/gcc/toplev.h index 7165457..6fb9f70 100644 --- a/gcc/toplev.h +++ b/gcc/toplev.h @@ -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; |