|
20 | 20 | //--------------------------------------------------------------------------- |
21 | 21 | #include "checkunusedfunctions.h" |
22 | 22 |
|
| 23 | +#include "analyzerinfo.h" |
23 | 24 | #include "astutils.h" |
24 | 25 | #include "errorlogger.h" |
25 | 26 | #include "errortypes.h" |
@@ -461,14 +462,12 @@ void CheckUnusedFunctions::analyseWholeProgram(const Settings &settings, ErrorLo |
461 | 462 | std::ifstream fin(filesTxt.c_str()); |
462 | 463 | std::string filesTxtLine; |
463 | 464 | while (std::getline(fin, filesTxtLine)) { |
464 | | - const std::string::size_type firstColon = filesTxtLine.find(':'); |
465 | | - if (firstColon == std::string::npos) |
| 465 | + AnalyzerInformation::Info filesTxtInfo; |
| 466 | + if (!filesTxtInfo.parse(filesTxtLine)) { |
466 | 467 | continue; |
467 | | - const std::string::size_type secondColon = filesTxtLine.find(':', firstColon+1); |
468 | | - if (secondColon == std::string::npos) |
469 | | - continue; |
470 | | - const std::string xmlfile = buildDir + '/' + filesTxtLine.substr(0,firstColon); |
471 | | - const std::string sourcefile = filesTxtLine.substr(secondColon+1); |
| 468 | + } |
| 469 | + |
| 470 | + const std::string xmlfile = buildDir + '/' + filesTxtInfo.afile; |
472 | 471 |
|
473 | 472 | tinyxml2::XMLDocument doc; |
474 | 473 | const tinyxml2::XMLError error = doc.LoadFile(xmlfile.c_str()); |
@@ -500,7 +499,7 @@ void CheckUnusedFunctions::analyseWholeProgram(const Settings &settings, ErrorLo |
500 | 499 | const char* file = e2->Attribute("file"); |
501 | 500 | const char* column = default_if_null(e2->Attribute("column"), "0"); |
502 | 501 | // cppcheck-suppress templateInstantiation - TODO: fix this - see #11631 |
503 | | - decls[functionName] = Location(file ? file : sourcefile, strToInt<int>(lineNumber), strToInt<int>(column)); |
| 502 | + decls[functionName] = Location(file ? file : filesTxtInfo.sourceFile, strToInt<int>(lineNumber), strToInt<int>(column)); |
504 | 503 | } |
505 | 504 | } |
506 | 505 | } |
|
0 commit comments