aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDeclObjC.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2010-01-20 17:27:59 +0000
committerFariborz Jahanian <fjahanian@apple.com>2010-01-20 17:27:59 +0000
commita84f2e4270fb36e3ad9d849c4343e38a42aefe6f (patch)
tree72dc8659297508af2fc27a97ab193da96f724277 /lib/Sema/SemaDeclObjC.cpp
parent6cd5216bb61e6165d8f6e8fb781d45c035bd4e00 (diff)
Improve performance of warning when not implementing a required
property of a protocol (my previous patch). No change in functionality. (radar 7544809). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94005 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclObjC.cpp')
-rw-r--r--lib/Sema/SemaDeclObjC.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp
index f970c314d5..a0086ecc4f 100644
--- a/lib/Sema/SemaDeclObjC.cpp
+++ b/lib/Sema/SemaDeclObjC.cpp
@@ -1121,24 +1121,24 @@ void Sema::DiagnoseUnimplementedProperties(ObjCImplDecl* IMPDecl,
const llvm::DenseSet<Selector>& InsMap) {
llvm::DenseMap<IdentifierInfo *, ObjCPropertyDecl*> PropMap;
CollectImmediateProperties(CDecl, PropMap);
-
+ if (PropMap.empty())
+ return;
+
+ llvm::DenseSet<ObjCPropertyDecl *> PropImplMap;
+ for (ObjCImplDecl::propimpl_iterator
+ I = IMPDecl->propimpl_begin(),
+ EI = IMPDecl->propimpl_end(); I != EI; ++I)
+ PropImplMap.insert((*I)->getPropertyDecl());
+
for (llvm::DenseMap<IdentifierInfo *, ObjCPropertyDecl*>::iterator
P = PropMap.begin(), E = PropMap.end(); P != E; ++P) {
ObjCPropertyDecl *Prop = P->second;
- if (Prop->isInvalidDecl() ||
- Prop->getPropertyImplementation() == ObjCPropertyDecl::Optional)
- continue;
- ObjCPropertyImplDecl *PI = 0;
// Is there a matching propery synthesize/dynamic?
- for (ObjCImplDecl::propimpl_iterator
- I = IMPDecl->propimpl_begin(),
- EI = IMPDecl->propimpl_end(); I != EI; ++I)
- if ((*I)->getPropertyDecl() == Prop) {
- PI = (*I);
- break;
- }
- if (PI)
+ if (Prop->isInvalidDecl() ||
+ Prop->getPropertyImplementation() == ObjCPropertyDecl::Optional ||
+ PropImplMap.count(Prop))
continue;
+
if (!InsMap.count(Prop->getGetterName())) {
Diag(Prop->getLocation(),
diag::warn_setter_getter_impl_required)