diff options
| author | Arnaud Charlet <charlet@gcc.gnu.org> | 2004-07-26 12:42:13 +0200 |
|---|---|---|
| committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2004-07-26 12:42:13 +0200 |
| commit | 615cbd95bd73d35bdf41475f60243f9d9fefc5f4 (patch) | |
| tree | 70c781e7f9e0b3989847ce98520d13a3cf176d39 /gcc/ada/misc.c | |
| parent | 63d1c7b35fe104326f278f45daf20743853920bb (diff) | |
| download | gcc-615cbd95bd73d35bdf41475f60243f9d9fefc5f4.zip gcc-615cbd95bd73d35bdf41475f60243f9d9fefc5f4.tar.gz gcc-615cbd95bd73d35bdf41475f60243f9d9fefc5f4.tar.bz2 | |
[multiple changes]
2004-07-26 Arnaud Charlet <charlet@act-europe.fr>
* sem_util.adb (Requires_Transient_Scope): Temporarily disable
optimization, not supported by the tree-ssa back-end.
2004-07-26 Olivier Hainque <hainque@act-europe.fr>
* s-mastop-irix.adb: Update comments.
* a-except.adb (Exception_Information): Raise Constraint_Error if
exception Id is Null_Id.
This is required behavior, which is more reliably and clearly checked
at the top level interface level.
2004-07-26 Javier Miranda <miranda@gnat.com>
* exp_aggr.adb (Build_Array_Aggr_Code): Do not build the initialization
call if a component has no default_expression and the box is used.
* sem_aggr.adb (Resolve_Array_Aggregate): If a component has no
default_expression and you use box, it behaves as if you had declared a
stand-alone object.
(Resolve_Record_Aggregate): If a component has no default_expression and
you use box, it behaves as if you had declared a stand-alone object.
* sem_ch10.adb (Install_Siblings): Do not make visible the private
entities of private-with siblings.
2004-07-26 Ed Schonberg <schonberg@gnat.com>
* sem_ch3.adb (Build_Underlying_Full_View): If this is the full view
for a component of an itype, set the parent pointer for analysis,
there is no list in which to insert it.
* sem_res.adb (Resolve): Call Rewrite_Renamed_Operator only for
bona-fide renamings, not for inherited operations.
* exp_ch4.adb (Expand_Allocator_Expression): If the allocator is an
actual for a formal that is an access parameter, create local
finalization list even if the expression is not an aggregate.
2004-07-26 Ed Schonberg <schonberg@gnat.com>
PR ada/16213
* sem_ch8.adb (Attribute_Renaming, Check_Library_Level_Renaming):
Diagnose properly illegal subprogram renamings that are library units.
2004-07-26 Ed Schonberg <schonberg@gnat.com>
PR ada/15588
* sem_util.adb (Is_OK_Variable_For_Out_Formal): If actual is a type
conversion rewritten as an unchecked conversion, check that original
expression is a variable.
* exp_ch4.adb (Expand_N_Type_Conversion): If rewriting as an
unchecked_conversion, create new node rather than rewriting in place,
to preserve original construct.
2004-07-26 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* gigi.h (gnat_expand_body): Deleted.
* Make-lang.in: (trans.o): Depends on function.h.
* misc.c: (gnat_expand_body): Moved to here.
* trans.c (gnat_expand_body_1): Deleted.
(gnat_expand_body): Moved from here.
(gnat_to_gnu): N_Implicit_Label_Declaration forces being in elab proc.
(add_stmt): Check for marked visited with global_bindings_p.
(gnat_gimplify_expr, case COMPONENT_REF): New case.
(gnat_gimplify_expr, case NULL_EXPR): Set TREE_NO_WARNING for temp.
* utils2.c (build_binary_op, case MODIFY_EXPR): Put LHS in a
VIEW_CONVERT_EXPR if not operation type.
* utils.c (update_pointer_to): Set DECL_ORIGINAL_FIELD for
fat pointer.
* decl.c, cuintp.c, gigi.h, misc.c, trans.c, utils.c, utils2.c: Minor
changes: reformatting of negation operators, removing unneeded
inequality comparison with zero, converting equality comparisons with
zero to negations, changing int/0/1 to bool/false/true, replace calls
to gigi_abort with abort, and various other similar changes.
2004-07-26 Vincent Celier <celier@gnat.com>
* gnatcmd.adb (GNATCmd): Add processing for new built-in command
"setup".
* make.adb (Gnatmake): Fail when a library is not present and there is
no object directory.
* mlib-prj.adb (Check_Library): No need to check if the library needs
to be rebuilt if there is no object directory, hence no object files
to build the library.
* opt.ads (Setup_Projects): New Boolean flag.
* prj-nmsc.adb (Locate_Directory): New parameter Project, Kind and
Location.
Create directory when Kind /= "" and in "gnat setup". Report error if
directory cannot be created.
(Ada_Check): Create library interface copy dir if it does not exist
and we are in "gnat setup".
(Find_Sources): No error if in "gnat setup" and no Ada sources were
found.
(Language_Independent_Check): Create object directory, exec directory
and/or library directory if they do not exist and we are in
"gnat setup".
* vms_conv.ads: (Command_Type): New command Setup.
* vms_conv.adb (Initialize): Add Setup component of Cammand_List.
* vms_data.ads: Add qualifiers/switches for new built-in command
"setup".
From-SVN: r85188
Diffstat (limited to 'gcc/ada/misc.c')
| -rw-r--r-- | gcc/ada/misc.c | 79 |
1 files changed, 44 insertions, 35 deletions
diff --git a/gcc/ada/misc.c b/gcc/ada/misc.c index a22815c..9aef623 100644 --- a/gcc/ada/misc.c +++ b/gcc/ada/misc.c @@ -101,6 +101,7 @@ static int gnat_eh_type_covers (tree, tree); static void gnat_parse_file (int); static rtx gnat_expand_expr (tree, rtx, enum machine_mode, int, rtx *); +static void gnat_expand_body (tree); static void internal_error_function (const char *, va_list *); static void gnat_adjust_rli (record_layout_info); static tree gnat_type_max_size (tree); @@ -117,54 +118,51 @@ static tree gnat_type_max_size (tree); #define LANG_HOOKS_INIT_OPTIONS gnat_init_options #undef LANG_HOOKS_HANDLE_OPTION #define LANG_HOOKS_HANDLE_OPTION gnat_handle_option -#undef LANG_HOOKS_POST_OPTIONS +#undef LANG_HOOKS_POST_OPTIONS #define LANG_HOOKS_POST_OPTIONS gnat_post_options -#undef LANG_HOOKS_PARSE_FILE +#undef LANG_HOOKS_PARSE_FILE #define LANG_HOOKS_PARSE_FILE gnat_parse_file -#undef LANG_HOOKS_HONOR_READONLY +#undef LANG_HOOKS_HONOR_READONLY #define LANG_HOOKS_HONOR_READONLY true -#undef LANG_HOOKS_HASH_TYPES +#undef LANG_HOOKS_HASH_TYPES #define LANG_HOOKS_HASH_TYPES false -#undef LANG_HOOKS_GETDECLS +#undef LANG_HOOKS_GETDECLS #define LANG_HOOKS_GETDECLS lhd_return_null_tree_v -#undef LANG_HOOKS_PUSHDECL +#undef LANG_HOOKS_PUSHDECL #define LANG_HOOKS_PUSHDECL lhd_return_tree -#undef LANG_HOOKS_FINISH_INCOMPLETE_DECL +#undef LANG_HOOKS_FINISH_INCOMPLETE_DECL #define LANG_HOOKS_FINISH_INCOMPLETE_DECL gnat_finish_incomplete_decl -#undef LANG_HOOKS_GET_ALIAS_SET +#undef LANG_HOOKS_GET_ALIAS_SET #define LANG_HOOKS_GET_ALIAS_SET gnat_get_alias_set -#undef LANG_HOOKS_EXPAND_EXPR +#undef LANG_HOOKS_EXPAND_EXPR #define LANG_HOOKS_EXPAND_EXPR gnat_expand_expr -#undef LANG_HOOKS_MARK_ADDRESSABLE +#undef LANG_HOOKS_MARK_ADDRESSABLE #define LANG_HOOKS_MARK_ADDRESSABLE gnat_mark_addressable -#undef LANG_HOOKS_TRUTHVALUE_CONVERSION +#undef LANG_HOOKS_TRUTHVALUE_CONVERSION #define LANG_HOOKS_TRUTHVALUE_CONVERSION gnat_truthvalue_conversion -#undef LANG_HOOKS_PRINT_DECL +#undef LANG_HOOKS_PRINT_DECL #define LANG_HOOKS_PRINT_DECL gnat_print_decl -#undef LANG_HOOKS_PRINT_TYPE +#undef LANG_HOOKS_PRINT_TYPE #define LANG_HOOKS_PRINT_TYPE gnat_print_type -#undef LANG_HOOKS_TYPES_COMPATIBLE_P +#undef LANG_HOOKS_TYPES_COMPATIBLE_P #define LANG_HOOKS_TYPES_COMPATIBLE_P gnat_types_compatible_p -#undef LANG_HOOKS_TYPE_MAX_SIZE +#undef LANG_HOOKS_TYPE_MAX_SIZE #define LANG_HOOKS_TYPE_MAX_SIZE gnat_type_max_size -#undef LANG_HOOKS_DECL_PRINTABLE_NAME +#undef LANG_HOOKS_DECL_PRINTABLE_NAME #define LANG_HOOKS_DECL_PRINTABLE_NAME gnat_printable_name -#undef LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION +#undef LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION #define LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION gnat_expand_body -#undef LANG_HOOKS_RTL_EXPAND_STMT -#define LANG_HOOKS_RTL_EXPAND_STMT gnat_expand_stmt -#undef LANG_HOOKS_GIMPLIFY_EXPR -#define LANG_HOOKS_GIMPLIFY_EXPR gnat_gimplify_expr - -#undef LANG_HOOKS_TYPE_FOR_MODE +#undef LANG_HOOKS_GIMPLIFY_EXPR +#define LANG_HOOKS_GIMPLIFY_EXPR gnat_gimplify_expr +#undef LANG_HOOKS_TYPE_FOR_MODE #define LANG_HOOKS_TYPE_FOR_MODE gnat_type_for_mode -#undef LANG_HOOKS_TYPE_FOR_SIZE +#undef LANG_HOOKS_TYPE_FOR_SIZE #define LANG_HOOKS_TYPE_FOR_SIZE gnat_type_for_size -#undef LANG_HOOKS_SIGNED_TYPE +#undef LANG_HOOKS_SIGNED_TYPE #define LANG_HOOKS_SIGNED_TYPE gnat_signed_type -#undef LANG_HOOKS_UNSIGNED_TYPE +#undef LANG_HOOKS_UNSIGNED_TYPE #define LANG_HOOKS_UNSIGNED_TYPE gnat_unsigned_type -#undef LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE +#undef LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE #define LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE gnat_signed_or_unsigned_type const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER; @@ -377,7 +375,7 @@ internal_error_function (const char *msgid, va_list *ap) vsprintf (buffer, msgid, *ap); /* Go up to the first newline. */ - for (p = buffer; *p != 0; p++) + for (p = buffer; *p; p++) if (*p == '\n') { *p = '\0'; @@ -427,7 +425,7 @@ gnat_init (void) static void gnat_finish_incomplete_decl (tree dont_care ATTRIBUTE_UNUSED) { - gigi_abort (202); + abort (); } /* Compute the alignment of the largest mode that can be used for copying @@ -639,12 +637,23 @@ gnat_expand_expr (tree exp, rtx target, enum machine_mode tmode, /* ... fall through ... */ default: - gigi_abort (201); + abort (); } return expand_expr_real (new, target, tmode, modifier, alt_rtl); } +/* Generate the RTL for the body of GNU_DECL. */ + +static void +gnat_expand_body (tree gnu_decl) +{ + if (!DECL_INITIAL (gnu_decl) || DECL_INITIAL (gnu_decl) == error_mark_node) + return; + + tree_rest_of_compilation (gnu_decl, false); +} + /* Adjusts the RLI used to layout a record after all the fields have been added. We only handle the packed case and cause it to use the alignment that will pad the record at the end. */ @@ -724,13 +733,13 @@ static tree gnat_type_max_size (gnu_type) tree gnu_type; { - return max_size (TYPE_SIZE_UNIT (gnu_type), 1); + return max_size (TYPE_SIZE_UNIT (gnu_type), true); } /* GNU_TYPE is a type. Determine if it should be passed by reference by default. */ -int +bool default_pass_by_ref (tree gnu_type) { /* We pass aggregates by reference if they are sufficiently large. The @@ -747,7 +756,7 @@ default_pass_by_ref (tree gnu_type) return true; if (AGGREGATE_TYPE_P (gnu_type) - && (! host_integerp (TYPE_SIZE (gnu_type), 1) + && (!host_integerp (TYPE_SIZE (gnu_type), 1) || 0 < compare_tree_int (TYPE_SIZE (gnu_type), 8 * TYPE_ALIGN (gnu_type)))) return true; @@ -758,7 +767,7 @@ default_pass_by_ref (tree gnu_type) /* GNU_TYPE is the type of a subprogram parameter. Determine from the type if it should be passed by reference. */ -int +bool must_pass_by_ref (tree gnu_type) { /* We pass only unconstrained objects, those required by the language @@ -768,7 +777,7 @@ must_pass_by_ref (tree gnu_type) not have such objects. */ return (TREE_CODE (gnu_type) == UNCONSTRAINED_ARRAY_TYPE || (AGGREGATE_TYPE_P (gnu_type) && TYPE_BY_REFERENCE_P (gnu_type)) - || (TYPE_SIZE (gnu_type) != 0 + || (TYPE_SIZE (gnu_type) && TREE_CODE (TYPE_SIZE (gnu_type)) != INTEGER_CST)); } |
