diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-03-13 01:09:41 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-03-13 01:09:41 +0000 |
commit | a5f4441de7890953460d95f4e88b9fa432b48dc2 (patch) | |
tree | aafaf87f8cfcbeea81609da726361d694cc04a7f /lib/Sema/SemaCodeComplete.cpp | |
parent | cd707abbc758149d9f7d37bd0b25298455c678b2 (diff) |
[Sema] Prefer to use ObjCInterfaceDecl's protocol_begin()/protocol_end() iterators instead of
ObjCInterfaceDecl::getReferencedProtocols(), because the iterators are safe to use
even if the caller did not check that the interface is a definition.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152597 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaCodeComplete.cpp')
-rw-r--r-- | lib/Sema/SemaCodeComplete.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Sema/SemaCodeComplete.cpp b/lib/Sema/SemaCodeComplete.cpp index 21a5cfa79d..7ee2bcba82 100644 --- a/lib/Sema/SemaCodeComplete.cpp +++ b/lib/Sema/SemaCodeComplete.cpp @@ -4708,9 +4708,8 @@ static void AddObjCMethods(ObjCContainerDecl *Container, return; // Add methods in protocols. - const ObjCList<ObjCProtocolDecl> &Protocols= IFace->getReferencedProtocols(); - for (ObjCList<ObjCProtocolDecl>::iterator I = Protocols.begin(), - E = Protocols.end(); + for (ObjCInterfaceDecl::protocol_iterator I = IFace->protocol_begin(), + E = IFace->protocol_end(); I != E; ++I) AddObjCMethods(*I, WantInstanceMethods, WantKind, SelIdents, NumSelIdents, CurContext, Selectors, AllowSameLength, Results, false); |