From 47ecd38dbf87d87f64c3db3a9fd2c716e63b6ca7 Mon Sep 17 00:00:00 2001 From: Rafael Avila de Espindola Date: Fri, 30 Mar 2007 22:09:01 +0000 Subject: typeck.c (java_signed_or_unsigned_type): Remove. gcc/java/ChangeLog: * typeck.c (java_signed_or_unsigned_type): Remove. (java_signed_type): use get_signed_or_unsigned_type instead of java_signed_or_unsigned_type. (java_unsigned_type): Ditto. * lang.c (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Remove. * java-tree.h (java_signed_or_unsigned_type): Remove gcc/Changelog: * tree.h(get_signed_or_unsigned_type): New * fold-const.c (operand_equal_for_comparison_p): Use get_signed_or_unsigned_type instead of lang_hooks.types.signed_or_unsigned_type. * expr.c (store_expr): Ditto. * langhooks.c (get_signed_or_unsigned_type): New. (lhd_signed_or_unsigned_type): New * langhooks.h (lhd_signed_or_unsigned_type): New. * langhooks-def.h (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Define. gcc/treelang/ChangeLog: * treetree.c (tree_lang_signed_or_unsigned_type): Remove. (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE) Remove. gcc/ada/ChangeLog: * trans.c (Attribute_to_gnu): Use get_signed_or_unsigned_type instead of gnat_signed_or_unsigned_type. * utils.c (gnat_signed_or_unsigned_type): Remove. * misc.c (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Remove * gigi.h (gnat_signed_or_unsigned_type): Remove gcc/forrtan/trans-types.c: * trans-types.c (gfc_signed_or_unsigned_type): Remove. (gfc_unsigned_type): Use get_signed_or_unsigned_type instead of gfc_signed_or_unsigned_type. (gfc_signed_type): Ditto. * trans-types.h (gfc_signed_or_unsigned_type): Remove. * f95-lang.c (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Remove. From-SVN: r123373 --- gcc/langhooks.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'gcc/langhooks.c') diff --git a/gcc/langhooks.c b/gcc/langhooks.c index 9a33bca..1ba6ec2 100644 --- a/gcc/langhooks.c +++ b/gcc/langhooks.c @@ -621,3 +621,24 @@ lhd_builtin_function (tree decl) lang_hooks.decls.pushdecl (decl); return decl; } + +/* If TYPE is an integral type, return an equivalent type which is + unsigned iff UNSIGNEDP is true. If TYPE is not an integral type, + return TYPE itself. */ + +tree +get_signed_or_unsigned_type (int unsignedp, tree type) +{ + if (!INTEGRAL_TYPE_P (type) || TYPE_UNSIGNED (type) == unsignedp) + return type; + + return lang_hooks.types.signed_or_unsigned_type(unsignedp, type); +} + +/* Default implementation of the signed_or_unsigned_type language hook */ + +tree +lhd_signed_or_unsigned_type (int unsignedp, tree type) +{ + return lang_hooks.types.type_for_size (TYPE_PRECISION (type), unsignedp); +} -- cgit v1.1