@@ -388,6 +388,7 @@ int ClangTool::run(ToolAction *Action) {
388
388
llvm::MemoryBuffer::getMemBuffer (MappedFile.second ));
389
389
390
390
bool ProcessingFailed = false ;
391
+ bool FileSkipped = false ;
391
392
for (const auto &SourcePath : SourcePaths) {
392
393
std::string File (getAbsolutePath (SourcePath));
393
394
@@ -401,12 +402,8 @@ int ClangTool::run(ToolAction *Action) {
401
402
std::vector<CompileCommand> CompileCommandsForFile =
402
403
Compilations.getCompileCommands (File);
403
404
if (CompileCommandsForFile.empty ()) {
404
- // FIXME: There are two use cases here: doing a fuzzy
405
- // "find . -name '*.cc' |xargs tool" match, where as a user I don't care
406
- // about the .cc files that were not found, and the use case where I
407
- // specify all files I want to run over explicitly, where this should
408
- // be an error. We'll want to add an option for this.
409
405
llvm::errs () << " Skipping " << File << " . Compile command not found.\n " ;
406
+ FileSkipped = true ;
410
407
continue ;
411
408
}
412
409
for (CompileCommand &CompileCommand : CompileCommandsForFile) {
@@ -466,7 +463,7 @@ int ClangTool::run(ToolAction *Action) {
466
463
Twine (InitialDirectory) + " \n !" );
467
464
}
468
465
}
469
- return ProcessingFailed ? 1 : 0 ;
466
+ return ProcessingFailed ? 1 : (FileSkipped ? 2 : 0 ) ;
470
467
}
471
468
472
469
namespace {
0 commit comments