X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=main.c;h=9a688b84582961408681bb76092a48f8b233a8ed;hb=d70f5307ecc25394fc2da35bf4167fea5ac4b9ec;hp=64797fd50cd5aa1dd497001118163a60aedc5bc3;hpb=0cefeeb021ee145eb92a292a489cc22e55e6e712;p=cparser diff --git a/main.c b/main.c index 64797fd..9a688b8 100644 --- a/main.c +++ b/main.c @@ -316,6 +316,7 @@ void lower_compound_params(void) } typedef enum compile_mode_t { + BenchmarkParser, ParseOnly, Compile, CompileDump, @@ -480,6 +481,8 @@ int main(int argc, char **argv) strict_mode = true; } else if(strcmp(option, "lextest") == 0) { mode = LexTest; + } else if(strcmp(option, "benchmark") == 0) { + mode = BenchmarkParser; } else if(strcmp(option, "print-ast") == 0) { mode = PrintAst; } else if(strcmp(option, "print-implicit-cast") == 0) { @@ -556,6 +559,7 @@ int main(int argc, char **argv) char outnamebuf[4096]; if(outname == NULL) { switch(mode) { + case BenchmarkParser: case PrintAst: case PrintFluffy: case LexTest: @@ -632,6 +636,10 @@ int main(int argc, char **argv) fprintf(stderr, "%u warning(s)\n", warning_count); } + if(mode == BenchmarkParser) { + return 0; + } + if(mode == PrintAst) { type_set_output(out); ast_set_output(out);