Skip to content

Commit 0496de2

Browse files
committed
py: Allow to enable inline assembler without native emitter.
1 parent f22be4e commit 0496de2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

py/compile.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ typedef enum {
5858
#define EMIT_ARG(fun, ...) (comp->emit_method_table->fun(comp->emit, __VA_ARGS__))
5959
#define EMIT_LOAD_FAST(qst, local_num) (comp->emit_method_table->load_id.fast(comp->emit, qst, local_num))
6060
#define EMIT_LOAD_GLOBAL(qst) (comp->emit_method_table->load_id.global(comp->emit, qst))
61-
#define EMIT_INLINE_ASM(fun) (comp->emit_inline_asm_method_table->fun(comp->emit_inline_asm))
62-
#define EMIT_INLINE_ASM_ARG(fun, ...) (comp->emit_inline_asm_method_table->fun(comp->emit_inline_asm, __VA_ARGS__))
6361

6462
#else
6563

@@ -71,6 +69,9 @@ typedef enum {
7169

7270
#endif
7371

72+
#define EMIT_INLINE_ASM(fun) (comp->emit_inline_asm_method_table->fun(comp->emit_inline_asm))
73+
#define EMIT_INLINE_ASM_ARG(fun, ...) (comp->emit_inline_asm_method_table->fun(comp->emit_inline_asm, __VA_ARGS__))
74+
7475
// elements in this struct are ordered to make it compact
7576
typedef struct _compiler_t {
7677
qstr source_file;
@@ -3386,7 +3387,6 @@ mp_obj_t mp_compile(mp_parse_tree_t *parse_tree, qstr source_file, uint emit_opt
33863387
emit_inline_thumb = emit_inline_thumb_new(max_num_labels);
33873388
}
33883389
comp->emit = NULL;
3389-
comp->emit_method_table = NULL;
33903390
comp->emit_inline_asm = emit_inline_thumb;
33913391
comp->emit_inline_asm_method_table = &emit_inline_thumb_method_table;
33923392
compile_scope_inline_asm(comp, s, MP_PASS_CODE_SIZE);

0 commit comments

Comments
 (0)