[cfe-commits] [PATCH] AstUnit::LoadFromCompilerInvocation

Hurcan Solter hsolter at gmail.com
Fri Jan 18 18:44:44 PST 2013


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130119/93268ff8/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ASTUnit.patch
Type: application/octet-stream
Size: 560 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130119/93268ff8/attachment.obj>


More information about the cfe-commits mailing list