@@ -850,19 +850,24 @@ static simplecpp::TokenList createTokenList(const std::string& filename, std::ve
850850 return {filename, files, outputList};
851851}
852852
853- static std::size_t calculateHash (const Preprocessor& preprocessor, const simplecpp::TokenList& tokens, const Settings& settings, const Suppressions& supprs)
853+ std::size_t CppCheck:: calculateHash (const Preprocessor& preprocessor, const simplecpp::TokenList& tokens) const
854854{
855855 std::ostringstream toolinfo;
856- toolinfo << (settings.cppcheckCfgProductName .empty () ? CPPCHECK_VERSION_STRING : settings.cppcheckCfgProductName );
857- toolinfo << (settings.severity .isEnabled (Severity::warning) ? ' w' : ' ' );
858- toolinfo << (settings.severity .isEnabled (Severity::style) ? ' s' : ' ' );
859- toolinfo << (settings.severity .isEnabled (Severity::performance) ? ' p' : ' ' );
860- toolinfo << (settings.severity .isEnabled (Severity::portability) ? ' p' : ' ' );
861- toolinfo << (settings.severity .isEnabled (Severity::information) ? ' i' : ' ' );
862- toolinfo << settings.userDefines ;
863- toolinfo << std::to_string (static_cast <std::uint8_t >(settings.checkLevel ));
856+ toolinfo << (mSettings .cppcheckCfgProductName .empty () ? CPPCHECK_VERSION_STRING : mSettings .cppcheckCfgProductName );
857+ toolinfo << (mSettings .severity .isEnabled (Severity::warning) ? ' w' : ' ' );
858+ toolinfo << (mSettings .severity .isEnabled (Severity::style) ? ' s' : ' ' );
859+ toolinfo << (mSettings .severity .isEnabled (Severity::performance) ? ' p' : ' ' );
860+ toolinfo << (mSettings .severity .isEnabled (Severity::portability) ? ' p' : ' ' );
861+ toolinfo << (mSettings .severity .isEnabled (Severity::information) ? ' i' : ' ' );
862+ toolinfo << mSettings .userDefines ;
863+ toolinfo << std::to_string (static_cast <std::uint8_t >(mSettings .checkLevel ));
864+ for (const auto &a : mSettings .addonInfos ) {
865+ toolinfo << a.name ;
866+ toolinfo << a.args ;
867+ }
868+ toolinfo << mSettings .premiumArgs ;
864869 // TODO: do we need to add more options?
865- supprs .nomsg .dump (toolinfo);
870+ mSuppressions .nomsg .dump (toolinfo);
866871 return preprocessor.calculateHash (tokens, toolinfo.str ());
867872}
868873
@@ -922,7 +927,7 @@ unsigned int CppCheck::checkFile(const FileWithDetails& file, const std::string
922927 simplecpp::TokenList tokens (*fileStream, files, file.spath ());
923928 if (analyzerInformation) {
924929 const Preprocessor preprocessor (mSettings , mErrorLogger , Standards::Language::C);
925- hash = calculateHash (preprocessor, tokens, mSettings , mSuppressions );
930+ hash = calculateHash (preprocessor, tokens);
926931 }
927932 tokenlist.createTokens (std::move (tokens));
928933 }
@@ -931,7 +936,7 @@ unsigned int CppCheck::checkFile(const FileWithDetails& file, const std::string
931936 simplecpp::TokenList tokens (file.spath (), files);
932937 if (analyzerInformation) {
933938 const Preprocessor preprocessor (mSettings , mErrorLogger , file.lang ());
934- hash = calculateHash (preprocessor, tokens, mSettings , mSuppressions );
939+ hash = calculateHash (preprocessor, tokens);
935940 }
936941 tokenlist.createTokens (std::move (tokens));
937942 }
@@ -1015,7 +1020,7 @@ unsigned int CppCheck::checkFile(const FileWithDetails& file, const std::string
10151020
10161021 if (analyzerInformation) {
10171022 // Calculate hash so it can be compared with old hash / future hashes
1018- const std::size_t hash = calculateHash (preprocessor, tokens1, mSettings , mSuppressions );
1023+ const std::size_t hash = calculateHash (preprocessor, tokens1);
10191024 std::list<ErrorMessage> errors;
10201025 if (!analyzerInformation->analyzeFile (mSettings .buildDir , file.spath (), cfgname, fileIndex, hash, errors)) {
10211026 while (!errors.empty ()) {
0 commit comments