Unused Functions: use buildDir if specified. Otherwise use old approach.

This commit is contained in:
Daniel Marjamäki 2016-12-09 20:11:20 +01:00
parent 7b22ed276e
commit ea905c9a36
1 changed files with 4 additions and 2 deletions

View File

@ -273,7 +273,9 @@ void CheckUnusedFunctions::unusedFunctionError(ErrorLogger * const errorLogger,
Check::FileInfo *CheckUnusedFunctions::getFileInfo(const Tokenizer *tokenizer, const Settings *settings) const
{
if (settings->isEnabled("unusedFunction") && (settings->jobs == 1 || !settings->buildDir.empty()))
if (!settings->isEnabled("unusedFunction"))
return nullptr;
if (settings->jobs == 1 && settings->buildDir.empty())
instance.parseTokens(*tokenizer, tokenizer->list.getFiles().front().c_str(), settings);
return nullptr;
}
@ -327,7 +329,7 @@ void CheckUnusedFunctions::analyseWholeProgram(ErrorLogger * const errorLogger,
const std::string::size_type lastColon = filesTxtLine.rfind(':');
if (firstColon == lastColon)
continue;
const std::string xmlfile = filesTxtLine.substr(0,firstColon);
const std::string xmlfile = buildDir + '/' + filesTxtLine.substr(0,firstColon);
const std::string sourcefile = filesTxtLine.substr(lastColon+1);
tinyxml2::XMLDocument doc;