summaryrefslogtreecommitdiff
path: root/py/bc.h
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2020-09-11 17:22:28 +1000
committerDamien George <damien@micropython.org>2020-09-11 17:22:28 +1000
commit85f2b239d8ff8d29155c63799717e3f88b2f33f3 (patch)
treed1aabcdc58a741a98bfaaad048d208334a628302 /py/bc.h
parent50efce81740901fee6f5191db36a48ada13ef6df (diff)
py/showbc: Pass in an mp_print_t struct to all bytecode-print functions.
So the output can be redirected if needed. Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'py/bc.h')
-rw-r--r--py/bc.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/py/bc.h b/py/bc.h
index 0c19c5165..16f314e19 100644
--- a/py/bc.h
+++ b/py/bc.h
@@ -226,10 +226,10 @@ const byte *mp_decode_uint_skip(const byte *ptr);
mp_vm_return_kind_t mp_execute_bytecode(mp_code_state_t *code_state, volatile mp_obj_t inject_exc);
mp_code_state_t *mp_obj_fun_bc_prepare_codestate(mp_obj_t func, size_t n_args, size_t n_kw, const mp_obj_t *args);
void mp_setup_code_state(mp_code_state_t *code_state, size_t n_args, size_t n_kw, const mp_obj_t *args);
-void mp_bytecode_print(const void *descr, const byte *code, mp_uint_t len, const mp_uint_t *const_table);
-void mp_bytecode_print2(const byte *code, size_t len, const mp_uint_t *const_table);
-const byte *mp_bytecode_print_str(const byte *ip);
-#define mp_bytecode_print_inst(code, const_table) mp_bytecode_print2(code, 1, const_table)
+void mp_bytecode_print(const mp_print_t *print, const void *descr, const byte *code, mp_uint_t len, const mp_uint_t *const_table);
+void mp_bytecode_print2(const mp_print_t *print, const byte *code, size_t len, const mp_uint_t *const_table);
+const byte *mp_bytecode_print_str(const mp_print_t *print, const byte *ip);
+#define mp_bytecode_print_inst(print, code, const_table) mp_bytecode_print2(print, code, 1, const_table)
// Helper macros to access pointer with least significant bits holding flags
#define MP_TAGPTR_PTR(x) ((void *)((uintptr_t)(x) & ~((uintptr_t)3)))