harec

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 4b2ce356d1f6c195a578ee13733a08f23cbd451e
parent 09174ff3024cdf55c1c8b0bb277b154c214e1818
Author: Drew DeVault <sir@cmpwn.com>
Date:   Sun,  3 Oct 2021 10:25:13 +0200

gen: update type enums to uint

Signed-off-by: Drew DeVault <sir@cmpwn.com>

Diffstat:
Msrc/gen.c | 9+++------
Mtypes/reflect.ha | 6+++---
2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/src/gen.c b/src/gen.c @@ -3316,12 +3316,11 @@ gen_type_info(struct gen_context *ctx, item->type = QD_VALUE; item->value = constw(type->flags); - item->value.type = &qbe_byte; item->next = xcalloc(1, sizeof(struct qbe_data_item)); item = item->next; item->type = QD_ZEROED; - item->zeroed = 7; + item->zeroed = 4; item->next = xcalloc(1, sizeof(struct qbe_data_item)); item = item->next; @@ -3420,12 +3419,11 @@ gen_type_info(struct gen_context *ctx, item->type = QD_VALUE; item->value = constw(type->_enum.storage); - item->value.type = &qbe_byte; item->next = xcalloc(1, sizeof(struct qbe_data_item)); item = item->next; item->type = QD_ZEROED; - item->zeroed = 7; + item->zeroed = 4; item->next = xcalloc(1, sizeof(struct qbe_data_item)); item = item->next; @@ -3630,12 +3628,11 @@ gen_type_info(struct gen_context *ctx, item->type = QD_VALUE; item->value = constw(type->storage == STORAGE_STRUCT ? 0 : 1); - item->value.type = &qbe_byte; item->next = xcalloc(1, sizeof(struct qbe_data_item)); item = item->next; item->type = QD_ZEROED; - item->zeroed = 7; + item->zeroed = 4; item->next = xcalloc(1, sizeof(struct qbe_data_item)); item = item->next; diff --git a/types/reflect.ha b/types/reflect.ha @@ -27,7 +27,7 @@ export fn unwrap(in: type) *typeinfo = { }; // Type flags. -export type flags = enum u8 { +export type flags = enum uint { NONE = 0, CONST = 1 << 0, ERROR = 1 << 1, @@ -51,7 +51,7 @@ export type array = struct { }; // A built-in type. -export type builtin = enum u8 { +export type builtin = enum uint { BOOL, CHAR, ENUM, F32, F64, I16, I32, I64, I8, INT, NULL, RUNE, SIZE, STR, U16, U32, U64, U8, UINT, UINTPTR, VOID, TYPE, }; @@ -83,7 +83,7 @@ export type func = struct { }; // Flags which apply to a pointer type. -export type pointer_flags = enum u8 { +export type pointer_flags = enum uint { NONE = 0, NULLABLE = 1 << 0, };