@@ -1777,9 +1777,13 @@ bool CppCheck::analyseWholeProgram()
17771777 ctu.nestedCalls .insert (ctu.nestedCalls .end (), fi2->nestedCalls .cbegin (), fi2->nestedCalls .cend ());
17781778 }
17791779 }
1780+
17801781 // cppcheck-suppress shadowFunction - TODO: fix this
17811782 for (Check *check : Check::instances ())
17821783 errors |= check->analyseWholeProgram (&ctu, mFileInfo , mSettings , *this ); // TODO: ctu
1784+
1785+ errors |= CheckUnusedFunctions::check (mSettings , *this );
1786+
17831787 return errors && (mExitCode > 0 );
17841788}
17851789
@@ -1791,7 +1795,7 @@ void CppCheck::analyseWholeProgram(const std::string &buildDir, const std::list<
17911795 return ;
17921796 }
17931797 if (mSettings .checks .isEnabled (Checks::unusedFunction))
1794- CheckUnusedFunctions::analyseWholeProgram (mSettings , this , buildDir);
1798+ CheckUnusedFunctions::analyseWholeProgram2 (mSettings , this , buildDir);
17951799 std::list<Check::FileInfo*> fileInfoList;
17961800 CTU::FileInfo ctuFileInfo;
17971801
@@ -1844,6 +1848,8 @@ void CppCheck::analyseWholeProgram(const std::string &buildDir, const std::list<
18441848 for (Check *check : Check::instances ())
18451849 check->analyseWholeProgram (&ctuFileInfo, fileInfoList, mSettings , *this );
18461850
1851+ CheckUnusedFunctions::check (mSettings , *this );
1852+
18471853 for (Check::FileInfo *fi : fileInfoList)
18481854 delete fi;
18491855}
0 commit comments