File tree Expand file tree Collapse file tree 4 files changed +10
-13
lines changed Expand file tree Collapse file tree 4 files changed +10
-13
lines changed Original file line number Diff line number Diff line change @@ -1317,11 +1317,11 @@ void elf::processArmCmseSymbols(Ctx &ctx) {
1317
1317
// with its corresponding special symbol __acle_se_<sym>.
1318
1318
parallelForEach (ctx.objectFiles , [&](InputFile *file) {
1319
1319
MutableArrayRef<Symbol *> syms = file->getMutableSymbols ();
1320
- for (size_t i = 0 , e = syms. size (); i != e; ++i ) {
1321
- StringRef symName = syms[i] ->getName ();
1320
+ for (Symbol *&sym : syms) {
1321
+ StringRef symName = sym ->getName ();
1322
1322
auto it = ctx.symtab ->cmseSymMap .find (symName);
1323
1323
if (it != ctx.symtab ->cmseSymMap .end ())
1324
- syms[i] = it->second .acleSeSym ;
1324
+ sym = it->second .acleSeSym ;
1325
1325
}
1326
1326
});
1327
1327
}
Original file line number Diff line number Diff line change @@ -4026,10 +4026,9 @@ void MergeNoTailSection::finalizeContents() {
4026
4026
// So far, section pieces have offsets from beginning of shards, but
4027
4027
// we want offsets from beginning of the whole section. Fix them.
4028
4028
parallelForEach (sections, [&](MergeInputSection *sec) {
4029
- for (size_t i = 0 , e = sec->pieces .size (); i != e; ++i)
4030
- if (sec->pieces [i].live )
4031
- sec->pieces [i].outputOff +=
4032
- shardOffsets[getShardId (sec->pieces [i].hash )];
4029
+ for (SectionPiece &piece : sec->pieces )
4030
+ if (piece.live )
4031
+ piece.outputOff += shardOffsets[getShardId (piece.hash )];
4033
4032
});
4034
4033
}
4035
4034
Original file line number Diff line number Diff line change @@ -947,9 +947,7 @@ uint64_t ObjCStubsSection::getSize() const {
947
947
948
948
void ObjCStubsSection::writeTo (uint8_t *buf) const {
949
949
uint64_t stubOffset = 0 ;
950
- for (size_t i = 0 , n = symbols.size (); i < n; ++i) {
951
- Defined *sym = symbols[i];
952
-
950
+ for (Defined *sym : symbols) {
953
951
auto methname = getMethname (sym);
954
952
InputSection *selRef = ObjCSelRefsHelper::getSelRef (methname);
955
953
assert (selRef != nullptr && " no selref for methname" );
Original file line number Diff line number Diff line change @@ -1226,9 +1226,9 @@ static void wrapSymbols(ArrayRef<WrappedSymbol> wrapped) {
1226
1226
// Update pointers in input files.
1227
1227
parallelForEach (ctx.objectFiles , [&](InputFile *file) {
1228
1228
MutableArrayRef<Symbol *> syms = file->getMutableSymbols ();
1229
- for (size_t i = 0 , e = syms. size (); i != e; ++i )
1230
- if (Symbol *s = map.lookup (syms[i] ))
1231
- syms[i] = s;
1229
+ for (Symbol *&sym : syms)
1230
+ if (Symbol *s = map.lookup (sym ))
1231
+ sym = s;
1232
1232
});
1233
1233
1234
1234
// Update pointers in the symbol table.
You can’t perform that action at this time.
0 commit comments