From: Sam McCall Date: Fri, 9 Nov 2018 11:49:22 +0000 (+0000) Subject: [Tooling] Avoid diagnosing missing input files in an edge-case where it's incorrect. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=33834d33328b04607147a0352b67da76b85029bf;p=clang [Tooling] Avoid diagnosing missing input files in an edge-case where it's incorrect. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@346485 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Tooling/Tooling.cpp b/lib/Tooling/Tooling.cpp index f143f7fe71..cfdb32f0ae 100644 --- a/lib/Tooling/Tooling.cpp +++ b/lib/Tooling/Tooling.cpp @@ -303,6 +303,12 @@ bool ToolInvocation::run() { const std::unique_ptr Driver( newDriver(&Diagnostics, BinaryName, Files->getVirtualFileSystem())); + // The "input file not found" diagnostics from the driver are useful. + // The driver is only aware of the VFS working directory, but some clients + // change this at the FileManager level instead. + // In this case the checks have false positives, so skip them. + if (!Files->getFileSystemOpts().WorkingDir.empty()) + Driver->setCheckInputsExist(false); const std::unique_ptr Compilation( Driver->BuildCompilation(llvm::makeArrayRef(Argv))); if (!Compilation)