From: Sam McCall Date: Thu, 8 Nov 2018 16:57:01 +0000 (+0000) Subject: [Tooling] Produce diagnostics for missing input files. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4f6cad78cf538ef8c8177ac4bc4e58858a8a3843;p=clang [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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@346414 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp index 18fc4b7eab..c784fec136 100644 --- a/lib/Driver/Driver.cpp +++ b/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/lib/Tooling/Tooling.cpp b/lib/Tooling/Tooling.cpp index eb9451d8b7..f143f7fe71 100644 --- a/lib/Tooling/Tooling.cpp +++ b/lib/Tooling/Tooling.cpp @@ -303,8 +303,6 @@ bool ToolInvocation::run() { const std::unique_ptr 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 Compilation( Driver->BuildCompilation(llvm::makeArrayRef(Argv))); if (!Compilation)