summaryrefslogtreecommitdiffstats
path: root/clang/lib/Tooling/Tooling.cpp
diff options
context:
space:
mode:
authorSam McCall <sam.mccall@gmail.com>2018-11-09 11:49:22 +0000
committerSam McCall <sam.mccall@gmail.com>2018-11-09 11:49:22 +0000
commit5f5bc993407cf9ec0850ce8edd14f4e129e4b46c (patch)
tree8d18f614b7fc726aeea2ef36cd9a1d8c197ef3ae /clang/lib/Tooling/Tooling.cpp
parente15c982f6d6ae355d8fbf9c9272ac549785b68e2 (diff)
downloadbcm5719-llvm-5f5bc993407cf9ec0850ce8edd14f4e129e4b46c.tar.gz
bcm5719-llvm-5f5bc993407cf9ec0850ce8edd14f4e129e4b46c.zip
[Tooling] Avoid diagnosing missing input files in an edge-case where it's incorrect.
llvm-svn: 346485
Diffstat (limited to 'clang/lib/Tooling/Tooling.cpp')
-rw-r--r--clang/lib/Tooling/Tooling.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Tooling/Tooling.cpp b/clang/lib/Tooling/Tooling.cpp
index f143f7fe71f..cfdb32f0ae6 100644
--- a/clang/lib/Tooling/Tooling.cpp
+++ b/clang/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)
OpenPOWER on IntegriCloud