aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.h
diff options
context:
space:
mode:
authorJ"orn Rennecke <amylaar@cygnus.co.uk>1998-02-01 11:47:59 +0000
committerJeff Law <law@gcc.gnu.org>1998-02-01 04:47:59 -0700
commitf8dac6eb3f71d5810ff9c8b417d52e0d0a76fe3d (patch)
treee4c4d0cc8bf232b7a9de28f0621b20029848ddd8 /gcc/tree.h
parentf5426d1e9b4208ebbdd9cdc4c613f7fda9bc98ed (diff)
downloadgcc-f8dac6eb3f71d5810ff9c8b417d52e0d0a76fe3d.zip
gcc-f8dac6eb3f71d5810ff9c8b417d52e0d0a76fe3d.tar.gz
gcc-f8dac6eb3f71d5810ff9c8b417d52e0d0a76fe3d.tar.bz2
expr.c (get_inner_reference): Use sbitsizetype for type sizes.
* expr.c (get_inner_reference): Use sbitsizetype for type sizes. * fold-const.c (size_int): Replace with (size_int_wide). (make_bit_field_ref): Use bitsize_int for bit position. * stor-layout.c (sizetype): Delete. (sizetype_tab, sbitsizetype, ubitsizetype): Declare. (layout_record, layout_union, layout_type): Use bitsize_int for bit size. (set_sizetype): New function. (make_signed_type, make_unsigned_type): Use it. * c-decl.c (init_decl_processing): Likewise. * tree.h (size_int): Don't delcare, #define. (size_int_wide, sizetype_tab, sbitsize, ubitsize): Declare. (set_sizetype): Declare. (bitsize_int, size_int_2, BITS_PER_UNIT_LOG, sizetype, bitsizetype): Define. * c-typeck.c (c_sizeof, c_sizeof_nowarn, c_size_in_bytes): Convert result to sizetype. (really_start_incremental_init, push_init_level): Set type of constructor_bit_index to sbitsizetype. (push_init_level): Use unsigned arithmetic to determine padding. (output_init_element): Likewise. From-SVN: r17577
Diffstat (limited to 'gcc/tree.h')
-rw-r--r--gcc/tree.h21
1 files changed, 18 insertions, 3 deletions
diff --git a/gcc/tree.h b/gcc/tree.h
index 6a5f5e2..093304a 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -1,5 +1,5 @@
/* Front-end tree definitions for GNU compiler.
- Copyright (C) 1989, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1989, 93-97, 1998 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -1295,6 +1295,7 @@ extern tree build_block PROTO((tree, tree, tree, tree, tree));
extern tree make_signed_type PROTO((int));
extern tree make_unsigned_type PROTO((int));
+extern void set_sizetype PROTO((tree));
extern tree signed_or_unsigned_type PROTO((int, tree));
extern void fixup_unsigned_type PROTO((tree));
extern tree build_pointer_type PROTO((tree));
@@ -1398,14 +1399,28 @@ extern tree convert PROTO((tree, tree));
extern tree size_in_bytes PROTO((tree));
extern int int_size_in_bytes PROTO((tree));
extern tree size_binop PROTO((enum tree_code, tree, tree));
-extern tree size_int PROTO((unsigned HOST_WIDE_INT));
+extern tree size_int_wide PROTO((unsigned HOST_WIDE_INT,
+ unsigned HOST_WIDE_INT, int));
+#define size_int(L) size_int_2 ((L), 0, 0)
+#define bitsize_int(L, H) size_int_2 ((L), (H), 1)
+#define size_int_2(L, H, T) \
+ size_int_wide ((unsigned HOST_WIDE_INT) (L), \
+ (unsigned HOST_WIDE_INT) (H), (T))
+
extern tree round_up PROTO((tree, int));
extern tree get_pending_sizes PROTO((void));
extern void put_pending_sizes PROTO((tree));
/* Type for sizes of data-type. */
-extern tree sizetype;
+#define BITS_PER_UNIT_LOG \
+ ((BITS_PER_UNIT > 1) + (BITS_PER_UNIT > 2) + (BITS_PER_UNIT > 4) \
+ + (BITS_PER_UNIT > 8) + (BITS_PER_UNIT > 16) + (BITS_PER_UNIT > 32) \
+ + (BITS_PER_UNIT > 64) + (BITS_PER_UNIT > 128) + (BITS_PER_UNIT > 256))
+
+extern tree sizetype_tab[2], sbitsizetype, ubitsizetype;
+#define sizetype sizetype_tab[0]
+#define bitsizetype sizetype_tab[1]
/* If nonzero, an upper limit on alignment of structure fields, in bits. */
extern int maximum_field_alignment;