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.
This commit is contained in:
Damien George 2014-05-12 23:11:14 +01:00
parent 97f9a2813e
commit 915197a8f9
3 changed files with 3 additions and 28 deletions

View File

@ -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
}

View File

@ -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);

View File

@ -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