@@ -1210,6 +1210,12 @@ static void valueFlowEnumValue(SymbolDatabase & symboldatabase, const Settings &
12101210 }
12111211}
12121212
1213+ // trampoline to generate unique timer results entry
1214+ static void valueFlowEnumValueEarly (SymbolDatabase & symboldatabase, const Settings & settings)
1215+ {
1216+ valueFlowEnumValue (symboldatabase, settings);
1217+ }
1218+
12131219static void valueFlowGlobalConstVar (TokenList& tokenList, const Settings& settings)
12141220{
12151221 // Get variable values...
@@ -7200,7 +7206,7 @@ struct ValueFlowPassRunner {
72007206 bool run_once (std::initializer_list<ValuePtr<ValueFlowPass>> passes) const
72017207 {
72027208 return std::any_of (passes.begin (), passes.end (), [&](const ValuePtr<ValueFlowPass>& pass) {
7203- return run (pass);
7209+ return run (pass, 0 );
72047210 });
72057211 }
72067212
@@ -7210,10 +7216,11 @@ struct ValueFlowPassRunner {
72107216 std::size_t n = state.settings .vfOptions .maxIterations ;
72117217 while (n > 0 && values != getTotalValues ()) {
72127218 values = getTotalValues ();
7213- const std::string passnum = std::to_string (state.settings .vfOptions .maxIterations - n + 1 );
7219+ const std::size_t passnum = state.settings .vfOptions .maxIterations - n + 1 ;
7220+ const std::string passnum_s = std::to_string (passnum);
72147221 if (std::any_of (passes.begin (), passes.end (), [&](const ValuePtr<ValueFlowPass>& pass) {
7215- ProgressReporter progressReporter (state.errorLogger , state.settings .reportProgress >= 0 , state.tokenlist .getSourceFilePath (), std::string (" ValueFlow::" ) + pass->name () + (' ' + passnum ));
7216- return run (pass);
7222+ ProgressReporter progressReporter (state.errorLogger , state.settings .reportProgress >= 0 , state.tokenlist .getSourceFilePath (), std::string (" ValueFlow::" ) + pass->name () + (' ' + passnum_s ));
7223+ return run (pass, passnum );
72177224 }))
72187225 return true ;
72197226 --n;
@@ -7233,7 +7240,7 @@ struct ValueFlowPassRunner {
72337240 return false ;
72347241 }
72357242
7236- bool run (const ValuePtr<ValueFlowPass>& pass) const
7243+ bool run (const ValuePtr<ValueFlowPass>& pass, std:: size_t it ) const
72377244 {
72387245 auto start = Clock::now ();
72397246 if (start > stop) {
@@ -7243,7 +7250,12 @@ struct ValueFlowPassRunner {
72437250 if (!state.tokenlist .isCPP () && pass->cpp ())
72447251 return false ;
72457252 if (timerResults) {
7246- Timer t (pass->name (), state.settings .showtime , timerResults);
7253+ std::string name = pass->name ();
7254+ if (it > 0 ) {
7255+ name += ' ' ;
7256+ name += std::to_string (it);
7257+ }
7258+ Timer t (name, state.settings .showtime , timerResults);
72477259 pass->run (state);
72487260 } else {
72497261 pass->run (state);
@@ -7375,7 +7387,7 @@ void ValueFlow::setValues(TokenList& tokenlist,
73757387
73767388 ValueFlowPassRunner runner{ValueFlowState{tokenlist, symboldatabase, errorLogger, settings}, timerResults};
73777389 runner.run_once ({
7378- VFA (valueFlowEnumValue (symboldatabase, settings)),
7390+ VFA (valueFlowEnumValueEarly (symboldatabase, settings)),
73797391 VFA (valueFlowNumber (tokenlist, settings)),
73807392 VFA (valueFlowString (tokenlist, settings)),
73817393 VFA (valueFlowTypeTraits (tokenlist, settings)),
0 commit comments