]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Remove tree_fits_hwi_p and the 2-argument tree_to_hwi.
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 19 Nov 2013 07:40:38 +0000 (07:40 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 19 Nov 2013 07:40:38 +0000 (07:40 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/wide-int@205006 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/c-family/c-common.c
gcc/doc/generic.texi
gcc/tree.h

index f330fc5d92db15ce244476ec049d92ba9432cb6f..b8db750b60a85ae1577fc7aa7527be99a80936c2 100644 (file)
@@ -6056,8 +6056,10 @@ match_case_to_enum_1 (tree key, tree type, tree label)
 {
   char buf[WIDE_INT_PRINT_BUFFER_SIZE];
 
-  if (tree_fits_hwi_p (key, TYPE_SIGN (type)))
-    print_dec (key, buf, TYPE_SIGN (type));
+  if (tree_fits_uhwi_p (key))
+    print_dec (key, buf, UNSIGNED);
+  else if (tree_fits_shwi_p (key))
+    print_dec (key, buf, SIGNED);
   else
     print_hex (key, buf);
 
index ea5e81ad87f314b7fe79087241ed54416bd6aaf2..642aee87d913a43f663267a7b22445aab7cac3bf 100644 (file)
@@ -1024,10 +1024,8 @@ As this example indicates, the operands are zero-indexed.
 @tindex INTEGER_CST
 @tindex tree_fits_uhwi_p
 @tindex tree_fits_shwi_p
-@tindex tree_fits_hwi_p
 @tindex tree_to_uhwi
 @tindex tree_to_shwi
-@tindex tree_to_hwi
 @tindex REAL_CST
 @tindex FIXED_CST
 @tindex COMPLEX_CST
@@ -1050,16 +1048,11 @@ represented in an array of HOST_WIDE_INT.   There are enough elements
 in the array to represent the value without taking extra elements for
 redundant 0s or -1.
 
-The functions @code{tree_fits_uhwi_p}, @code{tree_fits_shwi_p}, and
-@code{tree_fits_hwi_p} can be used to tell if the value is small
-enough to fit in a HOST_WIDE_INT, as either a signed value, an unsiged
-value or a value whose sign is given as a parameter.  The value can
-then be extracted using the @code{tree_to_uhwi}, @code{tree_to_shwi},
-or @code{tree_to_hwi}.  The @code{tree_to_hwi} comes in both checked
-and unchecked flavors.  However, when the value is used in a context
-where it may represent a value that is larger than can be represented
-in HOST_BITS_PER_WIDE_INT bits, the wide_int class should be used to
-manipulate the constant.
+The functions @code{tree_fits_shwi_p} and @code{tree_fits_uhwi_p}
+can be used to tell if the value is small enough to fit in a
+signed HOST_WIDE_INT or an unsigned HOST_WIDE_INT respectively.
+The value can then be extracted using @code{tree_to_shwi} and
+@code{tree_to_uhwi}.
 
 @item REAL_CST
 
index f89bc2719593e2bc925edaca775972d2a1c4de75..7045f10411ca10fc26951052c5bebcb9fda3656a 100644 (file)
@@ -3754,50 +3754,6 @@ extern tree excess_precision_type (tree);
 extern bool valid_constant_size_p (const_tree);
 extern unsigned int element_precision (const_tree);
 
-/* Return true if T is an INTEGER_CST that can be manipulated
-   efficiently on the host.  If SIGN is SIGNED, the value can be
-   represented in a single HOST_WIDE_INT.  If SIGN is UNSIGNED, the
-   value must be non-negative and can be represented in a single
-   unsigned HOST_WIDE_INT.  */
-
-static inline bool
-tree_fits_hwi_p (const_tree cst, signop sign)
-{
-  return sign ? tree_fits_uhwi_p (cst) : tree_fits_shwi_p (cst);
-}
-
-/* Return true if T is an INTEGER_CST that can be manipulated
-   efficiently on the host.  If the sign of CST is SIGNED, the value
-   can be represented in a single HOST_WIDE_INT.  If the sign of CST
-   is UNSIGNED, the value must be non-negative and can be represented
-   in a single unsigned HOST_WIDE_INT.  */
-
-static inline bool
-tree_fits_hwi_p (const_tree cst)
-{
-  if (cst == NULL_TREE)
-    return false;
-
-  if (TREE_CODE (cst) != INTEGER_CST)
-    return false;
-
-  return TYPE_UNSIGNED (TREE_TYPE (cst)) 
-    ? tree_fits_uhwi_p (cst) : tree_fits_shwi_p (cst);
-}
-
-/* Return the HOST_WIDE_INT least significant bits of CST.  The sign
-   of the checking is based on SIGNOP. */
-
-static inline HOST_WIDE_INT
-tree_to_hwi (const_tree cst, signop sgn)
-{
-  if (sgn == SIGNED)
-    return tree_to_shwi (cst);
-  else
-    return tree_to_uhwi (cst);
-}
-
-
 /* Construct various nodes representing fract or accum data types.  */
 
 extern tree make_fract_type (int, int, int);