diff options
author | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-06-06 03:08:21 +0000 |
---|---|---|
committer | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-06-06 03:08:21 +0000 |
commit | da1ac2c9df13df46525460c0120949731f74f00c (patch) | |
tree | 0b8a183489dc0531743dd25e38c68e69337e0836 /gcc/c-semantics.c | |
parent | 5e56561070852635c1873f5a1eda98deadcc9a0a (diff) | |
download | gcc-da1ac2c9df13df46525460c0120949731f74f00c.tar.gz |
* c-semantics.c (genrtl_scope_stmt): Write out nested inline
functions here, instead of ...
* c-decl.c (c_expand_body): ... here.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@42930 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-semantics.c')
-rw-r--r-- | gcc/c-semantics.c | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/gcc/c-semantics.c b/gcc/c-semantics.c index 7f88e970acd..63b4b14fad5 100644 --- a/gcc/c-semantics.c +++ b/gcc/c-semantics.c @@ -561,11 +561,12 @@ void genrtl_scope_stmt (t) tree t; { + tree block = SCOPE_STMT_BLOCK (t); + if (!SCOPE_NO_CLEANUPS_P (t)) { if (SCOPE_BEGIN_P (t)) - expand_start_bindings_and_block (2 * SCOPE_NULLIFIED_P (t), - SCOPE_STMT_BLOCK (t)); + expand_start_bindings_and_block (2 * SCOPE_NULLIFIED_P (t), block); else if (SCOPE_END_P (t)) expand_end_bindings (NULL_TREE, !SCOPE_NULLIFIED_P (t), 0); } @@ -575,7 +576,27 @@ genrtl_scope_stmt (t) (SCOPE_BEGIN_P (t) ? NOTE_INSN_BLOCK_BEG : NOTE_INSN_BLOCK_END)); - NOTE_BLOCK (note) = SCOPE_STMT_BLOCK (t); + NOTE_BLOCK (note) = block; + } + + /* If we're at the end of a scope that contains inlined nested + functions, we have to decide whether or not to write them out. */ + if (block && SCOPE_END_P (t)) + { + tree fn; + + for (fn = BLOCK_VARS (block); fn; fn = TREE_CHAIN (fn)) + { + if (TREE_CODE (fn) == FUNCTION_DECL + && DECL_CONTEXT (fn) == current_function_decl + && !TREE_ASM_WRITTEN (fn) + && TREE_ADDRESSABLE (fn)) + { + push_function_context (); + output_inline_function (fn); + pop_function_context (); + } + } } } |