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)
|
else if (std::strncmp(argv[i], "--max-ctu-depth=", 16) == 0)
|
||||||
mSettings->maxCtuDepth = std::atoi(argv[i] + 16);
|
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
|
// (Experimental) exception handling inside cppcheck client
|
||||||
else if (std::strcmp(argv[i], "--exception-handling") == 0)
|
else if (std::strcmp(argv[i], "--exception-handling") == 0)
|
||||||
mSettings->exceptionHandling = true;
|
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
|
// simplify more if required, skip rest of iteration if failed
|
||||||
if (mSimplify) {
|
if (mSimplify) {
|
||||||
// if further simplification fails then skip rest of iteration
|
if (!mSettings.experimentalFast) {
|
||||||
Timer timer3("Tokenizer::simplifyTokenList2", mSettings.showtime, &S_timerResults);
|
// if further simplification fails then skip rest of iteration
|
||||||
result = mTokenizer.simplifyTokenList2();
|
Timer timer3("Tokenizer::simplifyTokenList2", mSettings.showtime, &S_timerResults);
|
||||||
timer3.Stop();
|
result = mTokenizer.simplifyTokenList2();
|
||||||
if (!result)
|
timer3.Stop();
|
||||||
continue;
|
if (!result)
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// Check simplified tokens
|
// Check simplified tokens
|
||||||
checkSimplifiedTokens(mTokenizer);
|
checkSimplifiedTokens(mTokenizer);
|
||||||
|
|
|
@ -34,6 +34,7 @@ Settings::Settings()
|
||||||
jointSuppressionReport(false),
|
jointSuppressionReport(false),
|
||||||
maxCtuDepth(2),
|
maxCtuDepth(2),
|
||||||
experimental(false),
|
experimental(false),
|
||||||
|
experimentalFast(false),
|
||||||
quiet(false),
|
quiet(false),
|
||||||
inlineSuppressions(false),
|
inlineSuppressions(false),
|
||||||
verbose(false),
|
verbose(false),
|
||||||
|
|
|
@ -111,6 +111,11 @@ public:
|
||||||
*/
|
*/
|
||||||
bool experimental;
|
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? */
|
/** @brief Is --quiet given? */
|
||||||
bool quiet;
|
bool quiet;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue