8000 py/emitglue: Move typedef of mp_raw_code_t from .c to .h file. · micropython/micropython@6d24dc2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6d24dc2

Browse files
committed
py/emitglue: Move typedef of mp_raw_code_t from .c to .h file.
It's needed by frozen bytecode.
1 parent c2a519b commit 6d24dc2

File tree

2 files changed

+21
-23
lines changed

2 files changed

+21
-23
lines changed

py/emitglue.c

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -49,28 +49,6 @@
4949
mp_uint_t mp_verbose_flag = 0;
5050
#endif
5151

52-
struct _mp_raw_code_t {
53-
mp_raw_code_kind_t kind : 3;
54-
mp_uint_t scope_flags : 7;
55-
mp_uint_t n_pos_args : 11;
56-
union {
57-
struct {
58-
const byte *bytecode;
59-
const mp_uint_t *const_table;
60-
#if MICROPY_PERSISTENT_CODE_SAVE
61-
mp_uint_t bc_len;
8000 62-
uint16_t n_obj;
63-
uint16_t n_raw_code;
64-
#endif
65-
} u_byte;
66-
struct {
67-
void *fun_data;
68-
const mp_uint_t *const_table;
69-
mp_uint_t type_sig; // for viper, compressed as 2-bit types; ret is MSB, then arg0, arg1, etc
70-
} u_native;
71-
} data;
72-
};
73-
7452
mp_raw_code_t *mp_emit_glue_new_raw_code(void) {
7553
mp_raw_code_t *rc = m_new0(mp_raw_code_t, 1);
7654
rc->kind = MP_CODE_RESERVED;

py/emitglue.h

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,27 @@ typedef enum {
3939
MP_CODE_NATIVE_ASM,
4040
} mp_raw_code_kind_t;
4141

42-
typedef struct _mp_raw_code_t mp_raw_code_t;
42+
typedef struct _mp_raw_code_t {
43+
mp_raw_code_kind_t kind : 3;
44+
mp_uint_t scope_flags : 7;
45+
mp_uint_t n_pos_args : 11;
46+
union {
47+
struct {
48+
const byte *bytecode;
49+
const mp_uint_t *const_table;
50+
#if MICROPY_PERSISTENT_CODE_SAVE
51+
mp_uint_t bc_len;
52+
uint16_t n_obj;
53+
uint16_t n_raw_code;
54+
#endif
55+
} u_byte;
56+
struct {
57+
void *fun_data;
58+
const mp_uint_t *const_table;
59+
mp_uint_t type_sig; // for viper, compressed as 2-bit types; ret is MSB, then arg0, arg1, etc
60+
} u_native;
61+
} data;
62+
} mp_raw_code_t;
4363

4464
mp_raw_code_t *mp_emit_glue_new_raw_code(void);
4565

0 commit comments

Comments
 (0)
0