harec

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

commit e2627649a594d353f51c460bf87129853124b72d
parent bc94ad21d938bd7616eccc0021cfafb8af4cc099
Author: Drew DeVault <sir@cmpwn.com>
Date:   Sun,  4 Jul 2021 11:43:45 -0400

gen: rearrange gen_copy for greater readability

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

Diffstat:
Msrc/gen.c | 44++++++++++++++++++++++----------------------
1 file changed, 22 insertions(+), 22 deletions(-)

diff --git a/src/gen.c b/src/gen.c @@ -246,28 +246,6 @@ gen_copy(struct gen_context *ctx, const struct type *dtype = type_dealias(dest->type); assert(dtype == type_dealias(src->type)); switch (dtype->storage) { - case STORAGE_BOOL: - case STORAGE_CHAR: - case STORAGE_ENUM: - case STORAGE_F32: - case STORAGE_F64: - case STORAGE_I16: - case STORAGE_I32: - case STORAGE_I64: - case STORAGE_I8: - case STORAGE_INT: - case STORAGE_NULL: - case STORAGE_RUNE: - case STORAGE_SIZE: - case STORAGE_U16: - case STORAGE_U32: - case STORAGE_U64: - case STORAGE_U8: - case STORAGE_UINT: - case STORAGE_UINTPTR: - case STORAGE_POINTER: - // Implemented below - break; case STORAGE_ARRAY: gen_copy_array(ctx, dest, src); return; @@ -290,6 +268,28 @@ gen_copy(struct gen_context *ctx, case STORAGE_ICONST: case STORAGE_VOID: abort(); // Invariant + case STORAGE_BOOL: + case STORAGE_CHAR: + case STORAGE_ENUM: + case STORAGE_F32: + case STORAGE_F64: + case STORAGE_I16: + case STORAGE_I32: + case STORAGE_I64: + case STORAGE_I8: + case STORAGE_INT: + case STORAGE_NULL: + case STORAGE_RUNE: + case STORAGE_SIZE: + case STORAGE_U16: + case STORAGE_U32: + case STORAGE_U64: + case STORAGE_U8: + case STORAGE_UINT: + case STORAGE_UINTPTR: + case STORAGE_POINTER: + // Implemented below + break; } // Copy between types which have a native qbe representation