diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-01-21 18:45:42 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-01-21 18:45:42 +0000 |
commit | 3ad52ede46729b458c4dd2bd58aa0cf717854105 (patch) | |
tree | 5e34948caa94a59e1197da24c4641c34fec666c9 | |
parent | a60e9268b640402f65bdb949bd2e981818cf0720 (diff) | |
download | bcm5719-llvm-3ad52ede46729b458c4dd2bd58aa0cf717854105.tar.gz bcm5719-llvm-3ad52ede46729b458c4dd2bd58aa0cf717854105.zip |
[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
-rw-r--r-- | clang/lib/Frontend/ASTUnit.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp index 9ab3a8faba4..4feaad81e64 100644 --- a/clang/lib/Frontend/ASTUnit.cpp +++ b/clang/lib/Frontend/ASTUnit.cpp @@ -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. |