summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaObjCProperty.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2010-03-18 01:22:36 +0000
committerTed Kremenek <kremenek@apple.com>2010-03-18 01:22:36 +0000
commit1bc22f719fb435926410fa60e87093d49de5b9de (patch)
treebffca34be4ace725e52126b5788dbb1531e40cf9 /clang/lib/Sema/SemaObjCProperty.cpp
parent0052449e1a1f4ab5c7caf89f908295f0f8644d03 (diff)
downloadbcm5719-llvm-1bc22f719fb435926410fa60e87093d49de5b9de.tar.gz
bcm5719-llvm-1bc22f719fb435926410fa60e87093d49de5b9de.zip
Simplify code (and remove 'dyn_cast') by using ObjCProperyDecl::findPropertyDecl().
llvm-svn: 98794
Diffstat (limited to 'clang/lib/Sema/SemaObjCProperty.cpp')
-rw-r--r--clang/lib/Sema/SemaObjCProperty.cpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/clang/lib/Sema/SemaObjCProperty.cpp b/clang/lib/Sema/SemaObjCProperty.cpp
index 3a0fe0a61af..41ed6c630cb 100644
--- a/clang/lib/Sema/SemaObjCProperty.cpp
+++ b/clang/lib/Sema/SemaObjCProperty.cpp
@@ -137,17 +137,9 @@ Sema::HandlePropertyInClassExtension(Scope *S, ObjCCategoryDecl *CDecl,
Diag(AtLoc, diag::warn_property_attr_mismatch);
Diag(PIDecl->getLocation(), diag::note_property_declare);
}
- DeclContext *DC = dyn_cast<DeclContext>(CCPrimary);
- assert(DC && "ClassDecl is not a DeclContext");
- DeclContext::lookup_result Found =
- DC->lookup(PIDecl->getDeclName());
- bool PropertyInPrimaryClass = false;
- for (; Found.first != Found.second; ++Found.first)
- if (isa<ObjCPropertyDecl>(*Found.first)) {
- PropertyInPrimaryClass = true;
- break;
- }
- if (!PropertyInPrimaryClass) {
+ DeclContext *DC = cast<DeclContext>(CCPrimary);
+ if (!ObjCPropertyDecl::findPropertyDecl(DC,
+ PIDecl->getDeclName().getAsIdentifierInfo())) {
// Protocol is not in the primary class. Must build one for it.
ObjCDeclSpec ProtocolPropertyODS;
// FIXME. Assuming that ObjCDeclSpec::ObjCPropertyAttributeKind
OpenPOWER on IntegriCloud