]> granicus.if.org Git - clang/commitdiff
[Tooling] Don't run a tool invocation without a FileManager.
authorBenjamin Kramer <benny.kra@googlemail.com>
Tue, 6 Oct 2015 15:04:13 +0000 (15:04 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Tue, 6 Oct 2015 15:04:13 +0000 (15:04 +0000)
Fixes a crash regression from r249410.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@249413 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Tooling/Tooling.cpp

index 8c7ed78d4149dcdda6ff389fcef06778dd012d09..c31860b1aa99513a3bf8eafdf21ab431d68367e4 100644 (file)
@@ -455,8 +455,10 @@ std::unique_ptr<ASTUnit> buildASTFromCodeWithArgs(
 
   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,