@@ -1772,9 +1772,13 @@ bool CppCheck::analyseWholeProgram()
17721772 ctu.nestedCalls .insert (ctu.nestedCalls .end (), fi2->nestedCalls .cbegin (), fi2->nestedCalls .cend ());
17731773 }
17741774 }
1775+
17751776 // cppcheck-suppress shadowFunction - TODO: fix this
17761777 for (Check *check : Check::instances ())
17771778 errors |= check->analyseWholeProgram (&ctu, mFileInfo , mSettings , *this ); // TODO: ctu
1779+
1780+ errors |= CheckUnusedFunctions::check (mSettings , *this );
1781+
17781782 return errors && (mExitCode > 0 );
17791783}
17801784
@@ -1786,7 +1790,7 @@ void CppCheck::analyseWholeProgram(const std::string &buildDir, const std::list<
17861790 return ;
17871791 }
17881792 if (mSettings .checks .isEnabled (Checks::unusedFunction))
1789- CheckUnusedFunctions::analyseWholeProgram (mSettings , this , buildDir);
1793+ CheckUnusedFunctions::analyseWholeProgram2 (mSettings , this , buildDir);
17901794 std::list<Check::FileInfo*> fileInfoList;
17911795 CTU::FileInfo ctuFileInfo;
17921796
@@ -1839,6 +1843,8 @@ void CppCheck::analyseWholeProgram(const std::string &buildDir, const std::list<
18391843 for (Check *check : Check::instances ())
18401844 check->analyseWholeProgram (&ctuFileInfo, fileInfoList, mSettings , *this );
18411845
1846+ CheckUnusedFunctions::check (mSettings , *this );
1847+
18421848 for (Check::FileInfo *fi : fileInfoList)
18431849 delete fi;
18441850}
0 commit comments