From: Douglas Gregor Date: Thu, 23 Apr 2009 02:42:49 +0000 (+0000) Subject: PCH (de-)serialization for ObjCImplDecl. This can't be tested yet. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2c2d43c557beca1b4ba4bd743f33978aecb46a97;p=clang PCH (de-)serialization for ObjCImplDecl. This can't be tested yet. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69855 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/DeclObjC.h b/include/clang/AST/DeclObjC.h index 6e32215b30..de32afa18f 100644 --- a/include/clang/AST/DeclObjC.h +++ b/include/clang/AST/DeclObjC.h @@ -809,12 +809,15 @@ public: const ObjCInterfaceDecl *getClassInterface() const { return ClassInterface; } ObjCInterfaceDecl *getClassInterface() { return ClassInterface; } - + void setClassInterface(ObjCInterfaceDecl *IFace) { ClassInterface = IFace; } + void addInstanceMethod(ASTContext &Context, ObjCMethodDecl *method) { + // FIXME: Context should be set correctly before we get here. method->setLexicalDeclContext(this); addDecl(Context, method); } void addClassMethod(ASTContext &Context, ObjCMethodDecl *method) { + // FIXME: Context should be set correctly before we get here. method->setLexicalDeclContext(this); addDecl(Context, method); } diff --git a/lib/AST/DeclObjC.cpp b/lib/AST/DeclObjC.cpp index 3bffbf54ac..49ff6d53c0 100644 --- a/lib/AST/DeclObjC.cpp +++ b/lib/AST/DeclObjC.cpp @@ -543,6 +543,7 @@ ObjCCategoryImplDecl::Create(ASTContext &C, DeclContext *DC, void ObjCImplDecl::addPropertyImplementation(ASTContext &Context, ObjCPropertyImplDecl *property) { + // FIXME: The context should be correct before we get here. property->setLexicalDeclContext(this); addDecl(Context, property); } diff --git a/lib/Frontend/PCHReader.cpp b/lib/Frontend/PCHReader.cpp index e2cffb5454..c3d4bcfa52 100644 --- a/lib/Frontend/PCHReader.cpp +++ b/lib/Frontend/PCHReader.cpp @@ -322,7 +322,9 @@ void PCHDeclReader::VisitObjCPropertyDecl(ObjCPropertyDecl *D) { void PCHDeclReader::VisitObjCImplDecl(ObjCImplDecl *D) { VisitDecl(D); - // FIXME: Implement. + D->setClassInterface( + cast_or_null(Reader.GetDecl(Record[Idx++]))); + D->setLocEnd(SourceLocation::getFromRawEncoding(Record[Idx++])); } void PCHDeclReader::VisitObjCCategoryImplDecl(ObjCCategoryImplDecl *D) { diff --git a/lib/Frontend/PCHWriter.cpp b/lib/Frontend/PCHWriter.cpp index a3b1253a66..36d9170f38 100644 --- a/lib/Frontend/PCHWriter.cpp +++ b/lib/Frontend/PCHWriter.cpp @@ -493,7 +493,8 @@ void PCHDeclWriter::VisitObjCPropertyDecl(ObjCPropertyDecl *D) { void PCHDeclWriter::VisitObjCImplDecl(ObjCImplDecl *D) { VisitDecl(D); - // FIXME: Implement. + Writer.AddDeclRef(D->getClassInterface(), Record); + Writer.AddSourceLocation(D->getLocEnd(), Record); // Abstract class (no need to define a stable pch::DECL code). }