diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2010-03-27 21:10:05 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-03-27 21:10:05 +0000 |
commit | 2e8074bfc345fb1d0c614afc963b87c50ec9be89 (patch) | |
tree | 7d7c2466f6c1eed6b3a6397851326e8819dd8dd2 /clang/lib | |
parent | 174376629a6b2a593137a13dc76b9867ff2575a6 (diff) | |
download | bcm5719-llvm-2e8074bfc345fb1d0c614afc963b87c50ec9be89.tar.gz bcm5719-llvm-2e8074bfc345fb1d0c614afc963b87c50ec9be89.zip |
Further improvement to point to category
whose protocolls methods needs implementation.
llvm-svn: 99730
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Sema/Sema.h | 2 | ||||
-rw-r--r-- | clang/lib/Sema/SemaDeclObjC.cpp | 13 |
2 files changed, 11 insertions, 4 deletions
diff --git a/clang/lib/Sema/Sema.h b/clang/lib/Sema/Sema.h index 5436aa940d6..7187f529ce2 100644 --- a/clang/lib/Sema/Sema.h +++ b/clang/lib/Sema/Sema.h @@ -1452,7 +1452,7 @@ public: bool& IncompleteImpl, const llvm::DenseSet<Selector> &InsMap, const llvm::DenseSet<Selector> &ClsMap, - ObjCInterfaceDecl *IDecl); + ObjCContainerDecl *CDecl); /// CheckImplementationIvars - This routine checks if the instance variables /// listed in the implelementation match those listed in the interface. diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp index 79a664f2e1f..cf7ffae2361 100644 --- a/clang/lib/Sema/SemaDeclObjC.cpp +++ b/clang/lib/Sema/SemaDeclObjC.cpp @@ -769,7 +769,14 @@ void Sema::CheckProtocolMethodDefs(SourceLocation ImpLoc, bool& IncompleteImpl, const llvm::DenseSet<Selector> &InsMap, const llvm::DenseSet<Selector> &ClsMap, - ObjCInterfaceDecl *IDecl) { + ObjCContainerDecl *CDecl) { + ObjCInterfaceDecl *IDecl; + if (ObjCCategoryDecl *C = dyn_cast<ObjCCategoryDecl>(CDecl)) + IDecl = C->getClassInterface(); + else + IDecl = dyn_cast<ObjCInterfaceDecl>(CDecl); + assert (IDecl && "CheckProtocolMethodDefs - IDecl is null"); + ObjCInterfaceDecl *Super = IDecl->getSuperClass(); ObjCInterfaceDecl *NSIDecl = 0; if (getLangOptions().NeXTRuntime) { @@ -809,7 +816,7 @@ void Sema::CheckProtocolMethodDefs(SourceLocation ImpLoc, IDecl->lookupInstanceMethod(method->getSelector()); if (!MethodInClass || !MethodInClass->isSynthesized()) { WarnUndefinedMethod(ImpLoc, method, IncompleteImpl); - Diag(IDecl->getLocation(), diag::note_required_for_protocol_at) << + Diag(CDecl->getLocation(), diag::note_required_for_protocol_at) << PDecl->getDeclName(); } } @@ -955,7 +962,7 @@ void Sema::ImplMethodsVsClassMethods(ObjCImplDecl* IMPDecl, for (ObjCCategoryDecl::protocol_iterator PI = C->protocol_begin(), E = C->protocol_end(); PI != E; ++PI) CheckProtocolMethodDefs(IMPDecl->getLocation(), *PI, IncompleteImpl, - InsMap, ClsMap, C->getClassInterface()); + InsMap, ClsMap, CDecl); // Report unimplemented properties in the category as well. // When reporting on missing setter/getters, do not report when // setter/getter is implemented in category's primary class |