diff --git a/cli/cmdlineparser.cpp b/cli/cmdlineparser.cpp index b8aeaa5a0..16a15b4c8 100644 --- a/cli/cmdlineparser.cpp +++ b/cli/cmdlineparser.cpp @@ -159,6 +159,11 @@ bool CmdLineParser::parseFromArgs(int argc, const char* const argv[]) else if (std::strncmp(argv[i], "--max-ctu-depth=", 16) == 0) mSettings->maxCtuDepth = std::atoi(argv[i] + 16); + else if (std::strcmp(argv[i], "--experimental-fast") == 0) + // Skip slow simplifications and see how that affect the results, the + // goal is to remove the simplifications. + mSettings->experimentalFast = true; + // (Experimental) exception handling inside cppcheck client else if (std::strcmp(argv[i], "--exception-handling") == 0) mSettings->exceptionHandling = true; diff --git a/lib/cppcheck.cpp b/lib/cppcheck.cpp index 964948aba..aaada68da 100644 --- a/lib/cppcheck.cpp +++ b/lib/cppcheck.cpp @@ -436,12 +436,14 @@ unsigned int CppCheck::checkFile(const std::string& filename, const std::string // simplify more if required, skip rest of iteration if failed if (mSimplify) { - // if further simplification fails then skip rest of iteration - Timer timer3("Tokenizer::simplifyTokenList2", mSettings.showtime, &S_timerResults); - result = mTokenizer.simplifyTokenList2(); - timer3.Stop(); - if (!result) - continue; + if (!mSettings.experimentalFast) { + // if further simplification fails then skip rest of iteration + Timer timer3("Tokenizer::simplifyTokenList2", mSettings.showtime, &S_timerResults); + result = mTokenizer.simplifyTokenList2(); + timer3.Stop(); + if (!result) + continue; + } // Check simplified tokens checkSimplifiedTokens(mTokenizer); diff --git a/lib/settings.cpp b/lib/settings.cpp index be82f15db..6d692dc1f 100644 --- a/lib/settings.cpp +++ b/lib/settings.cpp @@ -34,6 +34,7 @@ Settings::Settings() jointSuppressionReport(false), maxCtuDepth(2), experimental(false), + experimentalFast(false), quiet(false), inlineSuppressions(false), verbose(false), diff --git a/lib/settings.h b/lib/settings.h index 0a7932bd3..b39ba49d7 100644 --- a/lib/settings.h +++ b/lib/settings.h @@ -111,6 +111,11 @@ public: */ bool experimental; + /** Experimental "fast" checking. We skip slow simplifications. The + * goal is that there will not be significant effect on the results + * and that we can remove the slow simplifications. */ + bool experimentalFast; + /** @brief Is --quiet given? */ bool quiet;