diff --git a/llvm/include/llvm/Object/ELF.h b/llvm/include/llvm/Object/ELF.h --- a/llvm/include/llvm/Object/ELF.h +++ b/llvm/include/llvm/Object/ELF.h @@ -776,7 +776,7 @@ return; FakeSectionStrings += '\0'; - for (auto [Idx, Phdr] : llvm::enumerate(*PhdrsOrErr)) { + for (auto& [Idx, Phdr] : llvm::enumerate(*PhdrsOrErr)) { if (Phdr.p_type != ELF::PT_LOAD || !(Phdr.p_flags & ELF::PF_X)) continue; Elf_Shdr FakeShdr = {}; diff --git a/llvm/lib/CodeGen/MLRegallocEvictAdvisor.cpp b/llvm/lib/CodeGen/MLRegallocEvictAdvisor.cpp --- a/llvm/lib/CodeGen/MLRegallocEvictAdvisor.cpp +++ b/llvm/lib/CodeGen/MLRegallocEvictAdvisor.cpp @@ -892,7 +892,7 @@ NrRematerializable += LIFC.IsRemat; if (EnableDevelopmentFeatures) { - for (auto CurrentSegment : LI) { + for (auto &CurrentSegment : LI) { LRPosInfo.push_back( LRStartEndInfo{CurrentSegment.start, CurrentSegment.end, Pos}); }