Author: sammccall Date: Thu Nov 8 08:57:01 2018 New Revision: 346414 URL: http://llvm.org/viewvc/llvm-project?rev=346414&view=rev Log: [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 Modified: cfe/trunk/lib/Driver/Driver.cpp cfe/trunk/lib/Tooling/Tooling.cpp Modified: cfe/trunk/lib/Driver/Driver.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=346414&r1=346413&r2=346414&view=diff ============================================================================== --- cfe/trunk/lib/Driver/Driver.cpp (original) +++ cfe/trunk/lib/Driver/Driver.cpp Thu Nov 8 08:57:01 2018 @@ -1972,7 +1972,7 @@ static bool DiagnoseInputExistence(const } } - if (llvm::sys::fs::exists(Twine(Path))) + if (D.getVFS().exists(Path)) return true; if (D.IsCLMode()) { Modified: cfe/trunk/lib/Tooling/Tooling.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Tooling/Tooling.cpp?rev=346414&r1=346413&r2=346414&view=diff ============================================================================== --- cfe/trunk/lib/Tooling/Tooling.cpp (original) +++ cfe/trunk/lib/Tooling/Tooling.cpp Thu Nov 8 08:57:01 2018 @@ -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) _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits