aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGObjC.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2008-12-09 20:23:04 +0000
committerFariborz Jahanian <fjahanian@apple.com>2008-12-09 20:23:04 +0000
commitfef30b55230064d334a669a065a1c9acdb87cdfe (patch)
tree87b4f897e5e242851b4d5108e0e8de9ec3d12432 /lib/CodeGen/CGObjC.cpp
parent15faa7fdfb496489dec9470aa5eb699b29ecdacc (diff)
Support for implementation of property in the case where
the synthesis is in an implementation of s subclass of a super class where the property has been declared. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60792 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGObjC.cpp')
-rw-r--r--lib/CodeGen/CGObjC.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/CodeGen/CGObjC.cpp b/lib/CodeGen/CGObjC.cpp
index 845d5ff00c..e605065848 100644
--- a/lib/CodeGen/CGObjC.cpp
+++ b/lib/CodeGen/CGObjC.cpp
@@ -137,14 +137,15 @@ void CodeGenFunction::GenerateObjCMethod(const ObjCMethodDecl *OMD) {
/// GenerateObjCGetter - Generate an Objective-C property getter
/// function. The given Decl must be either an ObjCCategoryImplDecl
/// or an ObjCImplementationDecl.
-void CodeGenFunction::GenerateObjCGetter(const ObjCPropertyImplDecl *PID) {
+void CodeGenFunction::GenerateObjCGetter(ObjCImplementationDecl *IMP,
+ const ObjCPropertyImplDecl *PID) {
ObjCIvarDecl *Ivar = PID->getPropertyIvarDecl();
const ObjCPropertyDecl *PD = PID->getPropertyDecl();
ObjCMethodDecl *OMD = PD->getGetterMethodDecl();
assert(OMD && "Invalid call to generate getter (empty method)");
// FIXME: This is rather murky, we create this here since they will
// not have been created by Sema for us.
- OMD->createImplicitParams(getContext());
+ OMD->createImplicitParams(getContext(), IMP->getClassInterface());
StartObjCMethod(OMD);
// Determine if we should use an objc_getProperty call for
@@ -173,7 +174,7 @@ void CodeGenFunction::GenerateObjCGetter(const ObjCPropertyImplDecl *PID) {
QualType IdTy = getContext().getObjCIdType();
llvm::Value *SelfAsId =
Builder.CreateBitCast(LoadObjCSelf(), Types.ConvertType(IdTy));
- llvm::Value *Offset = EmitIvarOffset(OMD->getClassInterface(), Ivar);
+ llvm::Value *Offset = EmitIvarOffset(IMP->getClassInterface(), Ivar);
llvm::Value *True =
llvm::ConstantInt::get(Types.ConvertTypeForMem(getContext().BoolTy), 1);
CallArgList Args;
@@ -204,14 +205,15 @@ void CodeGenFunction::GenerateObjCGetter(const ObjCPropertyImplDecl *PID) {
/// GenerateObjCSetter - Generate an Objective-C property setter
/// function. The given Decl must be either an ObjCCategoryImplDecl
/// or an ObjCImplementationDecl.
-void CodeGenFunction::GenerateObjCSetter(const ObjCPropertyImplDecl *PID) {
+void CodeGenFunction::GenerateObjCSetter(ObjCImplementationDecl *IMP,
+ const ObjCPropertyImplDecl *PID) {
ObjCIvarDecl *Ivar = PID->getPropertyIvarDecl();
const ObjCPropertyDecl *PD = PID->getPropertyDecl();
ObjCMethodDecl *OMD = PD->getSetterMethodDecl();
assert(OMD && "Invalid call to generate setter (empty method)");
// FIXME: This is rather murky, we create this here since they will
// not have been created by Sema for us.
- OMD->createImplicitParams(getContext());
+ OMD->createImplicitParams(getContext(), IMP->getClassInterface());
StartObjCMethod(OMD);
bool IsCopy = PD->getSetterKind() == ObjCPropertyDecl::Copy;
@@ -244,7 +246,7 @@ void CodeGenFunction::GenerateObjCSetter(const ObjCPropertyImplDecl *PID) {
QualType IdTy = getContext().getObjCIdType();
llvm::Value *SelfAsId =
Builder.CreateBitCast(LoadObjCSelf(), Types.ConvertType(IdTy));
- llvm::Value *Offset = EmitIvarOffset(OMD->getClassInterface(), Ivar);
+ llvm::Value *Offset = EmitIvarOffset(IMP->getClassInterface(), Ivar);
llvm::Value *Arg = LocalDeclMap[OMD->getParamDecl(0)];
llvm::Value *ArgAsId =
Builder.CreateBitCast(Builder.CreateLoad(Arg, "arg"),