From: Fariborz Jahanian Date: Sat, 17 Jul 2010 18:35:47 +0000 (+0000) Subject: Added PCH/ASTImporter code for ObjCIvarDecl's field. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ac0021ba802e193e0f9f8207768c7862c7603bc0;p=clang Added PCH/ASTImporter code for ObjCIvarDecl's field. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108627 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/DeclObjC.h b/include/clang/AST/DeclObjC.h index dee7504216..2a175513cb 100644 --- a/include/clang/AST/DeclObjC.h +++ b/include/clang/AST/DeclObjC.h @@ -676,6 +676,7 @@ public: return DeclAccess == None ? Protected : AccessControl(DeclAccess); } + void setSynthesize(bool synth) { Synthesized = synth; } bool getSynthesize() const { return Synthesized; } // Implement isa/cast/dyncast/etc. diff --git a/lib/AST/ASTImporter.cpp b/lib/AST/ASTImporter.cpp index 8d347d1716..0d8896330c 100644 --- a/lib/AST/ASTImporter.cpp +++ b/lib/AST/ASTImporter.cpp @@ -2026,7 +2026,7 @@ Decl *ASTNodeImporter::VisitObjCIvarDecl(ObjCIvarDecl *D) { cast(DC), Loc, Name.getAsIdentifierInfo(), T, TInfo, D->getAccessControl(), - BitWidth); + BitWidth, D->getSynthesize()); ToIvar->setLexicalDeclContext(LexicalDC); Importer.Imported(D, ToIvar); LexicalDC->addDecl(ToIvar); diff --git a/lib/Frontend/PCHReaderDecl.cpp b/lib/Frontend/PCHReaderDecl.cpp index c8851a7ecc..e494f7c934 100644 --- a/lib/Frontend/PCHReaderDecl.cpp +++ b/lib/Frontend/PCHReaderDecl.cpp @@ -378,6 +378,8 @@ void PCHDeclReader::VisitObjCInterfaceDecl(ObjCInterfaceDecl *ID) { void PCHDeclReader::VisitObjCIvarDecl(ObjCIvarDecl *IVD) { VisitFieldDecl(IVD); IVD->setAccessControl((ObjCIvarDecl::AccessControl)Record[Idx++]); + bool synth = Record[Idx++]; + IVD->setSynthesize(synth); } void PCHDeclReader::VisitObjCProtocolDecl(ObjCProtocolDecl *PD) { diff --git a/lib/Frontend/PCHWriterDecl.cpp b/lib/Frontend/PCHWriterDecl.cpp index bc4452ed7f..64875521c1 100644 --- a/lib/Frontend/PCHWriterDecl.cpp +++ b/lib/Frontend/PCHWriterDecl.cpp @@ -363,6 +363,7 @@ void PCHDeclWriter::VisitObjCIvarDecl(ObjCIvarDecl *D) { VisitFieldDecl(D); // FIXME: stable encoding for @public/@private/@protected/@package Record.push_back(D->getAccessControl()); + Record.push_back(D->getSynthesize()); Code = pch::DECL_OBJC_IVAR; }