Skip to content

Commit 81a4088

Browse files
committed
[Scalar] ConstantHoistingPass - iterate with const references. NFCI.
Fix some clang-tidy warnings.
1 parent bdd6af3 commit 81a4088

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Transforms/Scalar/ConstantHoisting.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -951,7 +951,7 @@ bool ConstantHoistingPass::runImpl(Function &Fn, TargetTransformInfo &TTI,
951951
// base constant.
952952
if (!ConstIntCandVec.empty())
953953
findBaseConstants(nullptr);
954-
for (auto &MapEntry : ConstGEPCandMap)
954+
for (const auto &MapEntry : ConstGEPCandMap)
955955
if (!MapEntry.second.empty())
956956
findBaseConstants(MapEntry.first);
957957

@@ -960,7 +960,7 @@ bool ConstantHoistingPass::runImpl(Function &Fn, TargetTransformInfo &TTI,
960960
bool MadeChange = false;
961961
if (!ConstIntInfoVec.empty())
962962
MadeChange = emitBaseConstants(nullptr);
963-
for (auto MapEntry : ConstGEPInfoMap)
963+
for (const auto &MapEntry : ConstGEPInfoMap)
964964
if (!MapEntry.second.empty())
965965
MadeChange |= emitBaseConstants(MapEntry.first);
966966

0 commit comments

Comments
 (0)