Permalink
Browse files

add a m0_chunk to compiler.

  • Loading branch information...
kjs committed Jun 24, 2012
1 parent 3cbbe91 commit cec69b115fa8444b829f460c19b686d5a6dcda88
Showing with 2 additions and 3 deletions.
  1. +1 −0 src/compiler.h
  2. +1 −3 src/gencode.c
View
@@ -58,6 +58,7 @@ typedef struct M1_compiler {
/* code generator fields. */
FILE *outfile;
struct m0_instr *lastgenerated;
+ struct m0_chunk *current_m0chunk;
} M1_compiler;
View
@@ -55,9 +55,7 @@ static const char type_chars[REG_TYPE_NUM] = {'i', 'n', 's', 'p'};
static const char reg_chars[REG_TYPE_NUM] = {'I', 'N', 'S', 'P'};
#define LABEL(label) mk_label(comp, label)
-
#define INS(opcode, format, ...) mk_instr(comp, opcode, format, ##__VA_ARGS__)
-
#define CHUNK(name) mk_chunk(comp, name)
@@ -2403,7 +2401,7 @@ static void
gencode_chunk(M1_compiler *comp, m1_chunk *c) {
#define PRELOAD_0_AND_1 0
- CHUNK (c->name);
+ comp->current_m0chunk = CHUNK (c->name);
fprintf(OUT, ".chunk \"%s\"\n", c->name);

0 comments on commit cec69b1

Please sign in to comment.