]> granicus.if.org Git - clang/commitdiff
PCH (de-)serialization for ObjCImplDecl. This can't be tested yet.
authorDouglas Gregor <dgregor@apple.com>
Thu, 23 Apr 2009 02:42:49 +0000 (02:42 +0000)
committerDouglas Gregor <dgregor@apple.com>
Thu, 23 Apr 2009 02:42:49 +0000 (02:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69855 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/DeclObjC.h
lib/AST/DeclObjC.cpp
lib/Frontend/PCHReader.cpp
lib/Frontend/PCHWriter.cpp

index 6e32215b30480d2368becc9d01c7d4fe9c7e4d3f..de32afa18f5cd3bd652680e7a3456f70e5b9eb2d 100644 (file)
@@ -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); 
   }
index 3bffbf54ac505b1a0d2bcdfcabf49128fb05695a..49ff6d53c00851b0acbe54245078ceac386a3de1 100644 (file)
@@ -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);
 }
index e2cffb54543d8f9d2e44054ca0866a24e427db30..c3d4bcfa52990653f42325583f1c55c2088300cf 100644 (file)
@@ -322,7 +322,9 @@ void PCHDeclReader::VisitObjCPropertyDecl(ObjCPropertyDecl *D) {
 
 void PCHDeclReader::VisitObjCImplDecl(ObjCImplDecl *D) {
   VisitDecl(D);
-  // FIXME: Implement.
+  D->setClassInterface(
+              cast_or_null<ObjCInterfaceDecl>(Reader.GetDecl(Record[Idx++])));
+  D->setLocEnd(SourceLocation::getFromRawEncoding(Record[Idx++]));
 }
 
 void PCHDeclReader::VisitObjCCategoryImplDecl(ObjCCategoryImplDecl *D) {
index a3b1253a66531e46be0671b55a6f0555980239be..36d9170f38a3e3e7c3530b0a1a94145f8e24c2da 100644 (file)
@@ -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).
 }