int
global_bindings_p (void)
{
- return (force_global || !current_binding_level
- || !current_binding_level->chain ? -1 : 0);
+ return ((force_global || !current_function_decl) ? -1 : 0);
}
/* Enter a new binding level. */
TYPE_NAME (TREE_TYPE (decl)) = decl;
if (TREE_CODE (decl) != CONST_DECL)
- rest_of_decl_compilation (decl, NULL, global_bindings_p (), 0);
+ rest_of_decl_compilation (decl, global_bindings_p (), 0);
}
\f
/* Do little here. Set up the standard declarations later after the
free_binding_level = 0;
gnat_pushlevel ();
- build_common_tree_nodes (0);
+ build_common_tree_nodes (false, false);
/* In Ada, we use a signed type for SIZETYPE. Use the signed type
corresponding to the size of Pmode. In most cases when ptr_mode and
TREE_PUBLIC (decl) = 1;
if (library_name)
SET_DECL_ASSEMBLER_NAME (decl, get_identifier (library_name));
- make_decl_rtl (decl, NULL);
+ make_decl_rtl (decl);
gnat_pushdecl (decl, Empty);
DECL_BUILT_IN_CLASS (decl) = BUILT_IN_NORMAL;
DECL_FUNCTION_CODE (decl) = function_code;
gnat_define_builtin ("__builtin_clzll", ftype, BUILT_IN_CLZLL, "clzll",
true);
+ /* The init_trampoline and adjust_trampoline builtins aren't used directly.
+ They are inserted during lowering of nested functions. */
+
tmp = tree_cons (NULL_TREE, ptr_void_type_node, void_list_node);
tmp = tree_cons (NULL_TREE, ptr_void_type_node, tmp);
tmp = tree_cons (NULL_TREE, ptr_void_type_node, tmp);
gnat_define_builtin ("__builtin_adjust_trampoline", ftype,
BUILT_IN_ADJUST_TRAMPOLINE, "adjust_trampoline", true);
- tmp = tree_cons (NULL_TREE, ptr_void_type_node, void_list_node);
- tmp = tree_cons (NULL_TREE, size_type_node, void_list_node);
- ftype = build_function_type (ptr_void_type_node, tmp);
- gnat_define_builtin ("__builtin_stack_alloc", ftype, BUILT_IN_STACK_ALLOC,
- "stack_alloc", false);
+ /* The stack_save, stack_restore, and alloca builtins aren't used directly.
+ They are inserted during gimplification to implement variable sized stack
+ allocation. */
- /* The stack_save and stack_restore builtins aren't used directly. They
- are inserted during gimplification to implement stack_alloc calls. */
ftype = build_function_type (ptr_void_type_node, void_list_node);
gnat_define_builtin ("__builtin_stack_save", ftype, BUILT_IN_STACK_SAVE,
"stack_save", false);
+
tmp = tree_cons (NULL_TREE, ptr_void_type_node, void_list_node);
ftype = build_function_type (void_type_node, tmp);
gnat_define_builtin ("__builtin_stack_restore", ftype,
BUILT_IN_STACK_RESTORE, "stack_restore", false);
+
+ tmp = tree_cons (NULL_TREE, size_type_node, void_list_node);
+ ftype = build_function_type (ptr_void_type_node, tmp);
+ gnat_define_builtin ("__builtin_alloca", ftype, BUILT_IN_ALLOCA,
+ "alloca", false);
+
}
/* Create the predefined scalar types such as `integer_type_node' needed
/* Make the types and functions used for exception processing. */
jmpbuf_type
= build_array_type (gnat_type_for_mode (Pmode, 0),
- build_index_type (build_int_2 (5, 0)));
+ build_index_type (build_int_cst (NULL_TREE, 5)));
create_type_decl (get_identifier ("JMPBUF_T"), jmpbuf_type, NULL,
false, true, Empty);
jmpbuf_ptr_type = build_pointer_type (jmpbuf_type);
else if (code != ENUMERAL_TYPE && code != RECORD_TYPE
&& !((code == POINTER_TYPE || code == REFERENCE_TYPE)
&& TYPE_IS_DUMMY_P (TREE_TYPE (type))))
- rest_of_decl_compilation (type_decl, NULL, global_bindings_p (), 0);
+ rest_of_decl_compilation (type_decl, global_bindings_p (), 0);
if (!TYPE_IS_DUMMY_P (type))
gnat_pushdecl (type_decl, gnat_node);
TREE_ADDRESSABLE (var_decl) = 1;
if (TREE_CODE (var_decl) != CONST_DECL)
- rest_of_decl_compilation (var_decl, 0, global_bindings_p (), 0);
+ rest_of_decl_compilation (var_decl, global_bindings_p (), 0);
return var_decl;
}
gnat_pushdecl (subprog_decl, gnat_node);
/* Output the assembler code and/or RTL for the declaration. */
- rest_of_decl_compilation (subprog_decl, 0, global_bindings_p (), 0);
+ rest_of_decl_compilation (subprog_decl, global_bindings_p (), 0);
return subprog_decl;
}
param_decl = TREE_CHAIN (param_decl))
DECL_CONTEXT (param_decl) = subprog_decl;
- make_decl_rtl (subprog_decl, NULL);
+ make_decl_rtl (subprog_decl);
/* We handle pending sizes via the elaboration of types, so we don't need to
save them. This causes them to be marked as part of the outer function
if (TYPE_NAME (ptr1)
&& TREE_CODE (TYPE_NAME (ptr1)) == TYPE_DECL
&& TREE_CODE (new_type) != ENUMERAL_TYPE)
- rest_of_decl_compilation (TYPE_NAME (ptr1), NULL,
+ rest_of_decl_compilation (TYPE_NAME (ptr1),
global_bindings_p (), 0);
}
if (TYPE_NAME (ref1)
&& TREE_CODE (TYPE_NAME (ref1)) == TYPE_DECL
&& TREE_CODE (new_type) != ENUMERAL_TYPE)
- rest_of_decl_compilation (TYPE_NAME (ref1), NULL,
+ rest_of_decl_compilation (TYPE_NAME (ref1),
global_bindings_p (), 0);
}
}