removed `TokenList::getSettings()` and replaced usage in ValueFlow with provided settings (#4843)

This commit is contained in:
Oliver Stöneberg 2023-03-03 18:31:38 +01:00 committed by GitHub
parent f9c67ef907
commit 8023eff7c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 180 additions and 169 deletions

View File

@ -1660,7 +1660,7 @@ struct OnException {
void TokenList::validateAst() const void TokenList::validateAst() const
{ {
OnException oe{[&] { OnException oe{[&] {
if (mSettings->debugnormal) if (mSettings && mSettings->debugnormal)
mTokensFrontBack.front->printOut(); mTokensFrontBack.front->printOut();
}}; }};
// Check for some known issues in AST to avoid crash/hang later on // Check for some known issues in AST to avoid crash/hang later on
@ -1784,6 +1784,9 @@ bool TokenList::validateToken(const Token* tok) const
void TokenList::simplifyPlatformTypes() void TokenList::simplifyPlatformTypes()
{ {
if (!mSettings)
return;
const bool isCPP11 = mSettings->standards.cpp >= Standards::CPP11; const bool isCPP11 = mSettings->standards.cpp >= Standards::CPP11;
enum { isLongLong, isLong, isInt } type; enum { isLongLong, isLong, isInt } type;

View File

@ -50,10 +50,6 @@ public:
mSettings = settings; mSettings = settings;
} }
const Settings *getSettings() const {
return mSettings;
}
/** @return the source file path. e.g. "file.cpp" */ /** @return the source file path. e.g. "file.cpp" */
const std::string& getSourceFilePath() const; const std::string& getSourceFilePath() const;

File diff suppressed because it is too large Load Diff