[llvm] 1fd2436 - [CodeGen] Use range-based for loops (NFC) (#140840)
via llvm-commits
llvm-commits at lists.llvm.org
Tue May 20 21:40:02 PDT 2025
Author: Kazu Hirata
Date: 2025-05-20T21:39:59-07:00
New Revision: 1fd24369c31d5bc980ff45e0aa788f46288c129c
URL: https://github.com/llvm/llvm-project/commit/1fd24369c31d5bc980ff45e0aa788f46288c129c
DIFF: https://github.com/llvm/llvm-project/commit/1fd24369c31d5bc980ff45e0aa788f46288c129c.diff
LOG: [CodeGen] Use range-based for loops (NFC) (#140840)
Added:
Modified:
llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index fdb81b05d9490..4aaa96c81bbc1 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -2878,17 +2878,16 @@ void AsmPrinter::emitConstantPool() {
// Now print stuff into the calculated sections.
const MCSection *CurSection = nullptr;
unsigned Offset = 0;
- for (unsigned i = 0, e = CPSections.size(); i != e; ++i) {
- for (unsigned j = 0, ee = CPSections[i].CPEs.size(); j != ee; ++j) {
- unsigned CPI = CPSections[i].CPEs[j];
+ for (const SectionCPs &CPSection : CPSections) {
+ for (unsigned CPI : CPSection.CPEs) {
MCSymbol *Sym = GetCPISymbol(CPI);
if (!Sym->isUndefined())
continue;
- if (CurSection != CPSections[i].S) {
- OutStreamer->switchSection(CPSections[i].S);
- emitAlignment(Align(CPSections[i].Alignment));
- CurSection = CPSections[i].S;
+ if (CurSection != CPSection.S) {
+ OutStreamer->switchSection(CPSection.S);
+ emitAlignment(Align(CPSection.Alignment));
+ CurSection = CPSection.S;
Offset = 0;
}
More information about the llvm-commits
mailing list