CppCheck: Added _simplify flag that can be used by clients to disable simplifications
This commit is contained in:
parent
b6bcdf2936
commit
2f1050595d
|
@ -40,7 +40,7 @@ static const char ExtraVersion[] = "";
|
||||||
static TimerResults S_timerResults;
|
static TimerResults S_timerResults;
|
||||||
|
|
||||||
CppCheck::CppCheck(ErrorLogger &errorLogger, bool useGlobalSuppressions)
|
CppCheck::CppCheck(ErrorLogger &errorLogger, bool useGlobalSuppressions)
|
||||||
: _errorLogger(errorLogger), exitcode(0), _useGlobalSuppressions(useGlobalSuppressions), tooManyConfigs(false)
|
: _errorLogger(errorLogger), exitcode(0), _useGlobalSuppressions(useGlobalSuppressions), tooManyConfigs(false), _simplify(true)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -338,6 +338,9 @@ void CppCheck::checkFile(const std::string &code, const char FileName[])
|
||||||
if (_settings.isEnabled("unusedFunction") && _settings._jobs == 1)
|
if (_settings.isEnabled("unusedFunction") && _settings._jobs == 1)
|
||||||
_checkUnusedFunctions.parseTokens(_tokenizer);
|
_checkUnusedFunctions.parseTokens(_tokenizer);
|
||||||
|
|
||||||
|
if (!_simplify)
|
||||||
|
return;
|
||||||
|
|
||||||
Timer timer3("Tokenizer::simplifyTokenList", _settings._showtime, &S_timerResults);
|
Timer timer3("Tokenizer::simplifyTokenList", _settings._showtime, &S_timerResults);
|
||||||
result = _tokenizer.simplifyTokenList();
|
result = _tokenizer.simplifyTokenList();
|
||||||
timer3.Stop();
|
timer3.Stop();
|
||||||
|
|
|
@ -133,6 +133,10 @@ public:
|
||||||
|
|
||||||
void tooManyConfigsError(const std::string &file, const std::size_t numberOfConfigurations);
|
void tooManyConfigsError(const std::string &file, const std::size_t numberOfConfigurations);
|
||||||
|
|
||||||
|
void dontSimplify() {
|
||||||
|
_simplify = false;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
/** @brief There has been a internal error => Report information message */
|
/** @brief There has been a internal error => Report information message */
|
||||||
|
@ -197,6 +201,9 @@ private:
|
||||||
|
|
||||||
/** Are there too many configs? */
|
/** Are there too many configs? */
|
||||||
bool tooManyConfigs;
|
bool tooManyConfigs;
|
||||||
|
|
||||||
|
/** Simplify code? true by default */
|
||||||
|
bool _simplify;
|
||||||
};
|
};
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
|
Loading…
Reference in New Issue