Skip to content

Commit 1fd2436

Browse files
[CodeGen] Use range-based for loops (NFC) (#140840)
1 parent 557448e commit 1fd2436

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2878,17 +2878,16 @@ void AsmPrinter::emitConstantPool() {
28782878
// Now print stuff into the calculated sections.
28792879
const MCSection *CurSection = nullptr;
28802880
unsigned Offset = 0;
2881-
for (unsigned i = 0, e = CPSections.size(); i != e; ++i) {
2882-
for (unsigned j = 0, ee = CPSections[i].CPEs.size(); j != ee; ++j) {
2883-
unsigned CPI = CPSections[i].CPEs[j];
2881+
for (const SectionCPs &CPSection : CPSections) {
2882+
for (unsigned CPI : CPSection.CPEs) {
28842883
MCSymbol *Sym = GetCPISymbol(CPI);
28852884
if (!Sym->isUndefined())
28862885
continue;
28872886

2888-
if (CurSection != CPSections[i].S) {
2889-
OutStreamer->switchSection(CPSections[i].S);
2890-
emitAlignment(Align(CPSections[i].Alignment));
2891-
CurSection = CPSections[i].S;
2887+
if (CurSection != CPSection.S) {
2888+
OutStreamer->switchSection(CPSection.S);
2889+
emitAlignment(Align(CPSection.Alignment));
2890+
CurSection = CPSection.S;
28922891
Offset = 0;
28932892
}
28942893

0 commit comments

Comments
 (0)