aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/SemaCodeComplete.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-03-13 01:09:41 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-03-13 01:09:41 +0000
commite7f3ef39bfddfaed84ad876c9ce6888c73949508 (patch)
treef410fc7fab713bb6d8a9baa8e1864e8ed05e8dac /clang/lib/Sema/SemaCodeComplete.cpp
parent3b60cffa227ac6e4d53bafc4d7848fc85aff2309 (diff)
downloadllvm-e7f3ef39bfddfaed84ad876c9ce6888c73949508.zip
llvm-e7f3ef39bfddfaed84ad876c9ce6888c73949508.tar.gz
llvm-e7f3ef39bfddfaed84ad876c9ce6888c73949508.tar.bz2
[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. llvm-svn: 152597
Diffstat (limited to 'clang/lib/Sema/SemaCodeComplete.cpp')
-rw-r--r--clang/lib/Sema/SemaCodeComplete.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp
index 21a5cfa..7ee2bcba 100644
--- a/clang/lib/Sema/SemaCodeComplete.cpp
+++ b/clang/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);