diff options
author | Mark Mitchell <mark@codesourcery.com> | 2001-06-05 06:51:02 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2001-06-05 06:51:02 +0000 |
commit | 1f7317498d7f85794a0e86cf66a1b6a5a8b1dcd9 (patch) | |
tree | 44b13ffdf8f48f0846c6fa756dcb798b1402864b /gcc/function.c | |
parent | 333e14b0da82d2a6f002ca385175c63df7d6050a (diff) | |
download | gcc-1f7317498d7f85794a0e86cf66a1b6a5a8b1dcd9.zip gcc-1f7317498d7f85794a0e86cf66a1b6a5a8b1dcd9.tar.gz gcc-1f7317498d7f85794a0e86cf66a1b6a5a8b1dcd9.tar.bz2 |
c-tree.h (lang_decl): Add pending_sizes fields.
* c-tree.h (lang_decl): Add pending_sizes fields.
* c-decl.c (store_parm_decls): Save pending_sizes away for nested
functions.
(c_expand_body): Expand them.
(lang_mark_tree): Mark lang_decl:pending_sizes.
* function.c (expand_pending_sizes): New function, broken out
from ...
(expand_function_start): ... here.
* tree.h (expand_pending_sizes): Declare it.
From-SVN: r42892
Diffstat (limited to 'gcc/function.c')
-rw-r--r-- | gcc/function.c | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/gcc/function.c b/gcc/function.c index 161173e..64df1bd 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -6270,6 +6270,29 @@ expand_main_function () extern struct obstack permanent_obstack; +/* The PENDING_SIZES represent the sizes of variable-sized types. + Create RTL for the various sizes now (using temporary variables), + so that we can refer to the sizes from the RTL we are generating + for the current function. The PENDING_SIZES are a TREE_LIST. The + TREE_VALUE of each node is a SAVE_EXPR. */ + +void +expand_pending_sizes (pending_sizes) + tree pending_sizes; +{ + tree tem; + + /* Evaluate now the sizes of any types declared among the arguments. */ + for (tem = pending_sizes; tem; tem = TREE_CHAIN (tem)) + { + expand_expr (TREE_VALUE (tem), const0_rtx, VOIDmode, + EXPAND_MEMORY_USE_BAD); + /* Flush the queue in case this parameter declaration has + side-effects. */ + emit_queue (); + } +} + /* Start the RTL for a new function, and set variables used for emitting RTL. SUBR is the FUNCTION_DECL node. @@ -6487,14 +6510,7 @@ expand_function_start (subr, parms_have_cleanups) tail_recursion_reentry = emit_note (NULL, NOTE_INSN_DELETED); /* Evaluate now the sizes of any types declared among the arguments. */ - for (tem = nreverse (get_pending_sizes ()); tem; tem = TREE_CHAIN (tem)) - { - expand_expr (TREE_VALUE (tem), const0_rtx, VOIDmode, - EXPAND_MEMORY_USE_BAD); - /* Flush the queue in case this parameter declaration has - side-effects. */ - emit_queue (); - } + expand_pending_sizes (nreverse (get_pending_sizes ())); /* Make sure there is a line number after the function entry setup code. */ force_next_line_note (); |