r249413 - [Tooling] Don't run a tool invocation without a FileManager.

Benjamin Kramer via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 6 08:04:14 PDT 2015


Author: d0k
Date: Tue Oct  6 10:04:13 2015
New Revision: 249413

URL: http://llvm.org/viewvc/llvm-project?rev=249413&view=rev
Log:
[Tooling] Don't run a tool invocation without a FileManager.

Fixes a crash regression from r249410.

Modified:
    cfe/trunk/lib/Tooling/Tooling.cpp

Modified: cfe/trunk/lib/Tooling/Tooling.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Tooling/Tooling.cpp?rev=249413&r1=249412&r2=249413&view=diff
==============================================================================
--- cfe/trunk/lib/Tooling/Tooling.cpp (original)
+++ cfe/trunk/lib/Tooling/Tooling.cpp Tue Oct  6 10:04:13 2015
@@ -455,8 +455,10 @@ std::unique_ptr<ASTUnit> buildASTFromCod
 
   std::vector<std::unique_ptr<ASTUnit>> ASTs;
   ASTBuilderAction Action(ASTs);
+  llvm::IntrusiveRefCntPtr<FileManager> Files(
+      new FileManager(FileSystemOptions()));
   ToolInvocation Invocation(getSyntaxOnlyToolArgs(Args, FileNameRef), &Action,
-                            nullptr, PCHContainerOps);
+                            Files.get(), PCHContainerOps);
 
   SmallString<1024> CodeStorage;
   Invocation.mapVirtualFile(FileNameRef,




More information about the cfe-commits mailing list