diff options
| author | Douglas Gregor <dgregor@apple.com> | 2009-04-23 03:43:53 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2009-04-23 03:43:53 +0000 |
| commit | 49e72fb87082391c2ba57bf5943ef56af6a37b62 (patch) | |
| tree | 929db5bd113b576d8a874cbe4858ae81893c0c3e | |
| parent | 5f66205233d33dcc36f8f804a689358ed49740af (diff) | |
| download | bcm5719-llvm-49e72fb87082391c2ba57bf5943ef56af6a37b62.tar.gz bcm5719-llvm-49e72fb87082391c2ba57bf5943ef56af6a37b62.zip | |
PCH support for ObjCPropertyImplDecl
llvm-svn: 69858
| -rw-r--r-- | clang/include/clang/AST/DeclObjC.h | 7 | ||||
| -rw-r--r-- | clang/lib/Frontend/PCHReader.cpp | 10 | ||||
| -rw-r--r-- | clang/lib/Frontend/PCHWriter.cpp | 4 |
3 files changed, 16 insertions, 5 deletions
diff --git a/clang/include/clang/AST/DeclObjC.h b/clang/include/clang/AST/DeclObjC.h index 1672aaa51f7..c68741ad5cc 100644 --- a/clang/include/clang/AST/DeclObjC.h +++ b/clang/include/clang/AST/DeclObjC.h @@ -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; } diff --git a/clang/lib/Frontend/PCHReader.cpp b/clang/lib/Frontend/PCHReader.cpp index 481f14855cb..0791143a00c 100644 --- a/clang/lib/Frontend/PCHReader.cpp +++ b/clang/lib/Frontend/PCHReader.cpp @@ -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; } diff --git a/clang/lib/Frontend/PCHWriter.cpp b/clang/lib/Frontend/PCHWriter.cpp index 6961eb6a13d..ea2f359e503 100644 --- a/clang/lib/Frontend/PCHWriter.cpp +++ b/clang/lib/Frontend/PCHWriter.cpp @@ -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; } |

