tccpp: Add -bench -E mode

for benchmarking the preprocessor, without having to use the PP_BENCH
macro.  No output will be produced for '-E -bench', so it's the raw
tokenization/preprocess speed.
This commit is contained in:
Michael Matz 2018-05-26 23:08:54 +02:00
parent 2a0167adfe
commit de06193d88

10
tccpp.c
View file

@ -3992,11 +3992,11 @@ ST_FUNC int tcc_preprocess(TCCState *s1)
if (s1->Pflag == LINE_MACRO_OUTPUT_FORMAT_P10)
parse_flags |= PARSE_FLAG_TOK_NUM, s1->Pflag = 1;
#ifdef PP_BENCH
/* for PP benchmarks */
do next(); while (tok != TOK_EOF);
return 0;
#endif
if (s1->do_bench) {
/* for PP benchmarks */
do next(); while (tok != TOK_EOF);
return 0;
}
if (s1->dflag & 1) {
pp_debug_builtins(s1);