[cfe-commits] r53831 - /cfe/trunk/lib/AST/Type.cpp
Chris Lattner
sabre at nondot.org
Sun Jul 20 22:19:23 PDT 2008
Author: lattner
Date: Mon Jul 21 00:19:23 2008
New Revision: 53831
URL: http://llvm.org/viewvc/llvm-project?rev=53831&view=rev
Log:
use iterators instead of direct access to protocol list.
Modified:
cfe/trunk/lib/AST/Type.cpp
Modified: cfe/trunk/lib/AST/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Type.cpp?rev=53831&r1=53830&r2=53831&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Type.cpp (original)
+++ cfe/trunk/lib/AST/Type.cpp Mon Jul 21 00:19:23 2008
@@ -998,11 +998,13 @@
InnerString = ' ' + InnerString;
std::string ObjCQIString = getDecl()->getName();
ObjCQIString += '<';
- int num = getNumProtocols();
- for (int i = 0; i < num; i++) {
- ObjCQIString += getProtocols(i)->getName();
- if (i < num-1)
+ bool isFirst = true;
+ for (qual_iterator I = qual_begin(), E = qual_end(); I != E; ++I) {
+ if (isFirst)
+ isFirst = false;
+ else
ObjCQIString += ',';
+ ObjCQIString += (*I)->getName();
}
ObjCQIString += '>';
InnerString = ObjCQIString + InnerString;
More information about the cfe-commits
mailing list