summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-01-21 18:45:42 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-01-21 18:45:42 +0000
commit3ad52ede46729b458c4dd2bd58aa0cf717854105 (patch)
tree5e34948caa94a59e1197da24c4641c34fec666c9
parenta60e9268b640402f65bdb949bd2e981818cf0720 (diff)
downloadbcm5719-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.cpp2
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.
OpenPOWER on IntegriCloud