aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGObjC.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2009-01-10 21:06:09 +0000
committerFariborz Jahanian <fjahanian@apple.com>2009-01-10 21:06:09 +0000
commit679a502d462ef819e6175b58e255ca3f3391e7cf (patch)
tree25a4b72fdfa12df33a38f58bea7af9a5c0619181 /lib/CodeGen/CGObjC.cpp
parent212921261b9904d5b21c85c68a57c2b0d3f72b14 (diff)
This patch fixes the code gen failures which was a fallout from
not merging protocol properties into the classes which use those protocols. With this patch, all my exceutable test pass again. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62030 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGObjC.cpp')
-rw-r--r--lib/CodeGen/CGObjC.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/CodeGen/CGObjC.cpp b/lib/CodeGen/CGObjC.cpp
index 3907c0c2c0..ef7b142e3c 100644
--- a/lib/CodeGen/CGObjC.cpp
+++ b/lib/CodeGen/CGObjC.cpp
@@ -103,9 +103,10 @@ RValue CodeGenFunction::EmitObjCMessageExpr(const ObjCMessageExpr *E) {
/// StartObjCMethod - Begin emission of an ObjCMethod. This generates
/// the LLVM function and sets the other context used by
/// CodeGenFunction.
-void CodeGenFunction::StartObjCMethod(const ObjCMethodDecl *OMD) {
+void CodeGenFunction::StartObjCMethod(const ObjCMethodDecl *OMD,
+ const ObjCContainerDecl *CD) {
FunctionArgList Args;
- llvm::Function *Fn = CGM.getObjCRuntime().GenerateMethod(OMD);
+ llvm::Function *Fn = CGM.getObjCRuntime().GenerateMethod(OMD, CD);
CGM.SetMethodAttributes(OMD, Fn);
@@ -125,7 +126,7 @@ void CodeGenFunction::StartObjCMethod(const ObjCMethodDecl *OMD) {
/// Generate an Objective-C method. An Objective-C method is a C function with
/// its pointer, name, and types registered in the class struture.
void CodeGenFunction::GenerateObjCMethod(const ObjCMethodDecl *OMD) {
- StartObjCMethod(OMD);
+ StartObjCMethod(OMD, OMD->getClassInterface());
EmitStmt(OMD->getBody());
FinishFunction(cast<CompoundStmt>(OMD->getBody())->getRBracLoc());
}
@@ -143,12 +144,10 @@ void CodeGenFunction::GenerateObjCGetter(ObjCImplementationDecl *IMP,
const ObjCPropertyDecl *PD = PID->getPropertyDecl();
ObjCMethodDecl *OMD = PD->getGetterMethodDecl();
assert(OMD && "Invalid call to generate getter (empty method)");
- assert (!dyn_cast<ObjCProtocolDecl>(OMD->getDeclContext()) &&
- "GenerateObjCMethod - cannot synthesize protocol getter");
// FIXME: This is rather murky, we create this here since they will
// not have been created by Sema for us.
OMD->createImplicitParams(getContext(), IMP->getClassInterface());
- StartObjCMethod(OMD);
+ StartObjCMethod(OMD, IMP->getClassInterface());
// Determine if we should use an objc_getProperty call for
// this. Non-atomic properties are directly evaluated.
@@ -215,12 +214,10 @@ void CodeGenFunction::GenerateObjCSetter(ObjCImplementationDecl *IMP,
const ObjCPropertyDecl *PD = PID->getPropertyDecl();
ObjCMethodDecl *OMD = PD->getSetterMethodDecl();
assert(OMD && "Invalid call to generate setter (empty method)");
- assert (!dyn_cast<ObjCProtocolDecl>(OMD->getDeclContext()) &&
- "GenerateObjCSetter - cannot synthesize protocol setter");
// FIXME: This is rather murky, we create this here since they will
// not have been created by Sema for us.
OMD->createImplicitParams(getContext(), IMP->getClassInterface());
- StartObjCMethod(OMD);
+ StartObjCMethod(OMD, IMP->getClassInterface());
bool IsCopy = PD->getSetterKind() == ObjCPropertyDecl::Copy;
bool IsAtomic =