]> granicus.if.org Git - clang/commitdiff
PCH support for ObjCPropertyImplDecl
authorDouglas Gregor <dgregor@apple.com>
Thu, 23 Apr 2009 03:43:53 +0000 (03:43 +0000)
committerDouglas Gregor <dgregor@apple.com>
Thu, 23 Apr 2009 03:43:53 +0000 (03:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69858 91177308-0d34-0410-b5e6-96231b3b80d8

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

index 1672aaa51f7189d3b1ea567194d050d71841e3d9..c68741ad5cc0b8e7bc73fefad8e881f4befdef38 100644 (file)
@@ -1179,11 +1179,13 @@ public:
                                       ObjCIvarDecl *ivarDecl);
 
   SourceLocation getLocStart() const { return AtLoc; }
+  void setAtLoc(SourceLocation Loc) { AtLoc = Loc; }
 
   ObjCPropertyDecl *getPropertyDecl() const {
     return PropertyDecl;
   }
-  
+  void setPropertyDecl(ObjCPropertyDecl *Prop) { PropertyDecl = Prop; }
+
   Kind getPropertyImplementation() const {
     return PropertyIvarDecl ? Synthesize : Dynamic;
   }
@@ -1191,7 +1193,8 @@ public:
   ObjCIvarDecl *getPropertyIvarDecl() const {
     return PropertyIvarDecl;
   }
-  
+  void setPropertyIvarDecl(ObjCIvarDecl *Ivar) { PropertyIvarDecl = Ivar; }
+
   static bool classof(const Decl *D) {
     return D->getKind() == ObjCPropertyImpl;
   }
index 481f14855cbfdeb5f68af3d71f789b84dd348d1f..0791143a00c270afc1699d8c3f34a19f64d5bd0a 100644 (file)
@@ -341,7 +341,11 @@ void PCHDeclReader::VisitObjCImplementationDecl(ObjCImplementationDecl *D) {
 
 void PCHDeclReader::VisitObjCPropertyImplDecl(ObjCPropertyImplDecl *D) {
   VisitDecl(D);
-  // FIXME: Implement.
+  D->setAtLoc(SourceLocation::getFromRawEncoding(Record[Idx++]));
+  D->setPropertyDecl(
+               cast_or_null<ObjCPropertyDecl>(Reader.GetDecl(Record[Idx++])));
+  D->setPropertyIvarDecl(
+                   cast_or_null<ObjCIvarDecl>(Reader.GetDecl(Record[Idx++])));
 }
 
 void PCHDeclReader::VisitFieldDecl(FieldDecl *FD) {
@@ -2286,7 +2290,9 @@ Decl *PCHReader::ReadDeclRecord(uint64_t Offset, unsigned Index) {
   }
   
   case pch::DECL_OBJC_PROPERTY_IMPL: {
-    // FIXME: Implement.
+    D = ObjCPropertyImplDecl::Create(Context, 0, SourceLocation(),
+                                     SourceLocation(), 0, 
+                                     ObjCPropertyImplDecl::Dynamic, 0);
     break;
   }
 
index 6961eb6a13d76201c0c03b2b0f09e42cb2e94d4e..ea2f359e5036173d32eb2c75234f6030ccc5d194 100644 (file)
@@ -512,7 +512,9 @@ void PCHDeclWriter::VisitObjCImplementationDecl(ObjCImplementationDecl *D) {
 
 void PCHDeclWriter::VisitObjCPropertyImplDecl(ObjCPropertyImplDecl *D) {
   VisitDecl(D);
-  // FIXME: Implement.
+  Writer.AddSourceLocation(D->getLocStart(), Record);
+  Writer.AddDeclRef(D->getPropertyDecl(), Record);
+  Writer.AddDeclRef(D->getPropertyIvarDecl(), Record);
   Code = pch::DECL_OBJC_PROPERTY_IMPL;
 }