@@ -1103,8 +1103,7 @@ class CGObjCGNUstep2 : public CGObjCGNUstep {
11031103 bool isNamed = !isNonASCII;
11041104 if (isNamed) {
11051105 StringName = " .objc_str_" ;
1106- for (int i=0 ,e=Str.size () ; i<e ; ++i) {
1107- unsigned char c = Str[i];
1106+ for (unsigned char c : Str) {
11081107 if (isalnum (c))
11091108 StringName += c;
11101109 else if (c == ' ' )
@@ -2560,10 +2559,9 @@ llvm::Value *CGObjCGNU::GetTypedSelector(CodeGenFunction &CGF, Selector Sel,
25602559 SmallVectorImpl<TypedSelector> &Types = SelectorTable[Sel];
25612560 llvm::GlobalAlias *SelValue = nullptr ;
25622561
2563- for (SmallVectorImpl<TypedSelector>::iterator i = Types.begin (),
2564- e = Types.end () ; i!=e ; i++) {
2565- if (i->first == TypeEncoding) {
2566- SelValue = i->second ;
2562+ for (const TypedSelector &Type : Types) {
2563+ if (Type.first == TypeEncoding) {
2564+ SelValue = Type.second ;
25672565 break ;
25682566 }
25692567 }
@@ -3333,13 +3331,12 @@ CGObjCGNU::GenerateProtocolList(ArrayRef<std::string> Protocols) {
33333331 ProtocolList.addInt (LongTy, Protocols.size ());
33343332
33353333 auto Elements = ProtocolList.beginArray (PtrToInt8Ty);
3336- for (const std::string *iter = Protocols.begin (), *endIter = Protocols.end ();
3337- iter != endIter ; iter++) {
3334+ for (const std::string &Protocol : Protocols) {
33383335 llvm::Constant *protocol = nullptr ;
3339- llvm::StringMap<llvm::Constant*>::iterator value =
3340- ExistingProtocols.find (*iter );
3336+ llvm::StringMap<llvm::Constant *>::iterator value =
3337+ ExistingProtocols.find (Protocol );
33413338 if (value == ExistingProtocols.end ()) {
3342- protocol = GenerateEmptyProtocol (*iter );
3339+ protocol = GenerateEmptyProtocol (Protocol );
33433340 } else {
33443341 protocol = value->getValue ();
33453342 }
0 commit comments