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/CodeGen | |
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/CodeGen')
-rw-r--r-- | lib/CodeGen/CGObjCGNU.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/CodeGen/CGObjCGNU.cpp b/lib/CodeGen/CGObjCGNU.cpp index 3e5c4a2a93..4dedc9de28 100644 --- a/lib/CodeGen/CGObjCGNU.cpp +++ b/lib/CodeGen/CGObjCGNU.cpp @@ -2070,9 +2070,9 @@ void CGObjCGNU::GenerateClass(const ObjCImplementationDecl *OID) { } // Collect the names of referenced protocols SmallVector<std::string, 16> Protocols; - const ObjCList<ObjCProtocolDecl> &Protos =ClassDecl->getReferencedProtocols(); - for (ObjCList<ObjCProtocolDecl>::iterator I = Protos.begin(), - E = Protos.end(); I != E; ++I) + for (ObjCInterfaceDecl::protocol_iterator + I = ClassDecl->protocol_begin(), + E = ClassDecl->protocol_end(); I != E; ++I) Protocols.push_back((*I)->getNameAsString()); |