Add --experimental-fast option
This commit is contained in:
parent
10d3b2466b
commit
4f232e41dd
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -34,6 +34,7 @@ Settings::Settings()
|
|||
jointSuppressionReport(false),
|
||||
maxCtuDepth(2),
|
||||
experimental(false),
|
||||
experimentalFast(false),
|
||||
quiet(false),
|
||||
inlineSuppressions(false),
|
||||
verbose(false),
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue