[cfe-commits] r110570 - in /cfe/trunk: lib/Frontend/PCHReaderDecl.cpp lib/Frontend/PCHWriterDecl.cpp test/PCH/objcxx-ivar-class.h test/PCH/objcxx-ivar-class.mm
Argyrios Kyrtzidis
akyrtzi at gmail.com
Mon Aug 9 03:54:37 PDT 2010
Author: akirtzidis
Date: Mon Aug 9 05:54:37 2010
New Revision: 110570
URL: http://llvm.org/viewvc/llvm-project?rev=110570&view=rev
Log:
Complete PCH support for ObjCPropertyImplDecl.
Modified:
cfe/trunk/lib/Frontend/PCHReaderDecl.cpp
cfe/trunk/lib/Frontend/PCHWriterDecl.cpp
cfe/trunk/test/PCH/objcxx-ivar-class.h
cfe/trunk/test/PCH/objcxx-ivar-class.mm
Modified: cfe/trunk/lib/Frontend/PCHReaderDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PCHReaderDecl.cpp?rev=110570&r1=110569&r2=110570&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/PCHReaderDecl.cpp (original)
+++ cfe/trunk/lib/Frontend/PCHReaderDecl.cpp Mon Aug 9 05:54:37 2010
@@ -526,7 +526,8 @@
cast_or_null<ObjCPropertyDecl>(Reader.GetDecl(Record[Idx++])));
D->setPropertyIvarDecl(
cast_or_null<ObjCIvarDecl>(Reader.GetDecl(Record[Idx++])));
- // FIXME. read GetterCXXConstructor and SetterCXXAssignment
+ D->setGetterCXXConstructor(Reader.ReadExpr(Cursor));
+ D->setSetterCXXAssignment(Reader.ReadExpr(Cursor));
}
void PCHDeclReader::VisitFieldDecl(FieldDecl *FD) {
Modified: cfe/trunk/lib/Frontend/PCHWriterDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PCHWriterDecl.cpp?rev=110570&r1=110569&r2=110570&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/PCHWriterDecl.cpp (original)
+++ cfe/trunk/lib/Frontend/PCHWriterDecl.cpp Mon Aug 9 05:54:37 2010
@@ -305,8 +305,10 @@
VisitNamedDecl(D);
// FIXME: convert to LazyStmtPtr?
// Unlike C/C++, method bodies will never be in header files.
- Record.push_back(D->getBody() != 0);
- if (D->getBody() != 0) {
+ bool HasBodyStuff = D->getBody() != 0 ||
+ D->getSelfDecl() != 0 || D->getCmdDecl() != 0;
+ Record.push_back(HasBodyStuff);
+ if (HasBodyStuff) {
Writer.AddStmt(D->getBody());
Writer.AddDeclRef(D->getSelfDecl(), Record);
Writer.AddDeclRef(D->getCmdDecl(), Record);
@@ -478,7 +480,8 @@
Writer.AddSourceLocation(D->getLocStart(), Record);
Writer.AddDeclRef(D->getPropertyDecl(), Record);
Writer.AddDeclRef(D->getPropertyIvarDecl(), Record);
- // FIXME. write GetterCXXConstructor and SetterCXXAssignment.
+ Writer.AddStmt(D->getGetterCXXConstructor());
+ Writer.AddStmt(D->getSetterCXXAssignment());
Code = pch::DECL_OBJC_PROPERTY_IMPL;
}
Modified: cfe/trunk/test/PCH/objcxx-ivar-class.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/PCH/objcxx-ivar-class.h?rev=110570&r1=110569&r2=110570&view=diff
==============================================================================
--- cfe/trunk/test/PCH/objcxx-ivar-class.h (original)
+++ cfe/trunk/test/PCH/objcxx-ivar-class.h Mon Aug 9 05:54:37 2010
@@ -1,11 +1,15 @@
struct S {
S();
+ S(const S&);
+ S& operator= (const S&);
};
@interface C {
- S s;
+ S position;
}
+ at property(assign, nonatomic) S position;
@end
@implementation C
+ @synthesize position;
@end
Modified: cfe/trunk/test/PCH/objcxx-ivar-class.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/PCH/objcxx-ivar-class.mm?rev=110570&r1=110569&r2=110570&view=diff
==============================================================================
--- cfe/trunk/test/PCH/objcxx-ivar-class.mm (original)
+++ cfe/trunk/test/PCH/objcxx-ivar-class.mm Mon Aug 9 05:54:37 2010
@@ -5,5 +5,11 @@
// RUN: %clang_cc1 -x objective-c++-header -emit-pch -o %t %S/objcxx-ivar-class.h
// RUN: %clang_cc1 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
+// CHECK: [C position]
+// CHECK: call void @_ZN1SC1ERKS_
+
+// CHECK: [C setPosition:]
+// CHECK: call %struct.S* @_ZN1SaSERKS_
+
// CHECK: [C .cxx_destruct]
// CHECK: [C .cxx_construct]
More information about the cfe-commits
mailing list