diff options
| author | Damien George <damien.p.george@gmail.com> | 2014-04-20 18:02:27 +0100 | 
|---|---|---|
| committer | Damien George <damien.p.george@gmail.com> | 2014-04-20 18:02:27 +0100 | 
| commit | 5f6a25fc50503b70af1f3a9a27f13c2a698d0a0e (patch) | |
| tree | f8dc88109db6b46e531990df74fbb4d99254b518 /py/emit.h | |
| parent | 3558f62fb5c21a19a518c2ba75860f0b5963219e (diff) | |
py: Wrap #if's around emitter functions that are used only by emitcpy.
3 emitter functions are needed only for emitcpy, and so we can #if them
out when compiling with emitcpy support.
Also remove unused SETUP_LOOP bytecode.
Diffstat (limited to 'py/emit.h')
| -rw-r--r-- | py/emit.h | 11 | 
1 files changed, 8 insertions, 3 deletions
| @@ -41,11 +41,9 @@ typedef struct _emit_method_table_t {      void (*load_const_dec)(emit_t *emit, qstr qstr);      void (*load_const_id)(emit_t *emit, qstr qstr);      void (*load_const_str)(emit_t *emit, qstr qstr, bool bytes); -    void (*load_const_verbatim_str)(emit_t *emit, const char *str); // only needed for emitcpy      void (*load_null)(emit_t *emit);      void (*load_fast)(emit_t *emit, qstr qstr, uint id_flags, int local_num);      void (*load_deref)(emit_t *emit, qstr qstr, int local_num); -    void (*load_closure)(emit_t *emit, qstr qstr, int local_num); // only needed for emitcpy      void (*load_name)(emit_t *emit, qstr qstr);      void (*load_global)(emit_t *emit, qstr qstr);      void (*load_attr)(emit_t *emit, qstr qstr); @@ -74,7 +72,6 @@ typedef struct _emit_method_table_t {      void (*pop_jump_if_false)(emit_t *emit, uint label);      void (*jump_if_true_or_pop)(emit_t *emit, uint label);      void (*jump_if_false_or_pop)(emit_t *emit, uint label); -    void (*setup_loop)(emit_t *emit, uint label);      void (*break_loop)(emit_t *emit, uint label, int except_depth);      void (*continue_loop)(emit_t *emit, uint label, int except_depth);      void (*setup_with)(emit_t *emit, uint label); @@ -108,6 +105,14 @@ typedef struct _emit_method_table_t {      void (*raise_varargs)(emit_t *emit, int n_args);      void (*yield_value)(emit_t *emit);      void (*yield_from)(emit_t *emit); + +#if MICROPY_EMIT_CPYTHON +    // these methods are only needed for emitcpy +    void (*load_const_verbatim_str)(emit_t *emit, const char *str); +    void (*load_closure)(emit_t *emit, qstr qstr, int local_num); +    void (*setup_loop)(emit_t *emit, uint label); +#endif +  } emit_method_table_t;  void emit_common_load_id(emit_t *emit, const emit_method_table_t *emit_method_table, scope_t *scope, qstr qstr); | 
