@@ -345,18 +345,18 @@ class MessageEmitter {
345
345
346
346
enum CXErrorCode clang_experimental_DependencyScanner_generateReproducer (
347
347
int argc, const char *const *argv, const char *WorkingDirectory,
348
- CXString *messageOut ) {
349
- auto report = [messageOut ](CXErrorCode errorCode ) -> MessageEmitter {
350
- return MessageEmitter (errorCode, messageOut );
348
+ CXString *MessageOut ) {
349
+ auto Report = [MessageOut ](CXErrorCode ErrorCode ) -> MessageEmitter {
350
+ return MessageEmitter (ErrorCode, MessageOut );
351
351
};
352
- auto reportFailure = [&report ]() -> MessageEmitter {
353
- return report (CXError_Failure);
352
+ auto ReportFailure = [&Report ]() -> MessageEmitter {
353
+ return Report (CXError_Failure);
354
354
};
355
355
356
356
if (argc < 2 || !argv)
357
- return report (CXError_InvalidArguments) << " missing compilation command" ;
357
+ return Report (CXError_InvalidArguments) << " missing compilation command" ;
358
358
if (!WorkingDirectory)
359
- return report (CXError_InvalidArguments) << " missing working directory" ;
359
+ return Report (CXError_InvalidArguments) << " missing working directory" ;
360
360
361
361
CASOptions CASOpts;
362
362
IntrusiveRefCntPtr<llvm::cas::CachingOnDiskFileSystem> FS;
@@ -369,7 +369,7 @@ enum CXErrorCode clang_experimental_DependencyScanner_generateReproducer(
369
369
int ScriptFD;
370
370
if (auto EC = llvm::sys::fs::createTemporaryFile (" reproducer" , " sh" , ScriptFD,
371
371
ReproScriptPath)) {
372
- return reportFailure () << " failed to create a reproducer script file" ;
372
+ return ReportFailure () << " failed to create a reproducer script file" ;
373
373
}
374
374
SmallString<128 > FileCachePath = ReproScriptPath;
375
375
llvm::sys::path::replace_extension (FileCachePath, " .cache" );
@@ -388,15 +388,14 @@ enum CXErrorCode clang_experimental_DependencyScanner_generateReproducer(
388
388
auto TUDepsOrErr = DepsTool.getTranslationUnitDependencies (
389
389
Compilation, WorkingDirectory, AlreadySeen, std::move (LookupOutput));
390
390
if (!TUDepsOrErr)
391
- return reportFailure () << " failed to generate a reproducer\n "
391
+ return ReportFailure () << " failed to generate a reproducer\n "
392
392
<< toString (TUDepsOrErr.takeError ());
393
393
394
394
TranslationUnitDeps TU = *TUDepsOrErr;
395
395
llvm::raw_fd_ostream ScriptOS (ScriptFD, /* shouldClose=*/ true );
396
396
ScriptOS << " # Original command:\n #" ;
397
- for (StringRef cliArg : Compilation) {
398
- ScriptOS << ' ' << cliArg;
399
- }
397
+ for (StringRef Arg : Compilation)
398
+ ScriptOS << ' ' << Arg;
400
399
ScriptOS << " \n\n " ;
401
400
402
401
ScriptOS << " # Dependencies:\n " ;
@@ -410,34 +409,34 @@ enum CXErrorCode clang_experimental_DependencyScanner_generateReproducer(
410
409
OS << " -ivfsoverlay \" " << FileCacheName << " /vfs/vfs.yaml\" " ;
411
410
OS << ' \n ' ;
412
411
};
413
- for (ModuleDeps &dep : TU.ModuleGraph )
414
- PrintArguments (ScriptOS, dep .getBuildArguments ());
412
+ for (ModuleDeps &Dep : TU.ModuleGraph )
413
+ PrintArguments (ScriptOS, Dep .getBuildArguments ());
415
414
ScriptOS << " \n # Translation unit:\n " ;
416
- for (const Command &buildCommand : TU.Commands )
417
- PrintArguments (ScriptOS, buildCommand .Arguments );
415
+ for (const Command &BuildCommand : TU.Commands )
416
+ PrintArguments (ScriptOS, BuildCommand .Arguments );
418
417
419
418
SmallString<128 > VFSCachePath = FileCachePath;
420
419
llvm::sys::path::append (VFSCachePath, " vfs" );
421
420
std::string VFSCachePathStr = VFSCachePath.str ().str ();
422
- llvm::FileCollector fileCollector (VFSCachePathStr,
421
+ llvm::FileCollector FileCollector (VFSCachePathStr,
423
422
/* OverlayRoot=*/ VFSCachePathStr);
424
- for (const auto &fileDep : TU.FileDeps ) {
425
- fileCollector .addFile (fileDep );
423
+ for (const auto &FileDep : TU.FileDeps ) {
424
+ FileCollector .addFile (FileDep );
426
425
}
427
- for (ModuleDeps &dep : TU.ModuleGraph ) {
428
- dep .forEachFileDep ([&fileCollector ](StringRef fileDep ) {
429
- fileCollector .addFile (fileDep );
426
+ for (ModuleDeps &ModuleDep : TU.ModuleGraph ) {
427
+ ModuleDep .forEachFileDep ([&FileCollector ](StringRef FileDep ) {
428
+ FileCollector .addFile (FileDep );
430
429
});
431
430
}
432
- if (fileCollector .copyFiles (/* StopOnError=*/ true ))
433
- return reportFailure ()
431
+ if (FileCollector .copyFiles (/* StopOnError=*/ true ))
432
+ return ReportFailure ()
434
433
<< " failed to copy the files used for the compilation" ;
435
434
SmallString<128 > VFSOverlayPath = VFSCachePath;
436
435
llvm::sys::path::append (VFSOverlayPath, " vfs.yaml" );
437
- if (fileCollector .writeMapping (VFSOverlayPath))
438
- return reportFailure () << " failed to write a VFS overlay mapping" ;
436
+ if (FileCollector .writeMapping (VFSOverlayPath))
437
+ return ReportFailure () << " failed to write a VFS overlay mapping" ;
439
438
440
- return report (CXError_Success)
439
+ return Report (CXError_Success)
441
440
<< " Created a reproducer. Sources and associated run script(s) are "
442
441
" located at:\n "
443
442
<< FileCachePath << " \n " << ReproScriptPath;
0 commit comments