summaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/trans.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/gcc-interface/trans.c')
-rw-r--r--gcc/ada/gcc-interface/trans.c109
1 files changed, 54 insertions, 55 deletions
diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c
index 85a77ea5faf..bf15955e4df 100644
--- a/gcc/ada/gcc-interface/trans.c
+++ b/gcc/ada/gcc-interface/trans.c
@@ -390,16 +390,14 @@ gigi (Node_Id gnat_root,
gcc_assert (t == boolean_false_node);
t = create_var_decl (get_entity_name (gnat_literal), NULL_TREE,
boolean_type_node, t, true, false, false, false,
- NULL, gnat_literal);
- DECL_IGNORED_P (t) = 1;
+ true, false, NULL, gnat_literal);
save_gnu_tree (gnat_literal, t, false);
gnat_literal = Next_Literal (gnat_literal);
t = UI_To_gnu (Enumeration_Rep (gnat_literal), boolean_type_node);
gcc_assert (t == boolean_true_node);
t = create_var_decl (get_entity_name (gnat_literal), NULL_TREE,
boolean_type_node, t, true, false, false, false,
- NULL, gnat_literal);
- DECL_IGNORED_P (t) = 1;
+ true, false, NULL, gnat_literal);
save_gnu_tree (gnat_literal, t, false);
void_ftype = build_function_type_list (void_type_node, NULL_TREE);
@@ -412,7 +410,8 @@ gigi (Node_Id gnat_root,
memory. */
malloc_decl
= create_subprog_decl (get_identifier ("__gnat_malloc"), NULL_TREE,
- ftype, NULL_TREE, is_disabled, true, true, true,
+ ftype,
+ NULL_TREE, is_disabled, true, true, true, false,
NULL, Empty);
DECL_IS_MALLOC (malloc_decl) = 1;
@@ -422,8 +421,8 @@ gigi (Node_Id gnat_root,
build_function_type_list (void_type_node,
ptr_type_node,
NULL_TREE),
- NULL_TREE, is_disabled, true, true, true, NULL,
- Empty);
+ NULL_TREE, is_disabled, true, true, true, false,
+ NULL, Empty);
/* This is used for 64-bit multiplication with overflow checking. */
int64_type = gnat_type_for_size (64, 0);
@@ -431,8 +430,8 @@ gigi (Node_Id gnat_root,
= create_subprog_decl (get_identifier ("__gnat_mulv64"), NULL_TREE,
build_function_type_list (int64_type, int64_type,
int64_type, NULL_TREE),
- NULL_TREE, is_disabled, true, true, true, NULL,
- Empty);
+ NULL_TREE, is_disabled, true, true, true, false,
+ NULL, Empty);
/* Name of the _Parent field in tagged record types. */
parent_name_id = get_identifier (Get_Name_String (Name_uParent));
@@ -453,16 +452,14 @@ gigi (Node_Id gnat_root,
= 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, is_disabled, true, true, true, NULL, Empty);
- DECL_IGNORED_P (get_jmpbuf_decl) = 1;
+ NULL_TREE, is_disabled, true, true, true, false, NULL, Empty);
set_jmpbuf_decl
= create_subprog_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, is_disabled, true, true, true, NULL, Empty);
- DECL_IGNORED_P (set_jmpbuf_decl) = 1;
+ NULL_TREE, is_disabled, true, true, true, false, NULL, Empty);
/* setjmp returns an integer and has one operand, which is a pointer to
a jmpbuf. */
@@ -471,7 +468,7 @@ gigi (Node_Id gnat_root,
(get_identifier ("__builtin_setjmp"), NULL_TREE,
build_function_type_list (integer_type_node, jmpbuf_ptr_type,
NULL_TREE),
- NULL_TREE, is_disabled, true, true, true, NULL, Empty);
+ NULL_TREE, is_disabled, true, true, true, false, NULL, Empty);
DECL_BUILT_IN_CLASS (setjmp_decl) = BUILT_IN_NORMAL;
DECL_FUNCTION_CODE (setjmp_decl) = BUILT_IN_SETJMP;
@@ -481,7 +478,7 @@ gigi (Node_Id gnat_root,
= 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, is_disabled, true, true, true, NULL, Empty);
+ NULL_TREE, is_disabled, true, true, true, false, 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;
@@ -490,29 +487,28 @@ gigi (Node_Id gnat_root,
begin_handler_decl
= create_subprog_decl (get_identifier ("__gnat_begin_handler"), NULL_TREE,
- ftype, NULL_TREE, is_disabled, true, true, true,
+ ftype, NULL_TREE,
+ is_disabled, true, true, true, false,
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, is_disabled, true, true, true,
+ ftype, NULL_TREE,
+ is_disabled, true, true, true, false,
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, is_disabled, true, true, true,
+ NULL_TREE, ftype, NULL_TREE,
+ is_disabled, true, true, true, false,
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, is_disabled, true, true, true,
+ ftype, NULL_TREE,
+ is_disabled, true, true, true, false,
NULL, Empty);
/* Indicate that these never return. */
- DECL_IGNORED_P (reraise_zcx_decl) = 1;
TREE_THIS_VOLATILE (reraise_zcx_decl) = 1;
TREE_SIDE_EFFECTS (reraise_zcx_decl) = 1;
TREE_TYPE (reraise_zcx_decl)
@@ -530,7 +526,7 @@ gigi (Node_Id gnat_root,
build_pointer_type
(unsigned_char_type_node),
integer_type_node, NULL_TREE),
- NULL_TREE, is_disabled, true, true, true, NULL, Empty);
+ NULL_TREE, is_disabled, true, true, true, false, NULL, Empty);
TREE_THIS_VOLATILE (decl) = 1;
TREE_SIDE_EFFECTS (decl) = 1;
TREE_TYPE (decl)
@@ -561,15 +557,14 @@ gigi (Node_Id gnat_root,
(get_identifier ("system__soft_links__get_gnat_exception"), NULL_TREE,
build_function_type_list (build_pointer_type (except_type_node),
NULL_TREE),
- NULL_TREE, is_disabled, true, true, true, NULL, Empty);
- DECL_IGNORED_P (get_excptr_decl) = 1;
+ NULL_TREE, is_disabled, true, true, true, false, NULL, Empty);
set_exception_parameter_decl
= create_subprog_decl
(get_identifier ("__gnat_set_exception_parameter"), NULL_TREE,
build_function_type_list (void_type_node, ptr_type_node, ptr_type_node,
NULL_TREE),
- NULL_TREE, is_disabled, true, true, true, NULL, Empty);
+ NULL_TREE, is_disabled, true, true, true, false, NULL, Empty);
raise_nodefer_decl
= create_subprog_decl
@@ -577,7 +572,7 @@ gigi (Node_Id gnat_root,
build_function_type_list (void_type_node,
build_pointer_type (except_type_node),
NULL_TREE),
- NULL_TREE, is_disabled, true, true, true, NULL, Empty);
+ NULL_TREE, is_disabled, true, true, true, false, NULL, Empty);
/* Indicate that it never returns. */
TREE_THIS_VOLATILE (raise_nodefer_decl) = 1;
@@ -625,20 +620,23 @@ gigi (Node_Id gnat_root,
others_decl
= create_var_decl (get_identifier ("OTHERS"),
get_identifier ("__gnat_others_value"),
- unsigned_char_type_node,
- NULL_TREE, true, false, true, false, NULL, Empty);
+ unsigned_char_type_node, NULL_TREE,
+ true, false, true, false, true, false,
+ NULL, Empty);
all_others_decl
= create_var_decl (get_identifier ("ALL_OTHERS"),
get_identifier ("__gnat_all_others_value"),
- unsigned_char_type_node,
- NULL_TREE, true, false, true, false, NULL, Empty);
+ unsigned_char_type_node, NULL_TREE,
+ true, false, true, false, true, false,
+ NULL, Empty);
unhandled_others_decl
= create_var_decl (get_identifier ("UNHANDLED_OTHERS"),
get_identifier ("__gnat_unhandled_others_value"),
- unsigned_char_type_node,
- NULL_TREE, true, false, true, false, NULL, Empty);
+ unsigned_char_type_node, NULL_TREE,
+ true, false, true, false, true, false,
+ NULL, Empty);
main_identifier_node = get_identifier ("main");
@@ -750,7 +748,8 @@ build_raise_check (int check, enum exception_info_kind kind)
result
= create_subprog_decl (get_identifier (Name_Buffer),
NULL_TREE, ftype, NULL_TREE,
- is_disabled, true, true, true, NULL, Empty);
+ is_disabled, true, true, true, false,
+ NULL, Empty);
/* Indicate that it never returns. */
TREE_THIS_VOLATILE (result) = 1;
@@ -3664,7 +3663,8 @@ Subprogram_Body_to_gnu (Node_Id gnat_node)
gnu_return_var
= create_var_decl (get_identifier ("RETVAL"), NULL_TREE,
gnu_return_type, NULL_TREE, false, false,
- false, false, NULL, gnat_subprog_id);
+ false, false, true, false,
+ NULL, gnat_subprog_id);
TREE_VALUE (gnu_return_var_elmt) = gnu_return_var;
}
@@ -4068,10 +4068,7 @@ create_temporary (const char *prefix, tree type)
{
tree gnu_temp = create_var_decl (create_tmp_var_name (prefix), NULL_TREE,
type, NULL_TREE, false, false, false, false,
- NULL, Empty);
- DECL_ARTIFICIAL (gnu_temp) = 1;
- DECL_IGNORED_P (gnu_temp) = 1;
-
+ true, false, NULL, Empty);
return gnu_temp;
}
@@ -4847,8 +4844,8 @@ Handled_Sequence_Of_Statements_to_gnu (Node_Id gnat_node)
= create_var_decl (get_identifier ("JMPBUF_SAVE"), NULL_TREE,
jmpbuf_ptr_type,
build_call_n_expr (get_jmpbuf_decl, 0),
- false, false, false, false, NULL, gnat_node);
- DECL_ARTIFICIAL (gnu_jmpsave_decl) = 1;
+ false, false, false, false, true, false,
+ NULL, gnat_node);
/* The __builtin_setjmp receivers will immediately reinstall it. Now
because of the unstructured form of EH used by setjmp_longjmp, there
@@ -4859,8 +4856,8 @@ Handled_Sequence_Of_Statements_to_gnu (Node_Id gnat_node)
= create_var_decl (get_identifier ("JMP_BUF"), NULL_TREE,
jmpbuf_type,
NULL_TREE,
- false, false, false, false, NULL, gnat_node);
- DECL_ARTIFICIAL (gnu_jmpbuf_decl) = 1;
+ false, false, false, false, true, false,
+ NULL, gnat_node);
set_block_jmpbuf_decl (gnu_jmpbuf_decl);
@@ -4917,7 +4914,7 @@ Handled_Sequence_Of_Statements_to_gnu (Node_Id gnat_node)
create_var_decl (get_identifier ("EXCEPT_PTR"), NULL_TREE,
build_pointer_type (except_type_node),
build_call_n_expr (get_excptr_decl, 0),
- false, false, false, false,
+ false, false, false, false, true, false,
NULL, gnat_node));
/* Generate code for each handler. The N_Exception_Handler case does the
@@ -5163,10 +5160,11 @@ Exception_Handler_to_gnu_zcx (Node_Id gnat_node)
= build_call_expr (builtin_decl_explicit (BUILT_IN_EH_POINTER),
1, integer_zero_node);
prev_gnu_incoming_exc_ptr = gnu_incoming_exc_ptr;
- gnu_incoming_exc_ptr = create_var_decl (get_identifier ("EXPTR"), NULL_TREE,
- ptr_type_node, gnu_current_exc_ptr,
- false, false, false, false,
- NULL, gnat_node);
+ gnu_incoming_exc_ptr
+ = create_var_decl (get_identifier ("EXPTR"), NULL_TREE,
+ ptr_type_node, gnu_current_exc_ptr,
+ false, false, false, false, true, true,
+ NULL, gnat_node);
add_stmt_with_node (build_call_n_expr (begin_handler_decl, 1,
gnu_incoming_exc_ptr),
@@ -5212,8 +5210,8 @@ Compilation_Unit_to_gnu (Node_Id gnat_node)
tree gnu_elab_proc_decl
= create_subprog_decl
(create_concat_name (gnat_unit_entity, body_p ? "elabb" : "elabs"),
- NULL_TREE, void_ftype, NULL_TREE, is_disabled, true, false, true, NULL,
- gnat_unit);
+ NULL_TREE, void_ftype, NULL_TREE, is_disabled, true, false, true, true,
+ NULL, gnat_unit);
struct elab_info *info;
vec_safe_push (gnu_elab_proc_stack, gnu_elab_proc_decl);
@@ -6127,7 +6125,7 @@ gnat_to_gnu (Node_Id gnat_node)
(Entity (Prefix (gnat_node)),
attr == Attr_Elab_Body ? "elabb" : "elabs"),
NULL_TREE, void_ftype, NULL_TREE, is_disabled,
- true, true, true, NULL, gnat_node);
+ true, true, true, true, NULL, gnat_node);
gnu_result = Attribute_to_gnu (gnat_node, &gnu_result_type, attr);
}
@@ -6861,7 +6859,7 @@ gnat_to_gnu (Node_Id gnat_node)
tree gnu_ret_deref
= build_unary_op (INDIRECT_REF, TREE_TYPE (gnu_ret_val),
gnu_ret_obj);
- gnu_result = build2 (MODIFY_EXPR, void_type_node,
+ gnu_result = build2 (INIT_EXPR, void_type_node,
gnu_ret_deref, gnu_ret_val);
add_stmt_with_node (gnu_result, gnat_node);
gnu_ret_val = NULL_TREE;
@@ -7087,7 +7085,8 @@ gnat_to_gnu (Node_Id gnat_node)
deallocated. */
gnu_expr = create_var_decl (get_identifier ("SAVED_EXPTR"), NULL_TREE,
ptr_type_node, gnu_incoming_exc_ptr,
- false, false, false, false, NULL, gnat_node);
+ false, false, false, false, true, true,
+ NULL, gnat_node);
add_stmt (build_binary_op (MODIFY_EXPR, NULL_TREE, gnu_incoming_exc_ptr,
convert (ptr_type_node, integer_zero_node)));