aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-family/c-ada-spec.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c-family/c-ada-spec.c')
-rw-r--r--gcc/c-family/c-ada-spec.c34
1 files changed, 10 insertions, 24 deletions
diff --git a/gcc/c-family/c-ada-spec.c b/gcc/c-family/c-ada-spec.c
index fc21b62..a21bc49 100644
--- a/gcc/c-family/c-ada-spec.c
+++ b/gcc/c-family/c-ada-spec.c
@@ -29,21 +29,7 @@ along with GCC; see the file COPYING3. If not see
#include "cpplib.h"
#include "c-pragma.h"
#include "cpp-id-data.h"
-
-/* Adapted from hwint.h to use the Ada prefix. */
-#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
-# if HOST_BITS_PER_WIDE_INT == 64
-# define ADA_HOST_WIDE_INT_PRINT_DOUBLE_HEX \
- "16#%" HOST_LONG_FORMAT "x%016" HOST_LONG_FORMAT "x#"
-# else
-# define ADA_HOST_WIDE_INT_PRINT_DOUBLE_HEX \
- "16#%" HOST_LONG_FORMAT "x%08" HOST_LONG_FORMAT "x#"
-# endif
-#else
- /* We can assume that 'long long' is at least 64 bits. */
-# define ADA_HOST_WIDE_INT_PRINT_DOUBLE_HEX \
- "16#%" HOST_LONG_LONG_FORMAT "x%016" HOST_LONG_LONG_FORMAT "x#"
-#endif /* HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG */
+#include "wide-int.h"
/* Local functions, macros and variables. */
static int dump_generic_ada_node (pretty_printer *, tree, tree, int, int,
@@ -2211,19 +2197,19 @@ dump_generic_ada_node (pretty_printer *buffer, tree node, tree type, int spc,
pp_unsigned_wide_integer (buffer, tree_to_uhwi (node));
else
{
- tree val = node;
- unsigned HOST_WIDE_INT low = TREE_INT_CST_LOW (val);
- HOST_WIDE_INT high = TREE_INT_CST_HIGH (val);
-
- if (tree_int_cst_sgn (val) < 0)
+ wide_int val = node;
+ int i;
+ if (wi::neg_p (val))
{
pp_minus (buffer);
- high = ~high + !low;
- low = -low;
+ val = -val;
}
sprintf (pp_buffer (buffer)->digit_buffer,
- ADA_HOST_WIDE_INT_PRINT_DOUBLE_HEX,
- (unsigned HOST_WIDE_INT) high, low);
+ "16#%" HOST_WIDE_INT_PRINT "x",
+ val.elt (val.get_len () - 1));
+ for (i = val.get_len () - 2; i >= 0; i--)
+ sprintf (pp_buffer (buffer)->digit_buffer,
+ HOST_WIDE_INT_PRINT_PADDED_HEX, val.elt (i));
pp_string (buffer, pp_buffer (buffer)->digit_buffer);
}
break;