From 8983636d1b68d958f9131fda5b657c976802fecf Mon Sep 17 00:00:00 2001 From: dzid26 Date: Sun, 9 Jun 2024 15:24:16 +0100 Subject: [PATCH 1/2] generate ctu-info from FileSettings for whole project analysis --- lib/cppcheck.cpp | 13 +++++++++++-- lib/cppcheck.h | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/cppcheck.cpp b/lib/cppcheck.cpp index 2a2efd1dcbd..70d125f94be 100644 --- a/lib/cppcheck.cpp +++ b/lib/cppcheck.cpp @@ -1461,7 +1461,7 @@ void CppCheck::executeAddons(const std::vector& files, const std::s } } -void CppCheck::executeAddonsWholeProgram(const std::list> &files) +void CppCheck::executeAddonsWholeProgram(const std::list> &files, const std::list& fileSettings) { if (mSettings.addons.empty()) return; @@ -1472,6 +1472,15 @@ void CppCheck::executeAddonsWholeProgram(const std::list> &files, const std::list& fileSettings) { - executeAddonsWholeProgram(files); // TODO: pass FileSettings + executeAddonsWholeProgram(files, fileSettings); if (buildDir.empty()) { removeCtuInfoFiles(files, fileSettings); return mExitCode; diff --git a/lib/cppcheck.h b/lib/cppcheck.h index 486f77bc9a6..384e58d7a5a 100644 --- a/lib/cppcheck.h +++ b/lib/cppcheck.h @@ -192,7 +192,7 @@ class CPPCHECKLIB CppCheck : ErrorLogger { /** * Execute addons */ - void executeAddonsWholeProgram(const std::list> &files); + void executeAddonsWholeProgram(const std::list> &files, const std::list& fileSettings); #ifdef HAVE_RULES /** From 367e2cf60631d05e5da611addfd431d6d9ef6344 Mon Sep 17 00:00:00 2001 From: dzid26 Date: Fri, 14 Jun 2024 01:39:30 +0100 Subject: [PATCH 2/2] Print whole program analysis progress. Less confusing dots. --- lib/cppcheck.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/cppcheck.cpp b/lib/cppcheck.cpp index 70d125f94be..b86a2bebf54 100644 --- a/lib/cppcheck.cpp +++ b/lib/cppcheck.cpp @@ -868,7 +868,7 @@ unsigned int CppCheck::checkFile(const std::string& filename, const std::string if (!mSettings.quiet && (!mCurrentConfig.empty() || checkCount > 1)) { std::string fixedpath = Path::simplifyPath(filename); fixedpath = Path::toNativeSeparators(std::move(fixedpath)); - mErrorLogger.reportOut("Checking " + fixedpath + ": " + mCurrentConfig + "...", Color::FgGreen); + mErrorLogger.reportOut("Checking... " + fixedpath + ": " + mCurrentConfig, Color::FgGreen); } if (!tokenizer.tokens()) @@ -1480,7 +1480,7 @@ void CppCheck::executeAddonsWholeProgram(const std::list