diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-04-18 00:02:19 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-04-18 00:02:19 +0000 |
commit | e3dcb2ddd11d76b5b0a394f8c33437a38810bcb7 (patch) | |
tree | 775d32110ec52aac4047847f3a5fa36977e597da /clang/lib/Frontend/PCHWriter.cpp | |
parent | 7d59a92b457ed8e9a6749e08ab06a0486494699c (diff) | |
download | bcm5719-llvm-e3dcb2ddd11d76b5b0a394f8c33437a38810bcb7.tar.gz bcm5719-llvm-e3dcb2ddd11d76b5b0a394f8c33437a38810bcb7.zip |
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.
llvm-svn: 69406
Diffstat (limited to 'clang/lib/Frontend/PCHWriter.cpp')
-rw-r--r-- | clang/lib/Frontend/PCHWriter.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/clang/lib/Frontend/PCHWriter.cpp b/clang/lib/Frontend/PCHWriter.cpp index 64bf3833b4f..d7f0cd3497f 100644 --- a/clang/lib/Frontend/PCHWriter.cpp +++ b/clang/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(); |