diff options
author | Richard Stallman <rms@gnu.org> | 1992-09-09 06:28:36 +0000 |
---|---|---|
committer | Richard Stallman <rms@gnu.org> | 1992-09-09 06:28:36 +0000 |
commit | 4cc89e5371c492beefa5b243a95193ce3e77f390 (patch) | |
tree | 288a731b18e88f043fed3b8f4e768427a2c07e6e /gcc | |
parent | 15a5b8a22ae6091ce9a3ff5431580d39cdc180d6 (diff) | |
download | gcc-4cc89e5371c492beefa5b243a95193ce3e77f390.tar.gz |
(layout_type): Caller must give size of FILE_TYPE.
(layout_type): Handle BOOLEAN_TYPE, CHAR_TYPE, FILE_TYPE for Pascal.
(fixup_signed_type): New function.
From-SVN: r2080
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/stor-layout.c | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index b2e330324ea..e2808020414 100644 --- a/gcc/stor-layout.c +++ b/gcc/stor-layout.c @@ -837,6 +837,28 @@ layout_type (type) } break; + /* Pascal types */ + case BOOLEAN_TYPE: /* store one byte/boolean for now. */ + TYPE_MODE (type) = QImode; + TYPE_SIZE (type) = size_int (GET_MODE_BITSIZE (TYPE_MODE (type))); + TYPE_PRECISION (type) = 1; + TYPE_ALIGN (type) = GET_MODE_ALIGNMENT (TYPE_MODE (type)); + break; + + case CHAR_TYPE: + TYPE_MODE (type) = QImode; + TYPE_SIZE (type) = size_int (GET_MODE_BITSIZE (TYPE_MODE (type))); + TYPE_PRECISION (type) = GET_MODE_BITSIZE (TYPE_MODE (type)); + TYPE_ALIGN (type) = GET_MODE_ALIGNMENT (TYPE_MODE (type)); + break; + + case FILE_TYPE: + /* The size may vary in different languages, so the language front end + should fill in the size. */ + TYPE_ALIGN (type) = BIGGEST_ALIGNMENT; + TYPE_MODE (type) = BLKmode; + break; + default: abort (); } /* end switch */ @@ -951,6 +973,36 @@ make_unsigned_type (precision) } /* Set the extreme values of TYPE based on its precision in bits, + the lay it out. Used when make_signed_type won't do + because the tree code is not INTEGER_TYPE. + E.g. for Pascal, when the -fsigned-char option is given. */ + +void +fixup_signed_type (type) + tree type; +{ + register int precision = TYPE_PRECISION (type); + + TYPE_MIN_VALUE (type) + = build_int_2 ((precision-BITS_PER_WORD > 0 ? 0 : (-1)<<(precision-1)), + (-1)<<(precision-BITS_PER_WORD-1 > 0 + ? precision-BITS_PER_WORD-1 + : 0)); + TYPE_MAX_VALUE (type) + = build_int_2 ((precision-BITS_PER_WORD > 0 ? -1 : (1<<(precision-1))-1), + (precision-BITS_PER_WORD-1 > 0 + ? (1<<(precision-BITS_PER_WORD-1))-1 + : 0)); + + TREE_TYPE (TYPE_MIN_VALUE (type)) = type; + TREE_TYPE (TYPE_MAX_VALUE (type)) = type; + + /* Lay out the type: set its alignment, size, etc. */ + + layout_type (type); +} + +/* Set the extreme values of TYPE based on its precision in bits, the lay it out. This is used both in `make_unsigned_type' and for enumeral types. */ |