Skip to content

Commit

Permalink
[Tooling] Avoid diagnosing missing input files in an edge-case where …
Browse files Browse the repository at this point in the history
…it's incorrect.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@346485 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
sam-mccall committed Nov 9, 2018
1 parent c82f514 commit 33834d3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/Tooling/Tooling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 33834d3

Please sign in to comment.