diff options
author | Sam McCall <sam.mccall@gmail.com> | 2018-11-09 11:49:22 +0000 |
---|---|---|
committer | Sam McCall <sam.mccall@gmail.com> | 2018-11-09 11:49:22 +0000 |
commit | 33834d33328b04607147a0352b67da76b85029bf (patch) | |
tree | 5af0b8c7b4cb46ab06af55e506e528944029f642 | |
parent | c82f5141e9ef1758d97cc4ff8a25e3b58628efc9 (diff) |
[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
-rw-r--r-- | lib/Tooling/Tooling.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
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::Driver> 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<driver::Compilation> Compilation( Driver->BuildCompilation(llvm::makeArrayRef(Argv))); if (!Compilation) |