@@ -345,18 +345,18 @@ class MessageEmitter {
345345
346346enum CXErrorCode clang_experimental_DependencyScanner_generateReproducer (
347347 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 );
351351 };
352- auto reportFailure = [&report ]() -> MessageEmitter {
353- return report (CXError_Failure);
352+ auto ReportFailure = [&Report ]() -> MessageEmitter {
353+ return Report (CXError_Failure);
354354 };
355355
356356 if (argc < 2 || !argv)
357- return report (CXError_InvalidArguments) << " missing compilation command" ;
357+ return Report (CXError_InvalidArguments) << " missing compilation command" ;
358358 if (!WorkingDirectory)
359- return report (CXError_InvalidArguments) << " missing working directory" ;
359+ return Report (CXError_InvalidArguments) << " missing working directory" ;
360360
361361 CASOptions CASOpts;
362362 IntrusiveRefCntPtr<llvm::cas::CachingOnDiskFileSystem> FS;
@@ -369,7 +369,7 @@ enum CXErrorCode clang_experimental_DependencyScanner_generateReproducer(
369369 int ScriptFD;
370370 if (auto EC = llvm::sys::fs::createTemporaryFile (" reproducer" , " sh" , ScriptFD,
371371 ReproScriptPath)) {
372- return reportFailure () << " failed to create a reproducer script file" ;
372+ return ReportFailure () << " failed to create a reproducer script file" ;
373373 }
374374 SmallString<128 > FileCachePath = ReproScriptPath;
375375 llvm::sys::path::replace_extension (FileCachePath, " .cache" );
@@ -388,15 +388,14 @@ enum CXErrorCode clang_experimental_DependencyScanner_generateReproducer(
388388 auto TUDepsOrErr = DepsTool.getTranslationUnitDependencies (
389389 Compilation, WorkingDirectory, AlreadySeen, std::move (LookupOutput));
390390 if (!TUDepsOrErr)
391- return reportFailure () << " failed to generate a reproducer\n "
391+ return ReportFailure () << " failed to generate a reproducer\n "
392392 << toString (TUDepsOrErr.takeError ());
393393
394394 TranslationUnitDeps TU = *TUDepsOrErr;
395395 llvm::raw_fd_ostream ScriptOS (ScriptFD, /* shouldClose=*/ true );
396396 ScriptOS << " # Original command:\n #" ;
397- for (StringRef cliArg : Compilation) {
398- ScriptOS << ' ' << cliArg;
399- }
397+ for (StringRef Arg : Compilation)
398+ ScriptOS << ' ' << Arg;
400399 ScriptOS << " \n\n " ;
401400
402401 ScriptOS << " # Dependencies:\n " ;
@@ -410,34 +409,34 @@ enum CXErrorCode clang_experimental_DependencyScanner_generateReproducer(
410409 OS << " -ivfsoverlay \" " << FileCacheName << " /vfs/vfs.yaml\" " ;
411410 OS << ' \n ' ;
412411 };
413- for (ModuleDeps &dep : TU.ModuleGraph )
414- PrintArguments (ScriptOS, dep .getBuildArguments ());
412+ for (ModuleDeps &Dep : TU.ModuleGraph )
413+ PrintArguments (ScriptOS, Dep .getBuildArguments ());
415414 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 );
418417
419418 SmallString<128 > VFSCachePath = FileCachePath;
420419 llvm::sys::path::append (VFSCachePath, " vfs" );
421420 std::string VFSCachePathStr = VFSCachePath.str ().str ();
422- llvm::FileCollector fileCollector (VFSCachePathStr,
421+ llvm::FileCollector FileCollector (VFSCachePathStr,
423422 /* OverlayRoot=*/ VFSCachePathStr);
424- for (const auto &fileDep : TU.FileDeps ) {
425- fileCollector .addFile (fileDep );
423+ for (const auto &FileDep : TU.FileDeps ) {
424+ FileCollector .addFile (FileDep );
426425 }
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 );
430429 });
431430 }
432- if (fileCollector .copyFiles (/* StopOnError=*/ true ))
433- return reportFailure ()
431+ if (FileCollector .copyFiles (/* StopOnError=*/ true ))
432+ return ReportFailure ()
434433 << " failed to copy the files used for the compilation" ;
435434 SmallString<128 > VFSOverlayPath = VFSCachePath;
436435 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" ;
439438
440- return report (CXError_Success)
439+ return Report (CXError_Success)
441440 << " Created a reproducer. Sources and associated run script(s) are "
442441 " located at:\n "
443442 << FileCachePath << " \n " << ReproScriptPath;
0 commit comments