From de06193d88f542a1357c71e5cb5549bc3469f884 Mon Sep 17 00:00:00 2001 From: Michael Matz Date: Sat, 26 May 2018 23:08:54 +0200 Subject: [PATCH] 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. --- tccpp.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tccpp.c b/tccpp.c index e5283c66..37592f6b 100644 --- a/tccpp.c +++ b/tccpp.c @@ -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);