Commit 915197a8 authored by Damien George's avatar Damien George
Browse files

py: Remove emit_glue init and deinit. Needed only for debugging.

Debugging output for emit_glue now simplified so that the init and
deinit functions are no longer needed.
parent 97f9a281
......@@ -49,24 +49,6 @@
#define DEBUG_OP_printf(...) (void)0
#endif
#ifdef WRITE_CODE
FILE *fp_write_code = NULL;
#endif
void mp_emit_glue_init(void) {
#ifdef WRITE_CODE
fp_write_code = fopen("out-code", "wb");
#endif
}
void mp_emit_glue_deinit(void) {
#ifdef WRITE_CODE
if (fp_write_code != NULL) {
fclose(fp_write_code);
}
#endif
}
mp_raw_code_t *mp_emit_glue_new_raw_code(void) {
mp_raw_code_t *rc = m_new0(mp_raw_code_t, 1);
rc->kind = MP_CODE_RESERVED;
......@@ -123,10 +105,9 @@ void mp_emit_glue_assign_native(mp_raw_code_t *rc, mp_raw_code_kind_t kind, void
DEBUG_printf("\n");
#ifdef WRITE_CODE
if (fp_write_code != NULL) {
fwrite(fun_data, len, 1, fp_write_code);
fflush(fp_write_code);
}
FILE *fp_write_code = fopen("out-code", "wb");
fwrite(fun_data, len, 1, fp_write_code);
fclose(fp_write_code);
#endif
#endif
}
......
......@@ -52,9 +52,6 @@ typedef struct _mp_code_t {
};
} mp_raw_code_t;
void mp_emit_glue_init(void);
void mp_emit_glue_deinit(void);
mp_raw_code_t *mp_emit_glue_new_raw_code(void);
void mp_emit_glue_assign_bytecode(mp_raw_code_t *rc, byte *code, uint len, uint n_pos_args, uint n_kwonly_args, qstr *arg_names, uint scope_flags);
......
......@@ -77,8 +77,6 @@ void mp_init(void) {
// __debug__ enabled by default
mp_set_debug(true);
mp_emit_glue_init();
// init global module stuff
mp_module_init();
......@@ -93,7 +91,6 @@ void mp_init(void) {
void mp_deinit(void) {
//mp_obj_dict_free(&dict_main);
mp_module_deinit();
mp_emit_glue_deinit();
// call port specific deinitialization if any
#ifdef MICROPY_PORT_INIT_FUNC
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment