-dump option, by default the IR is not dumped anymore

This commit is contained in:
Wolfgang (Blub) Bumiller 2012-08-14 16:19:23 +02:00
parent 1638cc9f01
commit 107100c666
3 changed files with 8 additions and 1 deletions

View file

@ -970,6 +970,7 @@ extern const char *opts_output; /* -o file */
extern int opts_standard;
extern bool opts_debug;
extern bool opts_memchk;
extern bool opts_dump;
/*===================================================================*/
#define OPTS_FLAG(i) (!! (opts_flags[(i)/32] & (1<< ((i)%32))))

5
main.c
View file

@ -30,6 +30,7 @@ const char *opts_output = "progs.dat";
int opts_standard = COMPILER_GMQCC;
bool opts_debug = false;
bool opts_memchk = false;
bool opts_dump = false;
typedef struct { char *filename; int type; } argitem;
VECTOR_MAKE(argitem, items);
@ -179,6 +180,10 @@ static bool options_parse(int argc, char **argv) {
opts_debug = true;
continue;
}
if (!strcmp(argv[0]+1, "dump")) {
opts_dump = true;
continue;
}
if (!strcmp(argv[0]+1, "memchk")) {
opts_memchk = true;
continue;

View file

@ -1923,7 +1923,8 @@ bool parser_finish(const char *output)
}
}
ir_builder_dump(ir, printf);
if (opts_dump)
ir_builder_dump(ir, printf);
if (!ir_builder_generate(ir, output)) {
printf("*** failed to generate output file\n");