aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGObjC.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2009-03-20 17:22:23 +0000
committerFariborz Jahanian <fjahanian@apple.com>2009-03-20 17:22:23 +0000
commit8e5d23236ad05f9b18114d5486b3a3aeadf42e00 (patch)
treebba3dd5413481b665a80bcdf7942ac8b2e884ba5 /lib/CodeGen/CGObjC.cpp
parente966d9ae3e2d0b021e6290f91fb90b28cf736d84 (diff)
Implement ir gen. for setter/getter applied to 'super'
in a property dot-syntax notation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67382 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGObjC.cpp')
-rw-r--r--lib/CodeGen/CGObjC.cpp31
1 files changed, 30 insertions, 1 deletions
diff --git a/lib/CodeGen/CGObjC.cpp b/lib/CodeGen/CGObjC.cpp
index aa1f4c2494..84d60ea7df 100644
--- a/lib/CodeGen/CGObjC.cpp
+++ b/lib/CodeGen/CGObjC.cpp
@@ -332,6 +332,20 @@ RValue CodeGenFunction::EmitObjCPropertyGet(const Expr *Exp) {
const ObjCInterfaceDecl *OID = KE->getClassProp();
Receiver = CGM.getObjCRuntime().GetClass(Builder, OID);
}
+ else if (isa<ObjCSuperExpr>(KE->getBase())) {
+ Receiver = LoadObjCSelf();
+ const ObjCMethodDecl *OMD = cast<ObjCMethodDecl>(CurFuncDecl);
+ bool isClassMessage = OMD->isClassMethod();
+ bool isCategoryImpl = isa<ObjCCategoryImplDecl>(OMD->getDeclContext());
+ return CGM.getObjCRuntime().GenerateMessageSendSuper(*this,
+ KE->getType(),
+ S,
+ OMD->getClassInterface(),
+ isCategoryImpl,
+ Receiver,
+ isClassMessage,
+ CallArgList());
+ }
else
Receiver = EmitScalarExpr(KE->getBase());
return CGM.getObjCRuntime().
@@ -360,7 +374,22 @@ void CodeGenFunction::EmitObjCPropertySet(const Expr *Exp,
const ObjCInterfaceDecl *OID = E->getClassProp();
Receiver = CGM.getObjCRuntime().GetClass(Builder, OID);
}
- else
+ else if (isa<ObjCSuperExpr>(E->getBase())) {
+ Receiver = LoadObjCSelf();
+ const ObjCMethodDecl *OMD = cast<ObjCMethodDecl>(CurFuncDecl);
+ bool isClassMessage = OMD->isClassMethod();
+ bool isCategoryImpl = isa<ObjCCategoryImplDecl>(OMD->getDeclContext());
+ CGM.getObjCRuntime().GenerateMessageSendSuper(*this,
+ E->getType(),
+ S,
+ OMD->getClassInterface(),
+ isCategoryImpl,
+ Receiver,
+ isClassMessage,
+ Args);
+ return;
+ }
+ else
Receiver = EmitScalarExpr(E->getBase());
Args.push_back(std::make_pair(Src, E->getType()));
CGM.getObjCRuntime().GenerateMessageSend(*this, getContext().VoidTy, S,