/* Mark as non-local and addressable. */
DECL_NONLOCAL (exp) = 1;
-
- /* This is currently too late to be useful, since
- init_function_start needs to know whether a static chain
- is needed. However, it would be a useful optimization
- if we could defer setting up static chains and trampolines
- until we see that we actually need them due to references
- to non-local non-static variables. */
- FUNCTION_NEEDS_STATIC_CHAIN (current_function_decl) = 1;
-
mark_addressable (exp);
if (GET_CODE (DECL_RTL (exp)) != MEM)
abort ();
/* Are we taking the address of a nested function? */
if (TREE_CODE (TREE_OPERAND (exp, 0)) == FUNCTION_DECL
- && FUNCTION_NEEDS_STATIC_CHAIN (TREE_OPERAND (exp, 0)))
+ && decl_function_context (TREE_OPERAND (exp, 0)) != 0)
{
op0 = trampoline_address (TREE_OPERAND (exp, 0));
op0 = force_operand (op0, target);
lookup_static_chain (decl)
tree decl;
{
- tree context, link;
-
- if (TREE_CODE (decl) == FUNCTION_DECL
- ? ! FUNCTION_NEEDS_STATIC_CHAIN (decl)
- : ! FUNCTION_NEEDS_STATIC_CHAIN (current_function_decl))
- return 0;
-
- context = decl_function_context (decl);
+ tree context = decl_function_context (decl);
+ tree link;
if (context == 0)
return 0;
-
+
/* We treat inline_function_decl as an alias for the current function
because that is the inline function whose vars, types, etc.
are being merged into the current function.
/* Nonzero if this is a nested function that uses a static chain. */
current_function_needs_context
- = FUNCTION_NEEDS_STATIC_CHAIN (current_function_decl);
+ = (decl_function_context (current_function_decl) != 0);
/* Set if a call to setjmp is seen. */
current_function_calls_setjmp = 0;
case FUNCTION_DECL:
/* Nested functions aren't static, since taking their address
involves a trampoline. */
- return ! FUNCTION_NEEDS_STATIC_CHAIN (arg);
+ return decl_function_context (arg) == 0;
case VAR_DECL:
return TREE_STATIC (arg) || DECL_EXTERNAL (arg);