[PATCH] remove signed(_or_unsigned)?_type langhooks

Rafael Espindola espindola@google.com
Fri Jun 1 14:43:00 GMT 2007


The attached patch removes both signed_type and
signed_or_unsigned_type langhook. I have already submitted a patch to
remove signed_type, so if someone wants to review one langhook at a
time, I can submit a patch that removes only signed_or_unsigned_type.

OK for trunk?

        * gcc/java/typeck.c (java_signed_type): Remove.
        * gcc/java/lang.c (LANG_HOOKS_SIGNED_TYPE): Remove.
        * gcc/java/java-tree.h (java_signed_type): Remove.

        * gcc/cp/cp-objcp-common.h (LANG_HOOKS_SIGNED_TYPE): Remove.
        (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Remove.

        * gcc/ada/trans.c (Attribute_to_gnu): Use
        signed_or_unsigned_type_for instead of get_signed_or_unsigned_type
        * gcc/ada/misc.c (LANG_HOOKS_SIGNED_TYPE): Remove.

        * gcc/fortran/trans-types.c (gfc_signed_type): Remove.
        * gcc/fortran/trans-types.h (gfc_signed_type): Remove.
        * gcc/fortran/f95-lang.c (LANG_HOOKS_SIGNED_TYPE): Remove.

        * gcc/treelang/treetree.c (tree_lang_signed_type): Remove.
        (LANG_HOOKS_SIGNED_TYPE): Remove.

        * gcc/tree.c (signed_or_unsigned_type_for): New.
        (unsigned_type_for): Use signed_or_unsigned_type_for.
        (signed_type_for): Use signed_or_unsigned_type_for.
        * gcc/tree.h (signed_or_unsigned_type_for): New.
        (get_signed_or_unsigned_type): Remove.
        * gcc/fold-const.c (fold_negate_expr): Use signed_type_for instead of
        lang_hooks.types.signed_type
        (size_diffop): Likewise.
        (all_ones_mask_p): Likewise.
        (build_range_check): Likewise.
        (fold_cond_expr_with_comparison): Likewise.
        (fold_cond_expr_with_comparison): Likewise.
        (unextend): Likewise.
        (extract_muldiv_1): Likewise.
        (fold_single_bit_test_into_sign_test): Likewise.
        (fold_binary): Likewise.
        (fold_ternary): Likewise.
        (operand_equal_for_comparison_p): Use signed_or_unsigned_type_for
        instead of get_signed_or_unsigned_type.
        * gcc/c-objc-common.h (LANG_HOOKS_SIGNED_TYPE): Remove.
        (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Remove.
        * gcc/expr.c (signed_or_unsigned_type_for): Use
        signed_or_unsigned_type_for instead of get_signed_or_unsigned_type.
        * gcc/langhooks.c (get_signed_or_unsigned_type): Remove.
        (lhd_signed_or_unsigned_type): Remove.
        * gcc/langhooks.h (lang_hooks_for_types): Remove signed_type and
        signed_or_unsigned_type.
        (lhd_signed_or_unsigned_type): Remove.
        * gcc/expmed.c (make_tree): Use signed_type_for instead of
        lang_hooks.types.signed_type.
        * gcc/c-common.c (same_scalar_type_ignoring_signedness): Use
        c_common_signed_type instead of lang_hooks.types.signed_type.
        * gcc/convert.c (convert_to_integer): Use signed_type_for instead of
        lang_hooks.types.signed_type.
        * gcc/langhooks-def.h (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Remove.
        (LANG_HOOK_FOR_TYPES_INITIALIZER): Remove LANG_HOOKS_SIGNED_TYPE and
        LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE.

-- 
Rafael Avila de Espindola

Google Ireland Ltd.
Gordon House
Barrow Street
Dublin 4
Ireland

Registered in Dublin, Ireland
Registration Number: 368047
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signed_or_unsigned.patch
Type: text/x-patch
Size: 20170 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070601/e03c3746/attachment.bin>


More information about the Gcc-patches mailing list