Skip to content

Commit

Permalink
add a m0_chunk to compiler.
Browse files Browse the repository at this point in the history
  • Loading branch information
kjs committed Jun 24, 2012
1 parent 3cbbe91 commit cec69b1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/compiler.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ typedef struct M1_compiler {
/* code generator fields. */ /* code generator fields. */
FILE *outfile; FILE *outfile;
struct m0_instr *lastgenerated; struct m0_instr *lastgenerated;
struct m0_chunk *current_m0chunk;


} M1_compiler; } M1_compiler;


Expand Down
4 changes: 1 addition & 3 deletions src/gencode.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -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'}; static const char reg_chars[REG_TYPE_NUM] = {'I', 'N', 'S', 'P'};


#define LABEL(label) mk_label(comp, label) #define LABEL(label) mk_label(comp, label)

#define INS(opcode, format, ...) mk_instr(comp, opcode, format, ##__VA_ARGS__) #define INS(opcode, format, ...) mk_instr(comp, opcode, format, ##__VA_ARGS__)

#define CHUNK(name) mk_chunk(comp, name) #define CHUNK(name) mk_chunk(comp, name)




Expand Down Expand Up @@ -2403,7 +2401,7 @@ static void
gencode_chunk(M1_compiler *comp, m1_chunk *c) { gencode_chunk(M1_compiler *comp, m1_chunk *c) {
#define PRELOAD_0_AND_1 0 #define PRELOAD_0_AND_1 0


CHUNK (c->name); comp->current_m0chunk = CHUNK (c->name);


fprintf(OUT, ".chunk \"%s\"\n", c->name); fprintf(OUT, ".chunk \"%s\"\n", c->name);


Expand Down

0 comments on commit cec69b1

Please sign in to comment.