@@ -42,14 +42,14 @@ KleeGenerator::KleeGenerator(
42
42
}
43
43
}
44
44
45
- vector<KleeGenerator::BuildFileInfo>
45
+ std:: vector<KleeGenerator::BuildFileInfo>
46
46
KleeGenerator::buildByCDb (const CollectionUtils::MapFileTo<fs::path> &filesToBuild,
47
47
const CollectionUtils::FileSet &stubSources) {
48
48
LOG_SCOPE_FUNCTION (DEBUG);
49
49
auto compileCommands = getCompileCommandsForKlee (filesToBuild, stubSources);
50
50
printer::DefaultMakefilePrinter makefilePrinter;
51
51
52
- vector<fs::path> outfilePaths;
52
+ std:: vector<fs::path> outfilePaths;
53
53
for (const auto &compileCommand : compileCommands) {
54
54
fs::path output = compileCommand.getOutput ();
55
55
outfilePaths.emplace_back (output);
@@ -79,7 +79,7 @@ KleeGenerator::buildByCDb(const CollectionUtils::MapFileTo<fs::path> &filesToBui
79
79
return outFiles;
80
80
}
81
81
82
- vector<KleeGenerator::BuildFileInfo>
82
+ std:: vector<KleeGenerator::BuildFileInfo>
83
83
KleeGenerator::buildByCDb (const CollectionUtils::FileSet &filesToBuild,
84
84
const CollectionUtils::FileSet &stubSources) {
85
85
CollectionUtils::MapFileTo<fs::path> filesMap;
@@ -89,7 +89,7 @@ KleeGenerator::buildByCDb(const CollectionUtils::FileSet &filesToBuild,
89
89
return buildByCDb (filesMap, stubSources);
90
90
}
91
91
92
- static string getUTBotClangCompilerPath (fs::path clientCompilerPath) {
92
+ static std:: string getUTBotClangCompilerPath (fs::path clientCompilerPath) {
93
93
auto compilerName = CompilationUtils::getCompilerName (clientCompilerPath);
94
94
switch (compilerName) {
95
95
case CompilationUtils::CompilerName::GCC:
@@ -108,11 +108,11 @@ static string getUTBotClangCompilerPath(fs::path clientCompilerPath) {
108
108
std::optional<utbot::CompileCommand>
109
109
KleeGenerator::getCompileCommandForKlee (const fs::path &hintPath,
110
110
const CollectionUtils::FileSet &stubSources,
111
- const vector<string> &flags) const {
111
+ const std:: vector<std:: string> &flags) const {
112
112
auto compilationUnitInfo = buildDatabase->getClientCompilationUnitInfo (hintPath);
113
113
auto command = compilationUnitInfo->command ;
114
114
auto srcFilePath = compilationUnitInfo->getSourcePath ();
115
- string newCompilerPath = getUTBotClangCompilerPath (command.getCompiler ());
115
+ std:: string newCompilerPath = getUTBotClangCompilerPath (command.getCompiler ());
116
116
command.setCompiler (newCompilerPath);
117
117
118
118
srcFilePath = pathSubstitution.substituteLineFlag (srcFilePath);
@@ -126,17 +126,17 @@ KleeGenerator::getCompileCommandForKlee(const fs::path &hintPath,
126
126
command.setOutput (outFilePath);
127
127
command.setOptimizationLevel (" -O0" );
128
128
command.removeGccFlags ();
129
- vector<string> extraFlags{ " -emit-llvm" ,
130
- " -c" ,
131
- " -Xclang" ,
132
- " -disable-O0-optnone" ,
133
- " -g" ,
134
- " -fstandalone-debug" ,
135
- " -fno-discard-value-names" ,
136
- " -fno-elide-constructors" ,
137
- " -D" + PrinterUtils::KLEE_MODE + " =1" ,
138
- SanitizerUtils::CLANG_SANITIZER_CHECKS_FLAG };
139
- if (Paths::isCXXFile (srcFilePath)) {
129
+ std:: vector<std:: string> extraFlags{ " -emit-llvm" ,
130
+ " -c" ,
131
+ " -Xclang" ,
132
+ " -disable-O0-optnone" ,
133
+ " -g" ,
134
+ " -fstandalone-debug" ,
135
+ " -fno-discard-value-names" ,
136
+ " -fno-elide-constructors" ,
137
+ " -D" + PrinterUtils::KLEE_MODE + " =1" ,
138
+ SanitizerUtils::CLANG_SANITIZER_CHECKS_FLAG };
139
+ if (Paths::isCXXFile (srcFilePath)) {
140
140
command.addFlagToBegin (StringUtils::stringFormat (" -I%s" , Paths::getAccessPrivateLibPath ()));
141
141
}
142
142
command.addFlagsToBegin (flags);
@@ -147,10 +147,10 @@ KleeGenerator::getCompileCommandForKlee(const fs::path &hintPath,
147
147
return command;
148
148
}
149
149
150
- vector<utbot::CompileCommand>
150
+ std:: vector<utbot::CompileCommand>
151
151
KleeGenerator::getCompileCommandsForKlee (const CollectionUtils::MapFileTo<fs::path> &filesToBuild,
152
152
const CollectionUtils::FileSet &stubSources) const {
153
- vector<utbot::CompileCommand> compileCommands;
153
+ std:: vector<utbot::CompileCommand> compileCommands;
154
154
compileCommands.reserve (filesToBuild.size ());
155
155
for (const auto &[fileToBuild, bitcode] : filesToBuild) {
156
156
auto optionalCommand = getCompileCommandForKlee (fileToBuild, stubSources, {});
@@ -167,12 +167,12 @@ KleeGenerator::getCompileCommandsForKlee(const CollectionUtils::MapFileTo<fs::pa
167
167
Result<fs::path> KleeGenerator::defaultBuild (const fs::path &hintPath,
168
168
const fs::path &sourceFilePath,
169
169
const fs::path &buildDirPath,
170
- const vector<string> &flags) {
170
+ const std:: vector<std:: string> &flags) {
171
171
LOG_SCOPE_FUNCTION (DEBUG);
172
172
auto bitcodeFilePath = buildDatabase->getBitcodeFile (sourceFilePath);
173
173
auto optionalCommand = getCompileCommandForKlee (hintPath, {}, flags);
174
174
if (!optionalCommand.has_value ()) {
175
- string message = StringUtils::stringFormat (
175
+ std:: string message = StringUtils::stringFormat (
176
176
" Couldn't get command for klee file: %s\n "
177
177
" Please check if directory is in source directories in UTBot extension settings: %s" ,
178
178
sourceFilePath, hintPath.parent_path ().string ());
@@ -194,7 +194,7 @@ Result<fs::path> KleeGenerator::defaultBuild(const fs::path &hintPath,
194
194
195
195
Result<fs::path> KleeGenerator::defaultBuild (const fs::path &sourceFilePath,
196
196
const fs::path &buildDirPath,
197
- const vector<string> &flags) {
197
+ const std:: vector<std:: string> &flags) {
198
198
return defaultBuild (sourceFilePath, sourceFilePath, buildDirPath, flags);
199
199
}
200
200
@@ -214,9 +214,9 @@ fs::path KleeGenerator::writeKleeFile(
214
214
}
215
215
}
216
216
217
- vector<fs::path> KleeGenerator::buildKleeFiles (const tests::TestsMap &testsMap,
217
+ std:: vector<fs::path> KleeGenerator::buildKleeFiles (const tests::TestsMap &testsMap,
218
218
const std::shared_ptr<LineInfo> &lineInfo) {
219
- vector<fs::path> outFiles;
219
+ std:: vector<fs::path> outFiles;
220
220
LOG_S (DEBUG) << " Building generated klee files..." ;
221
221
printer::KleePrinter kleePrinter (&typesHandler, buildDatabase, utbot::Language::UNKNOWN);
222
222
ExecUtils::doWorkWithProgress (
@@ -251,7 +251,7 @@ vector<fs::path> KleeGenerator::buildKleeFiles(const tests::TestsMap &testsMap,
251
251
<< " couldn't be compiled so it's copy is backed up in " << tempKleeFilePath
252
252
<< " . Proceeding with generating klee file containing restricted number "
253
253
" of functions" ;
254
- std::unordered_set<string> correctMethods;
254
+ std::unordered_set<std:: string> correctMethods;
255
255
for (const auto &[methodName, methodDescription] : tests.methods ) {
256
256
fs::path currentKleeFilePath = kleePrinter.writeTmpKleeFile (
257
257
tests, projectTmpPath, pathSubstitution, std::nullopt,
@@ -292,8 +292,8 @@ vector<fs::path> KleeGenerator::buildKleeFiles(const tests::TestsMap &testsMap,
292
292
293
293
void KleeGenerator::parseKTestsToFinalCode (
294
294
tests::Tests &tests,
295
- const std::unordered_map<string, types::Type> &methodNameToReturnTypeMap,
296
- const vector<MethodKtests> &kleeOutput,
295
+ const std::unordered_map<std:: string, types::Type> &methodNameToReturnTypeMap,
296
+ const std:: vector<MethodKtests> &kleeOutput,
297
297
const std::shared_ptr<LineInfo> &lineInfo,
298
298
bool verbose) {
299
299
for (const auto &batch : kleeOutput) {
@@ -305,7 +305,7 @@ void KleeGenerator::parseKTestsToFinalCode(
305
305
}
306
306
printer::TestsPrinter testsPrinter (&typesHandler, Paths::getSourceLanguage (tests.sourceFilePath ));
307
307
for (auto it = tests.methods .begin (); it != tests.methods .end (); it++) {
308
- const string &methodName = it.key ();
308
+ const std:: string &methodName = it.key ();
309
309
Tests::MethodDescription &methodDescription = it.value ();
310
310
if (lineInfo) {
311
311
bool methodNotMatch = lineInfo->forMethod && methodName != lineInfo->methodName ;
@@ -330,7 +330,7 @@ void KleeGenerator::parseKTestsToFinalCode(
330
330
LOG_S (DEBUG) << " Generated code for " << tests.methods .size () << " tests" ;
331
331
}
332
332
333
- shared_ptr<BuildDatabase> KleeGenerator::getBuildDatabase () const {
333
+ std:: shared_ptr<BuildDatabase> KleeGenerator::getBuildDatabase () const {
334
334
return buildDatabase;
335
335
}
336
336
0 commit comments