]> granicus.if.org Git - clang/commitdiff
[Tooling] Produce diagnostics for missing input files.
authorSam McCall <sam.mccall@gmail.com>
Thu, 8 Nov 2018 16:57:01 +0000 (16:57 +0000)
committerSam McCall <sam.mccall@gmail.com>
Thu, 8 Nov 2018 16:57:01 +0000 (16:57 +0000)
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

lib/Driver/Driver.cpp
lib/Tooling/Tooling.cpp

index 18fc4b7eabc5b2e1c6dc315e0ff6c980821a4f2d..c784fec136689e97d46c9dd862870edd71076dad 100644 (file)
@@ -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()) {
index eb9451d8b76b593ce7b10234c5fde83a9628b5e1..f143f7fe71f5fd79ac3e80bb573930bb34df3500 100644 (file)
@@ -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)