static void do_use_return_reg (rtx, void *);
static void set_insn_locators (rtx, int) ATTRIBUTE_UNUSED;
\f
-/* Pointer to chain of `struct function' for containing functions. */
-struct function *outer_function_chain;
-
-/* Given a function decl for a containing function,
- return the `struct function' for it. */
-
-struct function *
-find_function_data (tree decl)
-{
- struct function *p;
+/* Stack of nested functions. */
+/* Keep track of the cfun stack. */
- for (p = outer_function_chain; p; p = p->outer)
- if (p->decl == decl)
- return p;
+typedef struct function *function_p;
- gcc_unreachable ();
-}
+DEF_VEC_P(function_p);
+DEF_VEC_ALLOC_P(function_p,heap);
+static VEC(function_p,heap) *function_context_stack;
/* Save the current context for compilation of a nested function.
This is called from language-specific code. */
if (cfun == 0)
allocate_struct_function (NULL, false);
- cfun->outer = outer_function_chain;
- outer_function_chain = cfun;
+ VEC_safe_push (function_p, heap, function_context_stack, cfun);
set_cfun (NULL);
}
void
pop_function_context (void)
{
- struct function *p = outer_function_chain;
-
+ struct function *p = VEC_pop (function_p, function_context_stack);
set_cfun (p);
- outer_function_chain = p->outer;
current_function_decl = p->decl;
/* Reset variables that have known state during rtx generation. */
}
}
-/* Keep track of the cfun stack. */
-
-typedef struct function *function_p;
-
-DEF_VEC_P(function_p);
-DEF_VEC_ALLOC_P(function_p,heap);
-
/* Initialized with NOGC, making this poisonous to the garbage collector. */
static VEC(function_p,heap) *cfun_stack;