1919
2020#include " preprocessor.h" // Preprocessor
2121#include " tokenize.h" // Tokenizer
22- #include " checkunusedfunctions.h"
2322
2423#include " check.h"
2524#include " path.h"
@@ -278,23 +277,6 @@ void CppCheck::internalError(const std::string &filename, const std::string &msg
278277 }
279278}
280279
281-
282- void CppCheck::checkFunctionUsage ()
283- {
284- // This generates false positives - especially for libraries
285- if (_settings.isEnabled (" unusedFunction" ) && _settings._jobs == 1 ) {
286- const bool verbose_orig = _settings._verbose ;
287- _settings._verbose = false ;
288-
289- if (_settings._errorsOnly == false )
290- _errorLogger.reportOut (" Checking usage of global functions.." );
291-
292- CheckUnusedFunctions::instance.check (this );
293-
294- _settings._verbose = verbose_orig;
295- }
296- }
297-
298280void CppCheck::analyseFile (std::istream &fin, const std::string &filename)
299281{
300282 // Preprocess file..
@@ -379,8 +361,12 @@ bool CppCheck::checkFile(const std::string &code, const char FileName[], std::se
379361 (*it)->runChecks (&_tokenizer, &_settings, this );
380362 }
381363
382- if (_settings.isEnabled (" unusedFunction" ) && _settings._jobs == 1 )
383- CheckUnusedFunctions::instance.parseTokens (_tokenizer, FileName, &_settings);
364+ // Analyse the tokens..
365+ for (std::list<Check *>::const_iterator it = Check::instances ().begin (); it != Check::instances ().end (); ++it) {
366+ Check::FileInfo *fi = (*it)->getFileInfo (&_tokenizer, &_settings);
367+ if (fi != nullptr )
368+ fileInfo.push_back (fi);
369+ }
384370
385371 executeRules (" normal" , _tokenizer);
386372
@@ -402,13 +388,6 @@ bool CppCheck::checkFile(const std::string &code, const char FileName[], std::se
402388 (*it)->runSimplifiedChecks (&_tokenizer, &_settings, this );
403389 }
404390
405- // Analyse the tokens..
406- for (std::list<Check *>::const_iterator it = Check::instances ().begin (); it != Check::instances ().end (); ++it) {
407- Check::FileInfo *fi = (*it)->getFileInfo (&_tokenizer);
408- if (fi != nullptr )
409- fileInfo.push_back (fi);
410- }
411-
412391 if (_settings.terminated ())
413392 return true ;
414393
0 commit comments