diff options
author | Damien George <damien.p.george@gmail.com> | 2019-03-07 22:46:04 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2019-03-08 15:53:04 +1100 |
commit | 01a1f31f67ff6c9b6b1539783a8109dc380992fb (patch) | |
tree | 928a825ee2a08cc82523916fc27a753eb74c3d80 /py/compile.c | |
parent | 02cc288edbc47a3b21b88b83f15990cc5a36ed23 (diff) |
py/emitnative: Consolidate where HASCONSTS is set to load-const-obj fun.
Simplifies the code and fixes handling of the Ellipsis const in native code
generation (which also needs the constant table so must set this flag).
Diffstat (limited to 'py/compile.c')
-rw-r--r-- | py/compile.c | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/py/compile.c b/py/compile.c index b7f1d7b0c..4609a5021 100644 --- a/py/compile.c +++ b/py/compile.c @@ -2693,9 +2693,6 @@ STATIC mp_obj_t get_const_object(mp_parse_node_struct_t *pns) { } STATIC void compile_const_object(compiler_t *comp, mp_parse_node_struct_t *pns) { - #if MICROPY_EMIT_NATIVE - comp->scope_cur->scope_flags |= MP_SCOPE_FLAG_HASCONSTS; - #endif EMIT_ARG(load_const_obj, get_const_object(pns)); } @@ -2730,9 +2727,6 @@ STATIC void compile_node(compiler_t *comp, mp_parse_node_t pn) { } else { EMIT_ARG(load_const_obj, mp_obj_new_int_from_ll(arg)); } - #if MICROPY_EMIT_NATIVE - comp->scope_cur->scope_flags |= MP_SCOPE_FLAG_HASCONSTS; - #endif } #else EMIT_ARG(load_const_small_int, arg); @@ -2751,9 +2745,6 @@ STATIC void compile_node(compiler_t *comp, mp_parse_node_t pn) { const byte *data = qstr_data(arg, &len); EMIT_ARG(load_const_obj, mp_obj_new_bytes(data, len)); } - #if MICROPY_EMIT_NATIVE - comp->scope_cur->scope_flags |= MP_SCOPE_FLAG_HASCONSTS; - #endif break; case MP_PARSE_NODE_TOKEN: default: if (arg == MP_TOKEN_NEWLINE) { |