harec

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

commit 4eaab72f2940c1e67270fec8db73eac550e49004
parent b84f6ea88d837435b305413569acea4314c600d2
Author: Drew DeVault <sir@cmpwn.com>
Date:   Fri,  2 Jul 2021 10:22:46 -0400

gen: tweak size constants for future arch work

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

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

diff --git a/src/gen.c b/src/gen.c @@ -130,8 +130,6 @@ gen_expr_constant(struct gen_context *ctx, break; case STORAGE_I64: case STORAGE_U64: - case STORAGE_SIZE: - case STORAGE_UINTPTR: constl(&qval, constexpr->uval); break; case STORAGE_F32: @@ -140,6 +138,16 @@ gen_expr_constant(struct gen_context *ctx, case STORAGE_F64: constd(&qval, constexpr->fval); break; + case STORAGE_SIZE: + switch (ctx->arch.sz->size) { + case 8: + constl(&qval, constexpr->uval); + break; + default: + abort(); + } + break; + case STORAGE_UINTPTR: case STORAGE_POINTER: case STORAGE_ARRAY: case STORAGE_NULL: