From bdc7833b8366f2db9de55de45ca6cf11861ae8ab Mon Sep 17 00:00:00 2001 From: Christoffer Lerno Date: Fri, 2 Sep 2022 09:58:43 +0200 Subject: [PATCH] Inline asm first checkin. --- src/compiler/asm_target.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/compiler/asm_target.c b/src/compiler/asm_target.c index e558b462d..c506e48da 100644 --- a/src/compiler/asm_target.c +++ b/src/compiler/asm_target.c @@ -6,6 +6,8 @@ #define ASM_PTR_HASH(name__) (uint32_t)(((uintptr_t)name__ >> 9) ^ ((uintptr_t)name__ >> 1)) +const Clobbers NO_CLOBBER = {}; + INLINE AsmInstruction *insert_instruction_named(const char *name) { TokenType token_type = TOKEN_IDENT; @@ -26,7 +28,7 @@ INLINE AsmInstruction *insert_instruction_named(const char *name) } -INLINE void reg_instr_clob(const char *name, Clobbers mask, ...) +static inline void reg_instr_clob(const char *name, Clobbers mask, ...) { AsmInstruction *instr = insert_instruction_named(name); instr->mask = mask; @@ -44,10 +46,10 @@ INLINE void reg_instr_clob(const char *name, Clobbers mask, ...) instr->param_count = param_count; } -INLINE void reg_instr(const char *name, ...) +static inline void reg_instr(const char *name, ...) { AsmInstruction *instr = insert_instruction_named(name); - instr->mask = (Clobbers) { .mask[0] = 0 }; + instr->mask = NO_CLOBBER; va_list list; va_start(list, name); int param_count = 0;