diff options
author | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2008-07-30 23:54:56 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2008-07-30 23:54:56 +0000 |
commit | 01ddebf20842e3e6b9b9349a2e68cd702bfcc27b (patch) | |
tree | 87a4eb9f676e3356453c46961c4ca3f72f9bd2a7 /gcc/ada/gcc-interface/trans.c | |
parent | b8c71e40e0eecc003533b7f294fbe2d29e641326 (diff) | |
download | gcc-01ddebf20842e3e6b9b9349a2e68cd702bfcc27b.zip gcc-01ddebf20842e3e6b9b9349a2e68cd702bfcc27b.tar.gz gcc-01ddebf20842e3e6b9b9349a2e68cd702bfcc27b.tar.bz2 |
re PR ada/36554 (verify_flow_info ICE can not throw but has EH edges)
PR ada/36554
* dwarf2out.c (is_subrange_type): Deal with BOOLEAN_TYPE.
ada/
* back_end.adb (Call_Back_End): Pass Standard_Boolean to gigi.
* gcc-interface/gigi.h (gigi): Take new standard_boolean parameter.
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Enumeration_Subtype>:
Set precision to 1 for subtype of BOOLEAN_TYPE.
(set_rm_size): Set TYPE_RM_SIZE_NUM for BOOLEAN_TYPE.
(make_type_from_size): Deal with BOOLEAN_TYPE.
* gcc-interface/misc.c (gnat_print_type): Likewise.
* gcc-interface/trans.c (gigi): Take new standard_boolean parameter.
Set boolean_type_node as its translation in the table, as well
as boolean_false_node for False and boolean_true_node for True.
* gcc-interface/utils.c (gnat_init_decl_processing): Create custom
8-bit boolean_type_node and set its TYPE_RM_SIZE_NUM.
(create_param_decl): Deal with BOOLEAN_TYPE.
(build_vms_descriptor): Likewise.
(build_vms_descriptor64): Likewise.
(convert): Deal with BOOLEAN_TYPE like with ENUMERAL_TYPE.
From-SVN: r138348
Diffstat (limited to 'gcc/ada/gcc-interface/trans.c')
-rw-r--r-- | gcc/ada/gcc-interface/trans.c | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c index 3b15e30..9d3f807 100644 --- a/gcc/ada/gcc-interface/trans.c +++ b/gcc/ada/gcc-interface/trans.c @@ -231,12 +231,12 @@ gigi (Node_Id gnat_root, int max_gnat_node, int number_name, struct Elist_Header *elists_ptr, struct Elmt_Item *elmts_ptr, struct String_Entry *strings_ptr, Char_Code *string_chars_ptr, struct List_Header *list_headers_ptr, Nat number_file, - struct File_Info_Type *file_info_ptr, + struct File_Info_Type *file_info_ptr, Entity_Id standard_boolean, Entity_Id standard_integer, Entity_Id standard_long_long_float, Entity_Id standard_exception_type, Int gigi_operating_mode) { - tree gnu_standard_long_long_float; - tree gnu_standard_exception_type; + Entity_Id gnat_literal; + tree gnu_standard_long_long_float, gnu_standard_exception_type, t; struct elab_info *info; int i; @@ -311,6 +311,8 @@ gigi (Node_Id gnat_root, int max_gnat_node, int number_name, /* Give names and make TYPE_DECLs for common types. */ create_type_decl (get_identifier (SIZE_TYPE), sizetype, NULL, false, true, Empty); + create_type_decl (get_identifier ("boolean"), boolean_type_node, + NULL, false, true, Empty); create_type_decl (get_identifier ("integer"), integer_type_node, NULL, false, true, Empty); create_type_decl (get_identifier ("unsigned char"), char_type_node, @@ -318,6 +320,26 @@ gigi (Node_Id gnat_root, int max_gnat_node, int number_name, create_type_decl (get_identifier ("long integer"), long_integer_type_node, NULL, false, true, Empty); + /* Save the type we made for boolean as the type for Standard.Boolean. */ + save_gnu_tree (Base_Type (standard_boolean), TYPE_NAME (boolean_type_node), + false); + gnat_literal = First_Literal (Base_Type (standard_boolean)); + t = UI_To_gnu (Enumeration_Rep (gnat_literal), boolean_type_node); + 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; + 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; + save_gnu_tree (gnat_literal, t, false); + /* Save the type we made for integer as the type for Standard.Integer. Then make the rest of the standard types. Note that some of these may be subtypes. */ |