Author: ioeric
Date: Thu Jul 12 11:32:11 2018
New Revision: 336928

URL: http://llvm.org/viewvc/llvm-project?rev=336928&view=rev
Log:
[Tooling] Make standalone executor support user-provided vfs.

Modified:
    cfe/trunk/include/clang/Tooling/StandaloneExecution.h
    cfe/trunk/lib/Tooling/StandaloneExecution.cpp

Modified: cfe/trunk/include/clang/Tooling/StandaloneExecution.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Tooling/StandaloneExecution.h?rev=336928&r1=336927&r2=336928&view=diff
==============================================================================
--- cfe/trunk/include/clang/Tooling/StandaloneExecution.h (original)
+++ cfe/trunk/include/clang/Tooling/StandaloneExecution.h Thu Jul 12 11:32:11 
2018
@@ -37,6 +37,7 @@ public:
   StandaloneToolExecutor(
       const CompilationDatabase &Compilations,
       llvm::ArrayRef<std::string> SourcePaths,
+      IntrusiveRefCntPtr<vfs::FileSystem> BaseFS = vfs::getRealFileSystem(),
       std::shared_ptr<PCHContainerOperations> PCHContainerOps =
           std::make_shared<PCHContainerOperations>());
 

Modified: cfe/trunk/lib/Tooling/StandaloneExecution.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Tooling/StandaloneExecution.cpp?rev=336928&r1=336927&r2=336928&view=diff
==============================================================================
--- cfe/trunk/lib/Tooling/StandaloneExecution.cpp (original)
+++ cfe/trunk/lib/Tooling/StandaloneExecution.cpp Thu Jul 12 11:32:11 2018
@@ -30,9 +30,11 @@ static ArgumentsAdjuster getDefaultArgum
 StandaloneToolExecutor::StandaloneToolExecutor(
     const CompilationDatabase &Compilations,
     llvm::ArrayRef<std::string> SourcePaths,
+    IntrusiveRefCntPtr<vfs::FileSystem> BaseFS,
     std::shared_ptr<PCHContainerOperations> PCHContainerOps)
-    : Tool(Compilations, SourcePaths), Context(&Results),
-      ArgsAdjuster(getDefaultArgumentsAdjusters()) {
+    : Tool(Compilations, SourcePaths, std::move(PCHContainerOps),
+           std::move(BaseFS)),
+      Context(&Results), ArgsAdjuster(getDefaultArgumentsAdjusters()) {
   // Use self-defined default argument adjusters instead of the default
   // adjusters that come with the old `ClangTool`.
   Tool.clearArgumentsAdjusters();
@@ -43,7 +45,7 @@ StandaloneToolExecutor::StandaloneToolEx
     std::shared_ptr<PCHContainerOperations> PCHContainerOps)
     : OptionsParser(std::move(Options)),
       Tool(OptionsParser->getCompilations(), 
OptionsParser->getSourcePathList(),
-           PCHContainerOps),
+           std::move(PCHContainerOps)),
       Context(&Results), ArgsAdjuster(getDefaultArgumentsAdjusters()) {
   Tool.clearArgumentsAdjusters();
 }


_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to