[ASTUnit] Unlike LoadFromCommandLine, LoadFromCompilerInvocation causes a crash if Precompilepreamble
is set to true because there is no FileManager at that point. Patch by Hurcan Solter! llvm-svn: 173071
This commit is contained in:
@@ -1912,6 +1912,8 @@ ASTUnit *ASTUnit::LoadFromCompilerInvocation(CompilerInvocation *CI,
|
||||
AST->IncludeBriefCommentsInCodeCompletion
|
||||
= IncludeBriefCommentsInCodeCompletion;
|
||||
AST->Invocation = CI;
|
||||
AST->FileSystemOpts = CI->getFileSystemOpts();
|
||||
AST->FileMgr = new FileManager(AST->FileSystemOpts);
|
||||
AST->UserFilesAreVolatile = UserFilesAreVolatile;
|
||||
|
||||
// Recover resources if we crash before exiting this method.
|
||||
|
||||
Reference in New Issue
Block a user