memory. */
malloc_decl
= create_subprog_decl (get_identifier ("__gnat_malloc"), NULL_TREE,
- ftype, NULL_TREE, false, true, true, true, NULL,
- Empty);
+ ftype, NULL_TREE, is_disabled, true, true, true,
+ NULL, Empty);
DECL_IS_MALLOC (malloc_decl) = 1;
/* malloc32 is a function declaration tree for a function to allocate
32-bit memory on a 64-bit system. Needed only on 64-bit VMS. */
malloc32_decl
= create_subprog_decl (get_identifier ("__gnat_malloc32"), NULL_TREE,
- ftype, NULL_TREE, false, true, true, true, NULL,
- Empty);
+ ftype, NULL_TREE, is_disabled, true, true, true,
+ NULL, Empty);
DECL_IS_MALLOC (malloc32_decl) = 1;
/* free is a function declaration tree for a function to free memory. */
build_function_type_list (void_type_node,
ptr_void_type_node,
NULL_TREE),
- NULL_TREE, false, true, true, true, NULL, Empty);
+ NULL_TREE, is_disabled, true, true, true, NULL,
+ Empty);
/* This is used for 64-bit multiplication with overflow checking. */
mulv64_decl
= create_subprog_decl (get_identifier ("__gnat_mulv64"), NULL_TREE,
build_function_type_list (int64_type, int64_type,
int64_type, NULL_TREE),
- NULL_TREE, false, true, true, true, NULL, Empty);
+ NULL_TREE, is_disabled, true, true, true, NULL,
+ Empty);
/* Name of the _Parent field in tagged record types. */
parent_name_id = get_identifier (Get_Name_String (Name_uParent));
= create_subprog_decl
(get_identifier ("system__soft_links__get_jmpbuf_address_soft"),
NULL_TREE, build_function_type_list (jmpbuf_ptr_type, NULL_TREE),
- NULL_TREE, false, true, true, true, NULL, Empty);
+ NULL_TREE, is_disabled, true, true, true, NULL, Empty);
DECL_IGNORED_P (get_jmpbuf_decl) = 1;
set_jmpbuf_decl
(get_identifier ("system__soft_links__set_jmpbuf_address_soft"),
NULL_TREE, build_function_type_list (void_type_node, jmpbuf_ptr_type,
NULL_TREE),
- NULL_TREE, false, true, true, true, NULL, Empty);
+ NULL_TREE, is_disabled, true, true, true, NULL, Empty);
DECL_IGNORED_P (set_jmpbuf_decl) = 1;
/* setjmp returns an integer and has one operand, which is a pointer to
(get_identifier ("__builtin_setjmp"), NULL_TREE,
build_function_type_list (integer_type_node, jmpbuf_ptr_type,
NULL_TREE),
- NULL_TREE, false, true, true, true, NULL, Empty);
+ NULL_TREE, is_disabled, true, true, true, NULL, Empty);
DECL_BUILT_IN_CLASS (setjmp_decl) = BUILT_IN_NORMAL;
DECL_FUNCTION_CODE (setjmp_decl) = BUILT_IN_SETJMP;
= create_subprog_decl
(get_identifier ("__builtin_update_setjmp_buf"), NULL_TREE,
build_function_type_list (void_type_node, jmpbuf_ptr_type, NULL_TREE),
- NULL_TREE, false, true, true, true, NULL, Empty);
+ NULL_TREE, is_disabled, true, true, true, NULL, Empty);
DECL_BUILT_IN_CLASS (update_setjmp_buf_decl) = BUILT_IN_NORMAL;
DECL_FUNCTION_CODE (update_setjmp_buf_decl) = BUILT_IN_UPDATE_SETJMP_BUF;
begin_handler_decl
= create_subprog_decl (get_identifier ("__gnat_begin_handler"), NULL_TREE,
- ftype, NULL_TREE, false, true, true, true, NULL,
- Empty);
+ ftype, NULL_TREE, is_disabled, true, true, true,
+ NULL, Empty);
DECL_IGNORED_P (begin_handler_decl) = 1;
end_handler_decl
= create_subprog_decl (get_identifier ("__gnat_end_handler"), NULL_TREE,
- ftype, NULL_TREE, false, true, true, true, NULL,
- Empty);
+ ftype, NULL_TREE, is_disabled, true, true, true,
+ NULL, Empty);
DECL_IGNORED_P (end_handler_decl) = 1;
unhandled_except_decl
= create_subprog_decl (get_identifier ("__gnat_unhandled_except_handler"),
NULL_TREE,
- ftype, NULL_TREE, false, true, true, true, NULL,
- Empty);
+ ftype, NULL_TREE, is_disabled, true, true, true,
+ NULL, Empty);
DECL_IGNORED_P (unhandled_except_decl) = 1;
reraise_zcx_decl
= create_subprog_decl (get_identifier ("__gnat_reraise_zcx"), NULL_TREE,
- ftype, NULL_TREE, false, true, true, true, NULL,
- Empty);
+ ftype, NULL_TREE, is_disabled, true, true, true,
+ NULL, Empty);
/* Indicate that these never return. */
DECL_IGNORED_P (reraise_zcx_decl) = 1;
TREE_THIS_VOLATILE (reraise_zcx_decl) = 1;
build_pointer_type
(unsigned_char_type_node),
integer_type_node, NULL_TREE),
- NULL_TREE, false, true, true, true, NULL, Empty);
+ NULL_TREE, is_disabled, true, true, true, NULL, Empty);
TREE_THIS_VOLATILE (decl) = 1;
TREE_SIDE_EFFECTS (decl) = 1;
TREE_TYPE (decl)
(get_identifier ("system__soft_links__get_gnat_exception"), NULL_TREE,
build_function_type_list (build_pointer_type (except_type_node),
NULL_TREE),
- NULL_TREE, false, true, true, true, NULL, Empty);
+ NULL_TREE, is_disabled, true, true, true, NULL, Empty);
DECL_IGNORED_P (get_excptr_decl) = 1;
raise_nodefer_decl
build_function_type_list (void_type_node,
build_pointer_type (except_type_node),
NULL_TREE),
- NULL_TREE, false, true, true, true, NULL, Empty);
+ NULL_TREE, is_disabled, true, true, true, NULL, Empty);
/* Indicate that it never returns. */
TREE_THIS_VOLATILE (raise_nodefer_decl) = 1;
result
= create_subprog_decl (get_identifier (Name_Buffer),
NULL_TREE, ftype, NULL_TREE,
- false, true, true, true, NULL, Empty);
+ is_disabled, true, true, true, NULL, Empty);
/* Indicate that it never returns. */
TREE_THIS_VOLATILE (result) = 1;
ptr_void_type_node,
ptr_void_type_node,
NULL_TREE),
- NULL_TREE, false, true, true, true, NULL,
+ NULL_TREE, is_disabled, true, true, true, NULL,
Empty);
/* ??? DECL_CONTEXT shouldn't have been set because of DECL_EXTERNAL. */
tree gnu_elab_proc_decl
= create_subprog_decl
(create_concat_name (gnat_unit_entity, body_p ? "elabb" : "elabs"),
- NULL_TREE, void_ftype, NULL_TREE, false, true, false, true, NULL,
+ NULL_TREE, void_ftype, NULL_TREE, is_disabled, true, false, true, NULL,
gnat_unit);
struct elab_info *info;
create_subprog_decl (create_concat_name
(Entity (Prefix (gnat_node)),
attr == Attr_Elab_Body ? "elabb" : "elabs"),
- NULL_TREE, void_ftype, NULL_TREE, false,
+ NULL_TREE, void_ftype, NULL_TREE, is_disabled,
true, true, true, NULL, gnat_node);
gnu_result = Attribute_to_gnu (gnat_node, &gnu_result_type, attr);
* *
* C Implementation File *
* *
- * Copyright (C) 1992-2012, Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2013, Free Software Foundation, Inc. *
* *
* GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- *
node), PARAM_DECL_LIST is the list of the subprogram arguments (a list of
PARM_DECL nodes chained through the DECL_CHAIN field).
- INLINE_FLAG, PUBLIC_FLAG, EXTERN_FLAG, ARTIFICIAL_FLAG and ATTR_LIST are
+ INLINE_STATUS, PUBLIC_FLAG, EXTERN_FLAG, ARTIFICIAL_FLAG and ATTR_LIST are
used to set the appropriate fields in the FUNCTION_DECL. GNAT_NODE is
used for the position of the decl. */
tree
create_subprog_decl (tree subprog_name, tree asm_name, tree subprog_type,
- tree param_decl_list, bool inline_flag, bool public_flag,
- bool extern_flag, bool artificial_flag,
+ tree param_decl_list, enum inline_status_t inline_status,
+ bool public_flag, bool extern_flag, bool artificial_flag,
struct attrib *attr_list, Node_Id gnat_node)
{
tree subprog_decl = build_decl (input_location, FUNCTION_DECL, subprog_name,
function in the current unit since it is private to the other unit.
We could inline the nested function as well but it's probably better
to err on the side of too little inlining. */
- if (!inline_flag
+ if (inline_status != is_enabled
&& !public_flag
&& current_function_decl
&& DECL_DECLARED_INLINE_P (current_function_decl)
DECL_ARTIFICIAL (subprog_decl) = artificial_flag;
DECL_EXTERNAL (subprog_decl) = extern_flag;
- DECL_DECLARED_INLINE_P (subprog_decl) = inline_flag;
- DECL_NO_INLINE_WARNING_P (subprog_decl) = inline_flag && artificial_flag;
+
+ switch (inline_status)
+ {
+ case is_suppressed:
+ DECL_UNINLINABLE (subprog_decl) = 1;
+ break;
+
+ case is_disabled:
+ break;
+
+ case is_enabled:
+ DECL_DECLARED_INLINE_P (subprog_decl) = 1;
+ DECL_NO_INLINE_WARNING_P (subprog_decl) = artificial_flag;
+ break;
+
+ default:
+ gcc_unreachable ();
+ }
TREE_PUBLIC (subprog_decl) = public_flag;
TREE_READONLY (subprog_decl) = TYPE_READONLY (subprog_type);