@@ -60,7 +60,7 @@ void AnalyzerInformation::writeFilesTxt(const std::string &buildDir, const std::
60
60
61
61
for (const FileSettings &fs : fileSettings) {
62
62
const std::string afile = getFilename (fs.filename ());
63
- fout << afile << " .a" << (++fileCount[afile]) << " :" << fs.cfg << " :" << Path::simplifyPath (fs.filename ()) << std::endl;
63
+ fout << afile << " .a" << (++fileCount[afile]) << " :" << std::hex << fs.hash << " :" << Path::simplifyPath (fs.filename ()) << std::endl;
64
64
}
65
65
}
66
66
@@ -73,7 +73,7 @@ void AnalyzerInformation::close()
73
73
}
74
74
}
75
75
76
- static bool skipAnalysis (const std::string &analyzerInfoFile, std::size_t hash , std::list<ErrorMessage> &errors)
76
+ static bool skipAnalysis (const std::string &analyzerInfoFile, std::size_t filehash , std::list<ErrorMessage> &errors)
77
77
{
78
78
tinyxml2::XMLDocument doc;
79
79
const tinyxml2::XMLError error = doc.LoadFile (analyzerInfoFile.c_str ());
@@ -85,7 +85,7 @@ static bool skipAnalysis(const std::string &analyzerInfoFile, std::size_t hash,
85
85
return false ;
86
86
87
87
const char *attr = rootNode->Attribute (" hash" );
88
- if (!attr || attr != std::to_string (hash ))
88
+ if (!attr || attr != std::to_string (filehash ))
89
89
return false ;
90
90
91
91
for (const tinyxml2::XMLElement *e = rootNode->FirstChildElement (); e; e = e->NextSiblingElement ()) {
@@ -96,10 +96,10 @@ static bool skipAnalysis(const std::string &analyzerInfoFile, std::size_t hash,
96
96
return true ;
97
97
}
98
98
99
- std::string AnalyzerInformation::getAnalyzerInfoFileFromFilesTxt (std::istream& filesTxt, const std::string &sourcefile, const std::string &cfg )
99
+ std::string AnalyzerInformation::getAnalyzerInfoFileFromFilesTxt (std::istream& filesTxt, const std::string &sourcefile, const std::string &cfghash )
100
100
{
101
101
std::string line;
102
- const std::string end (' :' + cfg + ' :' + Path::simplifyPath (sourcefile));
102
+ const std::string end (' :' + cfghash + ' :' + Path::simplifyPath (sourcefile));
103
103
while (std::getline (filesTxt,line)) {
104
104
if (line.size () <= end.size () + 2U )
105
105
continue ;
@@ -110,11 +110,11 @@ std::string AnalyzerInformation::getAnalyzerInfoFileFromFilesTxt(std::istream& f
110
110
return " " ;
111
111
}
112
112
113
- std::string AnalyzerInformation::getAnalyzerInfoFile (const std::string &buildDir, const std::string &sourcefile, const std::string &cfg )
113
+ std::string AnalyzerInformation::getAnalyzerInfoFile (const std::string &buildDir, const std::string &sourcefile, const std::string &cfghash )
114
114
{
115
115
std::ifstream fin (Path::join (buildDir, " files.txt" ));
116
116
if (fin.is_open ()) {
117
- const std::string& ret = getAnalyzerInfoFileFromFilesTxt (fin, sourcefile, cfg );
117
+ const std::string& ret = getAnalyzerInfoFileFromFilesTxt (fin, sourcefile, cfghash );
118
118
if (!ret.empty ())
119
119
return Path::join (buildDir, ret);
120
120
}
@@ -128,21 +128,21 @@ std::string AnalyzerInformation::getAnalyzerInfoFile(const std::string &buildDir
128
128
return Path::join (buildDir, filename) + " .analyzerinfo" ;
129
129
}
130
130
131
- bool AnalyzerInformation::analyzeFile (const std::string &buildDir, const std::string &sourcefile, const std::string &cfg , std::size_t hash , std::list<ErrorMessage> &errors)
131
+ bool AnalyzerInformation::analyzeFile (const std::string &buildDir, const std::string &sourcefile, const std::string &cfgHash , std::size_t fileHash , std::list<ErrorMessage> &errors)
132
132
{
133
133
if (buildDir.empty () || sourcefile.empty ())
134
134
return true ;
135
135
close ();
136
136
137
- mAnalyzerInfoFile = AnalyzerInformation::getAnalyzerInfoFile (buildDir,sourcefile,cfg );
137
+ mAnalyzerInfoFile = AnalyzerInformation::getAnalyzerInfoFile (buildDir,sourcefile,cfgHash );
138
138
139
- if (skipAnalysis (mAnalyzerInfoFile , hash , errors))
139
+ if (skipAnalysis (mAnalyzerInfoFile , fileHash , errors))
140
140
return false ;
141
141
142
142
mOutputStream .open (mAnalyzerInfoFile );
143
143
if (mOutputStream .is_open ()) {
144
144
mOutputStream << " <?xml version=\" 1.0\" ?>\n " ;
145
- mOutputStream << " <analyzerinfo hash=\" " << hash << " \" >\n " ;
145
+ mOutputStream << " <analyzerinfo hash=\" " << fileHash << " \" >\n " ;
146
146
} else {
147
147
mAnalyzerInfoFile .clear ();
148
148
}
0 commit comments