diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2016-01-18 11:10:42 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2016-01-18 11:10:42 +0000 |
commit | 7c775aca298673f95dddfb8605f11b0e2f236361 (patch) | |
tree | 0bffe85bad394e4bb7306e24515f3f47f8dfe5d1 /gcc/ada/gcc-interface/trans.c | |
parent | 3dd5f42e90fa6e296d233b0f05c3a760a45d1313 (diff) | |
download | gcc-7c775aca298673f95dddfb8605f11b0e2f236361.zip gcc-7c775aca298673f95dddfb8605f11b0e2f236361.tar.gz gcc-7c775aca298673f95dddfb8605f11b0e2f236361.tar.bz2 |
ada-tree.h (TYPE_IMPLEMENTS_PACKED_ARRAY_P): Rename to
* gcc-interface/ada-tree.h (TYPE_IMPLEMENTS_PACKED_ARRAY_P): Rename to
(TYPE_IMPL_PACKED_ARRAY_P): ...this.
(TYPE_CAN_HAVE_DEBUG_TYPE_P): Do not test TYPE_DEBUG_TYPE.
* gcc-interface/decl.c (gnat_to_gnu_entity): Simplify NULL_TREE tests
and tweak gnat_encodings tests throughout.
(initial_value_needs_conversion): Likewise.
(intrin_arglists_compatible_p): Likewise.
* gcc-interface/misc.c (gnat_print_type): Likewise.
(gnat_get_debug_type): Likewise.
(gnat_get_fixed_point_type_info): Likewise.
(gnat_get_array_descr_info): Likewise.
(get_array_bit_stride): Likewise.
(gnat_get_type_bias): Fix formatting.
(enumerate_modes): Likewise.
* gcc-interface/trans.c (gnat_to_gnu): Likewise.
(add_decl_expr): Simplify NULL_TREE test.
(end_stmt_group): Likewise.
(build_binary_op_trapv): Fix formatting.
(get_exception_label): Use switch statement.
(init_code_table): Move around.
* gcc-interface/utils.c (global_bindings_p): Simplify NULL_TREE test.
(gnat_poplevel): Likewise.
(gnat_set_type_context): Likewise.
(defer_or_set_type_context): Fix formatting.
(gnat_pushdecl): Simplify NULL_TREE test.
(maybe_pad_type): Likewise.
(add_parallel_type): Likewise.
(create_range_type): Likewise.
(process_deferred_decl_context): Likewise.
(convert): Likewise.
(def_builtin_1): Likewise.
* gcc-interface/utils2.c (find_common_type): Likewise.
(build_binary_op): Likewise.
(gnat_rewrite_reference): Likewise.
(get_inner_constant_reference): Likewise.
From-SVN: r232501
Diffstat (limited to 'gcc/ada/gcc-interface/trans.c')
-rw-r--r-- | gcc/ada/gcc-interface/trans.c | 68 |
1 files changed, 38 insertions, 30 deletions
diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c index 8f8778e..10136e8 100644 --- a/gcc/ada/gcc-interface/trans.c +++ b/gcc/ada/gcc-interface/trans.c @@ -6,7 +6,7 @@ * * * C Implementation File * * * - * Copyright (C) 1992-2015, Free Software Foundation, Inc. * + * Copyright (C) 1992-2016, 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- * @@ -6027,7 +6027,7 @@ gnat_to_gnu (Node_Id gnat_node) full view since the clause is on the partial view and we cannot have 2 different GCC trees for the object. The only bits of the full view we will use is the initializer, but it will be directly fetched. */ - if (Ekind(gnat_temp) == E_Constant + if (Ekind (gnat_temp) == E_Constant && Present (Address_Clause (gnat_temp)) && Present (Full_View (gnat_temp))) save_gnu_tree (Full_View (gnat_temp), error_mark_node, true); @@ -8035,7 +8035,7 @@ add_decl_expr (tree gnu_decl, Entity_Id gnat_entity) /* If this is a variable and an initializer is attached to it, it must be valid for the context. Similar to init_const in create_var_decl. */ if (TREE_CODE (gnu_decl) == VAR_DECL - && (gnu_init = DECL_INITIAL (gnu_decl)) != NULL_TREE + && (gnu_init = DECL_INITIAL (gnu_decl)) && (!gnat_types_compatible_p (type, TREE_TYPE (gnu_init)) || (TREE_STATIC (gnu_decl) && !initializer_constant_valid_p (gnu_init, @@ -8128,7 +8128,7 @@ end_stmt_group (void) are cleanups, make a TRY_FINALLY_EXPR. Last, if there is a BLOCK, make a BIND_EXPR. Note that we nest in that because the cleanup may reference variables in the block. */ - if (gnu_retval == NULL_TREE) + if (!gnu_retval) gnu_retval = alloc_stmt_list (); if (group->cleanups) @@ -9023,7 +9023,7 @@ build_binary_op_trapv (enum tree_code code, tree gnu_type, tree left, break; default: - gcc_unreachable(); + gcc_unreachable (); } check = fold_build3 (COND_EXPR, boolean_type_node, rhs_lt_zero, check_neg, @@ -10083,7 +10083,39 @@ post_error_ne_tree_2 (const char *msg, Node_Id node, Entity_Id ent, tree t, Error_Msg_Uint_2 = UI_From_Int (num); post_error_ne_tree (msg, node, ent, t); } - + +/* Return a label to branch to for the exception type in KIND or NULL_TREE + if none. */ + +tree +get_exception_label (char kind) +{ + switch (kind) + { + case N_Raise_Constraint_Error: + return gnu_constraint_error_label_stack->last (); + + case N_Raise_Storage_Error: + return gnu_storage_error_label_stack->last (); + + case N_Raise_Program_Error: + return gnu_program_error_label_stack->last (); + + default: + break; + } + + return NULL_TREE; +} + +/* Return the decl for the current elaboration procedure. */ + +tree +get_elaboration_procedure (void) +{ + return gnu_elab_proc_stack->last (); +} + /* Initialize the table that maps GNAT codes to GCC codes for simple binary and unary operations. */ @@ -10117,28 +10149,4 @@ init_code_table (void) gnu_codes[N_Op_Shift_Right_Arithmetic] = RSHIFT_EXPR; } -/* Return a label to branch to for the exception type in KIND or NULL_TREE - if none. */ - -tree -get_exception_label (char kind) -{ - if (kind == N_Raise_Constraint_Error) - return gnu_constraint_error_label_stack->last (); - else if (kind == N_Raise_Storage_Error) - return gnu_storage_error_label_stack->last (); - else if (kind == N_Raise_Program_Error) - return gnu_program_error_label_stack->last (); - else - return NULL_TREE; -} - -/* Return the decl for the current elaboration procedure. */ - -tree -get_elaboration_procedure (void) -{ - return gnu_elab_proc_stack->last (); -} - #include "gt-ada-trans.h" |