aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/PCHWriter.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-04-18 00:02:19 +0000
committerDouglas Gregor <dgregor@apple.com>2009-04-18 00:02:19 +0000
commit7297134f128423fce2e88f92421ed135bded7d4e (patch)
tree8df6b1ae77f5063393a822109210f9619976e995 /lib/Frontend/PCHWriter.cpp
parent95d0281798d837041272c4dbeed37b33ca0f2b0d (diff)
FunctionDecl::getBody() is getting an ASTContext argument for use in
lazy PCH deserialization. Propagate that argument wherever it needs to be. No functionality change, except that I've tightened up a few PCH tests in preparation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69406 91177308-0d34-0410-b5e6-96231b3b80d8
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();