diff options
author | Steve Naroff <snaroff@apple.com> | 2009-03-01 16:12:44 +0000 |
---|---|---|
committer | Steve Naroff <snaroff@apple.com> | 2009-03-01 16:12:44 +0000 |
commit | 114aecb26bfab1496b86fd6007669a3572a734b0 (patch) | |
tree | f472d7e804d3258104f2f892b1636782150d724a /clang/lib/AST/DeclObjC.cpp | |
parent | 3d23bb03c12e462259331cafd1f2f264a0a5b16b (diff) | |
download | bcm5719-llvm-114aecb26bfab1496b86fd6007669a3572a734b0.tar.gz bcm5719-llvm-114aecb26bfab1496b86fd6007669a3572a734b0.zip |
Fix <rdar://problem/6619539> incompatible pointer types sending 'XCElementSpacer *', expected 'XCElement *' (not handling protocol signatures correctly?).
- Reworked ASTContext::canAssignObjCInterfaces().
- Added ObjCProtocolDecl::lookupProtocolNamed().
llvm-svn: 65773
Diffstat (limited to 'clang/lib/AST/DeclObjC.cpp')
-rw-r--r-- | clang/lib/AST/DeclObjC.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/lib/AST/DeclObjC.cpp b/clang/lib/AST/DeclObjC.cpp index bdbcce750d0..4d2fcb69ac7 100644 --- a/clang/lib/AST/DeclObjC.cpp +++ b/clang/lib/AST/DeclObjC.cpp @@ -412,6 +412,19 @@ void ObjCProtocolDecl::Destroy(ASTContext &C) { ObjCContainerDecl::Destroy(C); } +ObjCProtocolDecl *ObjCProtocolDecl::lookupProtocolNamed(IdentifierInfo *Name) { + ObjCProtocolDecl *PDecl = this; + + if (Name == getIdentifier()) + return PDecl; + + for (protocol_iterator I = protocol_begin(), E = protocol_end(); I != E; ++I) + if ((PDecl = (*I)->lookupProtocolNamed(Name))) + return PDecl; + + return NULL; +} + // lookupInstanceMethod - Lookup a instance method in the protocol and protocols // it inherited. ObjCMethodDecl *ObjCProtocolDecl::lookupInstanceMethod(Selector Sel) { |