@@ -1103,8 +1103,7 @@ class CGObjCGNUstep2 : public CGObjCGNUstep {
1103
1103
bool isNamed = !isNonASCII;
1104
1104
if (isNamed) {
1105
1105
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) {
1108
1107
if (isalnum (c))
1109
1108
StringName += c;
1110
1109
else if (c == ' ' )
@@ -2560,10 +2559,9 @@ llvm::Value *CGObjCGNU::GetTypedSelector(CodeGenFunction &CGF, Selector Sel,
2560
2559
SmallVectorImpl<TypedSelector> &Types = SelectorTable[Sel];
2561
2560
llvm::GlobalAlias *SelValue = nullptr ;
2562
2561
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 ;
2567
2565
break ;
2568
2566
}
2569
2567
}
@@ -3333,13 +3331,12 @@ CGObjCGNU::GenerateProtocolList(ArrayRef<std::string> Protocols) {
3333
3331
ProtocolList.addInt (LongTy, Protocols.size ());
3334
3332
3335
3333
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) {
3338
3335
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 );
3341
3338
if (value == ExistingProtocols.end ()) {
3342
- protocol = GenerateEmptyProtocol (*iter );
3339
+ protocol = GenerateEmptyProtocol (Protocol );
3343
3340
} else {
3344
3341
protocol = value->getValue ();
3345
3342
}
0 commit comments