aboutsummaryrefslogtreecommitdiff
path: root/py/mpstate.h
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2019-08-23 11:20:50 +1000
committerDamien George <damien.p.george@gmail.com>2019-08-28 12:47:58 +1000
commitaf20c2ead3e9bb397fdf89e316aa78b56f165013 (patch)
tree99cc8c752d6347dc9f0d6dccb6e11384626bd278 /py/mpstate.h
parent8e3e05761e1143a2502c7eca07c1b22bac192c84 (diff)
py: Add global default_emit_opt variable to make emit kind persistent.
mp_compile no longer takes an emit_opt argument, rather this setting is now provided by the global default_emit_opt variable. Now, when -X emit=native is passed as a command-line option, the emitter will be set for all compiled modules (included imports), not just the top-level script. In the future there could be a way to also set this variable from a script. Fixes issue #4267.
Diffstat (limited to 'py/mpstate.h')
-rw-r--r--py/mpstate.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/py/mpstate.h b/py/mpstate.h
index 1057cef04..83fea3eb4 100644
--- a/py/mpstate.h
+++ b/py/mpstate.h
@@ -205,6 +205,9 @@ typedef struct _mp_state_vm_t {
#if MICROPY_ENABLE_COMPILER
mp_uint_t mp_optimise_value;
+ #if MICROPY_EMIT_NATIVE
+ uint8_t default_emit_opt; // one of MP_EMIT_OPT_xxx
+ #endif
#endif
// size of the emergency exception buf, if it's dynamically allocated