[PATCH][C/Ada] Streamline range type building and hashing
Richard Guenther
rguenther@suse.de
Mon Sep 20 14:14:00 GMT 2010
On Fri, 17 Sep 2010, Eric Botcazou wrote:
> > Sure. Another approach would be to introduce a build_nonshared_array_type
> > function and make that and build_array_type wrap a common worker with
> > a flag.
>
> Unsurprisingly we need the same treatment for range types as for array types.
> Here's the proposed patch, tested on i586-suse-linux, OK for mainline?
Ok.
Thanks,
RIchard.
>
> 2010-09-17 Eric Botcazou <ebotcazou@adacore.com>
>
> * langhooks.h (struct lang_hooks_for_types): Remove hash_types field.
> * langhooks-def.h (LANG_HOOKS_HASH_TYPES): Delete.
> (LANG_HOOKS_FOR_TYPES_INITIALIZER): Remove LANG_HOOKS_HASH_TYPES.
> * system.h (LANG_HOOKS_HASH_TYPES): Poison.
> * tree.c (type_hash_canon): Do not test lang_hooks.types.hash_types.
> (build_nonstandard_integer_type): Likewise.
> (build_range_type_1): New function, built from...
> (build_range_type): ...this. Call build_range_type_1.
> (build_nonshared_range_type): New function.
> (build_array_type_1): New function, built from...
> (build_array_type: ...this. Call build_array_type_1.
> (build_nonshared_array_type): New function.
> * tree.h (build_nonshared_range_type): Declare.
> (build_nonshared_array_type): Likewise.
> ada/
> * gcc-interface/decl.c (gnat_to_gnu_entity): Replace calls to
> build_array_type with calls to build_nonshared_array_type.
> (substitute_in_type): Likewise.
> * gcc-interface/misc.c (LANG_HOOKS_HASH_TYPES): Delete.
> (LANG_HOOKS_TYPE_HASH_EQ): Define.
> (gnat_post_options): Add 'static' keyword.
> (gnat_type_hash_eq): New static function.
> * gcc-interface/utils.c (fntype_same_flags_p): New function.
> (create_subprog_type): Call it.
> (create_index_type): Call build_nonshared_range_type and tidy up.
> (create_range_type): Likewise.
> * gcc-interface/gigi.h (fntype_same_flags_p): Declare.
>
>
>
--
Richard Guenther <rguenther@suse.de>
Novell / SUSE Labs
SUSE LINUX Products GmbH - Nuernberg - AG Nuernberg - HRB 16746 - GF: Markus Rex
More information about the Gcc-patches
mailing list