aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorAndrew Pinski <pinskia@physics.uc.edu>2004-05-30 23:53:32 +0000
committerAndrew Pinski <pinskia@gcc.gnu.org>2004-05-30 16:53:32 -0700
commit3c79fa86db0cf6bbcc3673c2844e85ca8679370c (patch)
treeea6af9f1714899b3e6bb97969fabd46262b40f7e /gcc/c-decl.c
parent1b0f3e79b1b3b9e96be90ec30fc6a142057e84ed (diff)
downloadgcc-3c79fa86db0cf6bbcc3673c2844e85ca8679370c.zip
gcc-3c79fa86db0cf6bbcc3673c2844e85ca8679370c.tar.gz
gcc-3c79fa86db0cf6bbcc3673c2844e85ca8679370c.tar.bz2
c-decl.c (c_expand_body_1): Remove and fold back into ...
ChangeLog: * c-decl.c (c_expand_body_1): Remove and fold back into ... (c_expand_body): here. (c_expand_decl): Move to ... * c-common.c (c_expand_decl): Here and remove check for nested functions. * c-common.h (c_expand_decl): Add prototype. * c-tree.h (c_expand_decl): Remove. cp/ChangeLog: * cp-lang.c (cp_expand_decl): Remove. (LANG_HOOKS_EXPAND_DECL): Use c_expand_decl. From-SVN: r82469
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c67
1 files changed, 9 insertions, 58 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index ce39f6f..5cf4e0e 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -6361,47 +6361,26 @@ finish_function (void)
current_function_decl = NULL;
}
-/* Generate the RTL for the body of FNDECL. If NESTED_P is nonzero,
- then we are already in the process of generating RTL for another
- function. */
+/* Generate the RTL for the body of FNDECL. */
-static void
-c_expand_body_1 (tree fndecl, int nested_p)
+void
+c_expand_body (tree fndecl)
{
- if (nested_p)
- {
- /* Make sure that we will evaluate variable-sized types involved
- in our function's type. */
- expand_pending_sizes (DECL_LANG_SPECIFIC (fndecl)->pending_sizes);
- /* Squirrel away our current state. */
- push_function_context ();
- }
-
- tree_rest_of_compilation (fndecl, nested_p);
+ if (!DECL_INITIAL (fndecl)
+ || DECL_INITIAL (fndecl) == error_mark_node)
+ return;
- if (nested_p)
- /* Return to the enclosing function. */
- pop_function_context ();
+ tree_rest_of_compilation (fndecl, false);
if (DECL_STATIC_CONSTRUCTOR (fndecl)
&& targetm.have_ctors_dtors)
targetm.asm_out.constructor (XEXP (DECL_RTL (fndecl), 0),
- DEFAULT_INIT_PRIORITY);
+ DEFAULT_INIT_PRIORITY);
if (DECL_STATIC_DESTRUCTOR (fndecl)
&& targetm.have_ctors_dtors)
targetm.asm_out.destructor (XEXP (DECL_RTL (fndecl), 0),
- DEFAULT_INIT_PRIORITY);
-}
-
-/* Like c_expand_body_1 but only for unnested functions. */
-
-void
-c_expand_body (tree fndecl)
-{
-
- if (DECL_INITIAL (fndecl) && DECL_INITIAL (fndecl) != error_mark_node)
- c_expand_body_1 (fndecl, 0);
+ DEFAULT_INIT_PRIORITY);
}
/* Check the declarations given in a for-loop for satisfying the C99
@@ -6597,34 +6576,6 @@ c_begin_compound_stmt (void)
return stmt;
}
-/* Expand DECL if it declares an entity not handled by the
- common code. */
-
-int
-c_expand_decl (tree decl)
-{
- if (TREE_CODE (decl) == VAR_DECL && !TREE_STATIC (decl))
- {
- /* Let the back-end know about this variable. */
- if (!anon_aggr_type_p (TREE_TYPE (decl)))
- emit_local_var (decl);
- else
- expand_anon_union_decl (decl, NULL_TREE,
- DECL_ANON_UNION_ELEMS (decl));
- }
- else if (TREE_CODE (decl) == VAR_DECL && TREE_STATIC (decl))
- make_rtl_for_local_static (decl);
- /* Expand nested functions. */
- else if (TREE_CODE (decl) == FUNCTION_DECL
- && DECL_CONTEXT (decl) == current_function_decl
- && DECL_SAVED_TREE (decl))
- c_expand_body_1 (decl, 1);
- else
- return 0;
-
- return 1;
-}
-
/* Return the global value of T as a symbol. */
tree