diff options
author | Damien <damien.p.george@gmail.com> | 2013-10-05 18:41:24 +0100 |
---|---|---|
committer | Damien <damien.p.george@gmail.com> | 2013-10-05 18:41:24 +0100 |
commit | 5bfb759980c3891a9401d877fb225770146c79df (patch) | |
tree | e83753f53e02c3b54b0cf7375da95b0532f5877e /py/compile.c | |
parent | 6cdd3af6014b28e0b3824641e6958c144b8e2cd2 (diff) | |
download | micropython-5bfb759980c3891a9401d877fb225770146c79df.tar.gz micropython-5bfb759980c3891a9401d877fb225770146c79df.zip |
Incorporate emit_thumb into new emit framework.
Diffstat (limited to 'py/compile.c')
-rw-r--r-- | py/compile.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/py/compile.c b/py/compile.c index f0d3934fd7..89a8d2bec5 100644 --- a/py/compile.c +++ b/py/compile.c @@ -30,6 +30,7 @@ typedef enum { #define EMIT_OPT_NONE (0) #define EMIT_OPT_BYTE_CODE (1) #define EMIT_OPT_NATIVE_PYTHON (2) +#define EMIT_OPT_ASM_THUMB (3) typedef struct _compiler_t { qstr qstr___class__; @@ -41,6 +42,7 @@ typedef struct _compiler_t { qstr qstr_assertion_error; qstr qstr_micropython; qstr qstr_native; + qstr qstr_asm_thumb; pass_kind_t pass; @@ -759,6 +761,8 @@ static bool compile_built_in_decorator(compiler_t *comp, int name_len, py_parse_ qstr attr = PY_PARSE_NODE_LEAF_ARG(name_nodes[1]); if (attr == comp->qstr_native) { *emit_options = EMIT_OPT_NATIVE_PYTHON; + } else if (attr == comp->qstr_asm_thumb) { + *emit_options = EMIT_OPT_ASM_THUMB; } else { printf("SyntaxError: invalid micropython decorator\n"); } @@ -2551,6 +2555,7 @@ void py_compile(py_parse_node_t pn) { comp->qstr_assertion_error = qstr_from_str_static("AssertionError"); comp->qstr_micropython = qstr_from_str_static("micropython"); comp->qstr_native = qstr_from_str_static("native"); + comp->qstr_asm_thumb = qstr_from_str_static("asm_thumb"); comp->max_num_labels = 0; comp->break_label = 0; @@ -2588,6 +2593,9 @@ void py_compile(py_parse_node_t pn) { comp->emit_method_table = &emit_x64_method_table; break; + //case EMIT_OPT_ASM_THUMB: + //if (em + default: if (emit_bc == NULL) { emit_bc = emit_bc_new(comp->max_num_labels); |