[cfe-commits] r69855 - in /cfe/trunk: include/clang/AST/DeclObjC.h lib/AST/DeclObjC.cpp lib/Frontend/PCHReader.cpp lib/Frontend/PCHWriter.cpp
Douglas Gregor
dgregor at apple.com
Wed Apr 22 19:42:49 PDT 2009
Author: dgregor
Date: Wed Apr 22 21:42:49 2009
New Revision: 69855
URL: http://llvm.org/viewvc/llvm-project?rev=69855&view=rev
Log:
PCH (de-)serialization for ObjCImplDecl. This can't be tested yet.
Modified:
cfe/trunk/include/clang/AST/DeclObjC.h
cfe/trunk/lib/AST/DeclObjC.cpp
cfe/trunk/lib/Frontend/PCHReader.cpp
cfe/trunk/lib/Frontend/PCHWriter.cpp
Modified: cfe/trunk/include/clang/AST/DeclObjC.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclObjC.h?rev=69855&r1=69854&r2=69855&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/DeclObjC.h (original)
+++ cfe/trunk/include/clang/AST/DeclObjC.h Wed Apr 22 21:42:49 2009
@@ -809,12 +809,15 @@
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);
}
Modified: cfe/trunk/lib/AST/DeclObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclObjC.cpp?rev=69855&r1=69854&r2=69855&view=diff
==============================================================================
--- cfe/trunk/lib/AST/DeclObjC.cpp (original)
+++ cfe/trunk/lib/AST/DeclObjC.cpp Wed Apr 22 21:42:49 2009
@@ -543,6 +543,7 @@
void ObjCImplDecl::addPropertyImplementation(ASTContext &Context,
ObjCPropertyImplDecl *property) {
+ // FIXME: The context should be correct before we get here.
property->setLexicalDeclContext(this);
addDecl(Context, property);
}
Modified: cfe/trunk/lib/Frontend/PCHReader.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PCHReader.cpp?rev=69855&r1=69854&r2=69855&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/PCHReader.cpp (original)
+++ cfe/trunk/lib/Frontend/PCHReader.cpp Wed Apr 22 21:42:49 2009
@@ -322,7 +322,9 @@
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) {
Modified: cfe/trunk/lib/Frontend/PCHWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PCHWriter.cpp?rev=69855&r1=69854&r2=69855&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/PCHWriter.cpp (original)
+++ cfe/trunk/lib/Frontend/PCHWriter.cpp Wed Apr 22 21:42:49 2009
@@ -493,7 +493,8 @@
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).
}
More information about the cfe-commits
mailing list