Skip to content
Browse files

fixes. cleanups.

  • Loading branch information...
1 parent e535139 commit 0678c47a14998152fe8f5dc0fce91f96cd4d4a93 @kjs kjs committed Jun 23, 2012
Showing with 5 additions and 19 deletions.
  1. +3 −17 src/instr.h
  2. +2 −2 src/m1.y
View
20 src/instr.h
@@ -51,19 +51,6 @@ typedef enum m0_opcode {
extern char const * const m0_instr_names[];
-
-typedef enum m0_instr_flag {
- I_TYPE_INT = 0x0001,
- I_TYPE_NUM = 0x0002,
- I_TYPE_STR = 0x0004,
- I_TYPE_PMC = 0x0008,
- I_0_OPERANDS = 0x0010,
- I_1_OPERANDS = 0x0020,
- I_2_OPERANDS = 0x0040,
- I_3_OPERANDS = 0x0080
-
-} m0_instr_flag;
-
typedef enum M0_alias {
CF = 0,
@@ -92,7 +79,6 @@ typedef struct m0_operand {
typedef struct m0_instr {
unsigned char opcode;
unsigned numops;
- char flags; /* maximum of 8 flags */
unsigned int label; /* most instructions won't have one */
struct m0_operand operands[3];
@@ -101,10 +87,10 @@ typedef struct m0_instr {
/* struct representing an M0 chunk. */
typedef struct m0_chunk {
+ unsigned int num_instr; /* number of instructions in this chunk. */
+ m0_instr *instructions; /* list of instructions. */
- m0_instr *instructions;
-
- struct m0_chunk *next;
+ struct m0_chunk *next; /* chunks are stored in a list. */
} m0_chunk;
View
4 src/m1.y
@@ -1100,8 +1100,8 @@ m0_op : "noop" { $$ = M0_NOOP; }
| "div_n" { $$ = M0_DIV_N; }
| "mod_i" { $$ = M0_MOD_I; }
| "mod_n" { $$ = M0_MOD_N; }
- | "iton" { $$ = M0_ITON; }
- | "ntoi" { $$ = M0_NTOI; }
+ | "iton" { $$ = M0_CONVERT_N_I; }
+ | "ntoi" { $$ = M0_CONVERT_I_N; }
| "ashr" { $$ = M0_ASHR; }
| "lshr" { $$ = M0_LSHR; }
| "shl" { $$ = M0_SHL; }

0 comments on commit 0678c47

Please sign in to comment.
Something went wrong with that request. Please try again.