summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGObjC.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2009-01-10 00:13:01 +0000
committerFariborz Jahanian <fjahanian@apple.com>2009-01-10 00:13:01 +0000
commitd9c238dc9f17ded5f90cd0ae218f0973cc7648f7 (patch)
tree4777f11a48f12a9c7f102fc3064478b5a0a1ade9 /clang/lib/CodeGen/CGObjC.cpp
parent498b58ceb10c33c21a801f952c6dd8bfc086a2bb (diff)
downloadbcm5719-llvm-d9c238dc9f17ded5f90cd0ae218f0973cc7648f7.tar.gz
bcm5719-llvm-d9c238dc9f17ded5f90cd0ae218f0973cc7648f7.zip
assert if attempting to code gen. a property setter/getter
coming from a protocol. llvm-svn: 62017
Diffstat (limited to 'clang/lib/CodeGen/CGObjC.cpp')
-rw-r--r--clang/lib/CodeGen/CGObjC.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGObjC.cpp b/clang/lib/CodeGen/CGObjC.cpp
index fffd011fd6b..3907c0c2c08 100644
--- a/clang/lib/CodeGen/CGObjC.cpp
+++ b/clang/lib/CodeGen/CGObjC.cpp
@@ -143,6 +143,8 @@ 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());
@@ -213,6 +215,8 @@ 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());
OpenPOWER on IntegriCloud