diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2013-01-07 21:31:08 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2013-01-07 21:31:08 +0000 |
commit | 0a17f59db8479ab4158b8dd52c2b155bbbcfd16a (patch) | |
tree | 6d59d26732b6c5bfb4daad7b58b9a554fd0b5eb9 /clang/lib/AST/DeclObjC.cpp | |
parent | 10426b571e37a034ce844c88fc8fd1b891df0a05 (diff) | |
download | bcm5719-llvm-0a17f59db8479ab4158b8dd52c2b155bbbcfd16a.tar.gz bcm5719-llvm-0a17f59db8479ab4158b8dd52c2b155bbbcfd16a.zip |
Minor refactoring of my last patch
related to // rdar://12958878
llvm-svn: 171792
Diffstat (limited to 'clang/lib/AST/DeclObjC.cpp')
-rw-r--r-- | clang/lib/AST/DeclObjC.cpp | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/clang/lib/AST/DeclObjC.cpp b/clang/lib/AST/DeclObjC.cpp index 62b4f5ea82c..32503ad7857 100644 --- a/clang/lib/AST/DeclObjC.cpp +++ b/clang/lib/AST/DeclObjC.cpp @@ -1352,20 +1352,19 @@ void ObjCProtocolDecl::startDefinition() { } void ObjCProtocolDecl::collectPropertiesToImplement(PropertyMap &PM) const { - const ObjCProtocolDecl *PDecl = this; - if (!isThisDeclarationADefinition() && getDefinition()) - PDecl = getDefinition(); - - for (ObjCProtocolDecl::prop_iterator P = PDecl->prop_begin(), - E = PDecl->prop_end(); P != E; ++P) { - ObjCPropertyDecl *Prop = *P; - // Insert into PM if not there already. - PM.insert(std::make_pair(Prop->getIdentifier(), Prop)); + + if (const ObjCProtocolDecl *PDecl = getDefinition()) { + for (ObjCProtocolDecl::prop_iterator P = PDecl->prop_begin(), + E = PDecl->prop_end(); P != E; ++P) { + ObjCPropertyDecl *Prop = *P; + // Insert into PM if not there already. + PM.insert(std::make_pair(Prop->getIdentifier(), Prop)); + } + // Scan through protocol's protocols. + for (ObjCProtocolDecl::protocol_iterator PI = PDecl->protocol_begin(), + E = PDecl->protocol_end(); PI != E; ++PI) + (*PI)->collectPropertiesToImplement(PM); } - // Scan through protocol's protocols. - for (ObjCProtocolDecl::protocol_iterator PI = PDecl->protocol_begin(), - E = PDecl->protocol_end(); PI != E; ++PI) - (*PI)->collectPropertiesToImplement(PM); } |