harec

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

commit 6f6cf46d0098afac20e5cae858129f2e53d6db68
parent 610034a3d7120a3bb79a9c7c97caec98d7caf3b5
Author: Drew DeVault <sir@cmpwn.com>
Date:   Thu, 31 Dec 2020 10:28:57 -0500

gen: restructure some TODOs a bit

Diffstat:
Msrc/gen.c | 12+++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/gen.c b/src/gen.c @@ -562,6 +562,7 @@ gen_expr_cast(struct gen_context *ctx, enum qbe_instr op; switch (to->storage) { + case TYPE_STORAGE_CHAR: case TYPE_STORAGE_U8: case TYPE_STORAGE_I8: case TYPE_STORAGE_I16: @@ -604,16 +605,21 @@ gen_expr_cast(struct gen_context *ctx, case TYPE_STORAGE_F32: case TYPE_STORAGE_F64: case TYPE_STORAGE_ALIAS: - case TYPE_STORAGE_STRING: case TYPE_STORAGE_TAGGED_UNION: case TYPE_STORAGE_ENUM: assert(0); // TODO + case TYPE_STORAGE_STRING: + assert(0); // TODO + case TYPE_STORAGE_POINTER: + if (to->pointer.referent->storage == TYPE_STORAGE_CHAR + && from->storage == TYPE_STORAGE_STRING) { + assert(0); // TODO + } + // Fallthrough // Can be implemented with a copy case TYPE_STORAGE_ARRAY: case TYPE_STORAGE_SLICE: - case TYPE_STORAGE_CHAR: case TYPE_STORAGE_NULL: - case TYPE_STORAGE_POINTER: pushi(ctx->current, &result, Q_COPY, &in, NULL); break; case TYPE_STORAGE_BOOL: