Unlike LoadFromCommandLine, LoadFromCompilerInvocation(the one with many arguments) causes a crash if Precompilepreamble is set to true because there is no FileManager at that point. Two methods are not in sync despite being very similar..
Index: lib/Frontend/ASTUnit.cpp
===================================================================
--- lib/Frontend/ASTUnit.cpp (revision 172881)
+++ lib/Frontend/ASTUnit.cpp (working copy)
@@ -1913,6 +1913,8 @@
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.
ASTUnit.patch
Description: Binary data
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
