aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/DeclObjC.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2013-01-07 21:31:08 +0000
committerFariborz Jahanian <fjahanian@apple.com>2013-01-07 21:31:08 +0000
commitcc5a28a1a10e966ae176957d9fd21b03951f600e (patch)
treebc0f38c42f04fbaf2c9e35d2371a3c9b125e6a50 /lib/AST/DeclObjC.cpp
parent546dbef5e46a7da14583e70e138ae7a81b4b9ccc (diff)
Minor refactoring of my last patch
related to // rdar://12958878 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171792 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/DeclObjC.cpp')
-rw-r--r--lib/AST/DeclObjC.cpp25
1 files changed, 12 insertions, 13 deletions
diff --git a/lib/AST/DeclObjC.cpp b/lib/AST/DeclObjC.cpp
index 62b4f5ea82..32503ad785 100644
--- a/lib/AST/DeclObjC.cpp
+++ b/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);
}