Pass the ASTContext object around when deserializing Decl and Stmt objects, so
they can be created using the same allocator as in the "from source code" case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49353 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/TranslationUnit.cpp b/lib/AST/TranslationUnit.cpp
index 3ad134a..b3a2e68 100644
--- a/lib/AST/TranslationUnit.cpp
+++ b/lib/AST/TranslationUnit.cpp
@@ -221,7 +221,7 @@
llvm::Deserializer::Location DeclBlockLoc = Dezr.getCurrentBlockLocation();
while (!Dezr.FinishedBlock(DeclBlockLoc))
- TU->AddTopLevelDecl(Dezr.ReadOwnedPtr<Decl>());
+ TU->AddTopLevelDecl(Dezr.ReadOwnedPtr<Decl>(*TU->Context));
return TU;
}