aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/PCHWriter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Frontend/PCHWriter.cpp')
-rw-r--r--lib/Frontend/PCHWriter.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Frontend/PCHWriter.cpp b/lib/Frontend/PCHWriter.cpp
index 64bf3833b4..d7f0cd3497 100644
--- a/lib/Frontend/PCHWriter.cpp
+++ b/lib/Frontend/PCHWriter.cpp
@@ -241,13 +241,15 @@ namespace {
: public DeclVisitor<PCHDeclWriter, void> {
PCHWriter &Writer;
+ ASTContext &Context;
PCHWriter::RecordData &Record;
public:
pch::DeclCode Code;
- PCHDeclWriter(PCHWriter &Writer, PCHWriter::RecordData &Record)
- : Writer(Writer), Record(Record) { }
+ PCHDeclWriter(PCHWriter &Writer, ASTContext &Context,
+ PCHWriter::RecordData &Record)
+ : Writer(Writer), Context(Context), Record(Record) { }
void VisitDecl(Decl *D);
void VisitTranslationUnitDecl(TranslationUnitDecl *D);
@@ -340,7 +342,7 @@ void PCHDeclWriter::VisitFunctionDecl(FunctionDecl *D) {
VisitValueDecl(D);
Record.push_back(D->isThisDeclarationADefinition());
if (D->isThisDeclarationADefinition())
- Writer.AddStmt(D->getBody());
+ Writer.AddStmt(D->getBody(Context));
Writer.AddDeclRef(D->getPreviousDeclaration(), Record);
Record.push_back(D->getStorageClass()); // FIXME: stable encoding
Record.push_back(D->isInline());
@@ -1474,7 +1476,7 @@ void PCHWriter::WriteDeclsBlock(ASTContext &Context) {
// Emit all of the declarations.
RecordData Record;
- PCHDeclWriter W(*this, Record);
+ PCHDeclWriter W(*this, Context, Record);
while (!DeclsToEmit.empty()) {
// Pull the next declaration off the queue
Decl *D = DeclsToEmit.front();