diff options
author | Sam McCall <sam.mccall@gmail.com> | 2018-11-08 16:57:01 +0000 |
---|---|---|
committer | Sam McCall <sam.mccall@gmail.com> | 2018-11-08 16:57:01 +0000 |
commit | 2c782470411ec028c23ea60fa9ba388a8fa10b58 (patch) | |
tree | 21e5b3e91fc1586e460e56ae3ce4232611df0423 | |
parent | 4bbdebc49a9853461322cf3e9911f16f06a2ac3b (diff) | |
download | bcm5719-llvm-2c782470411ec028c23ea60fa9ba388a8fa10b58.tar.gz bcm5719-llvm-2c782470411ec028c23ea60fa9ba388a8fa10b58.zip |
[Tooling] Produce diagnostics for missing input files.
Summary:
This was disabled way back in 2011, in the dark times before Driver was VFS-aware.
Also, make driver more VFS-aware :-)
This breaks one ClangTidy test (we improved the error message), will fix when
submitting.
Reviewers: ioeric
Subscribers: cfe-commits, alexfh
Differential Revision: https://reviews.llvm.org/D53958
llvm-svn: 346414
-rw-r--r-- | clang/lib/Driver/Driver.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Tooling/Tooling.cpp | 2 |
2 files changed, 1 insertions, 3 deletions
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index 18fc4b7eabc..c784fec1366 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -1972,7 +1972,7 @@ static bool DiagnoseInputExistence(const Driver &D, const DerivedArgList &Args, } } - if (llvm::sys::fs::exists(Twine(Path))) + if (D.getVFS().exists(Path)) return true; if (D.IsCLMode()) { diff --git a/clang/lib/Tooling/Tooling.cpp b/clang/lib/Tooling/Tooling.cpp index eb9451d8b76..f143f7fe71f 100644 --- a/clang/lib/Tooling/Tooling.cpp +++ b/clang/lib/Tooling/Tooling.cpp @@ -303,8 +303,6 @@ bool ToolInvocation::run() { const std::unique_ptr<driver::Driver> Driver( newDriver(&Diagnostics, BinaryName, Files->getVirtualFileSystem())); - // Since the input might only be virtual, don't check whether it exists. - Driver->setCheckInputsExist(false); const std::unique_ptr<driver::Compilation> Compilation( Driver->BuildCompilation(llvm::makeArrayRef(Argv))); if (!Compilation) |