From 7b4658ff87432084900a9f19f6e0fa00fda3e4d2 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Sun, 26 Jun 2016 14:49:00 +0000 Subject: Apply clang-tidy's modernize-loop-convert to lib/MC. Only minor manual fixes. No functionality change intended. llvm-svn: 273814 --- llvm/lib/MC/ConstantPools.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'llvm/lib/MC/ConstantPools.cpp') diff --git a/llvm/lib/MC/ConstantPools.cpp b/llvm/lib/MC/ConstantPools.cpp index 9643b759468..17a23d063b7 100644 --- a/llvm/lib/MC/ConstantPools.cpp +++ b/llvm/lib/MC/ConstantPools.cpp @@ -25,11 +25,10 @@ void ConstantPool::emitEntries(MCStreamer &Streamer) { if (Entries.empty()) return; Streamer.EmitDataRegion(MCDR_DataRegion); - for (EntryVecTy::const_iterator I = Entries.begin(), E = Entries.end(); - I != E; ++I) { - Streamer.EmitCodeAlignment(I->Size); // align naturally - Streamer.EmitLabel(I->Label); - Streamer.EmitValue(I->Value, I->Size, I->Loc); + for (const ConstantPoolEntry &Entry : Entries) { + Streamer.EmitCodeAlignment(Entry.Size); // align naturally + Streamer.EmitLabel(Entry.Label); + Streamer.EmitValue(Entry.Value, Entry.Size, Entry.Loc); } Streamer.EmitDataRegion(MCDR_DataRegionEnd); Entries.clear(); @@ -71,11 +70,9 @@ static void emitConstantPool(MCStreamer &Streamer, MCSection *Section, void AssemblerConstantPools::emitAll(MCStreamer &Streamer) { // Dump contents of assembler constant pools. - for (ConstantPoolMapTy::iterator CPI = ConstantPools.begin(), - CPE = ConstantPools.end(); - CPI != CPE; ++CPI) { - MCSection *Section = CPI->first; - ConstantPool &CP = CPI->second; + for (auto &CPI : ConstantPools) { + MCSection *Section = CPI.first; + ConstantPool &CP = CPI.second; emitConstantPool(Streamer, Section, CP); } -- cgit v1.2.3