[Scalar] ConstantHoistingPass - iterate with const references. NFCI.

Fix some clang-tidy warnings.
This commit is contained in:
Simon Pilgrim 2020-09-24 18:28:21 +01:00
parent bdd6af3a58
commit 81a408808f
1 changed files with 2 additions and 2 deletions

View File

@ -951,7 +951,7 @@ bool ConstantHoistingPass::runImpl(Function &Fn, TargetTransformInfo &TTI,
// base constant.
if (!ConstIntCandVec.empty())
findBaseConstants(nullptr);
for (auto &MapEntry : ConstGEPCandMap)
for (const auto &MapEntry : ConstGEPCandMap)
if (!MapEntry.second.empty())
findBaseConstants(MapEntry.first);
@ -960,7 +960,7 @@ bool ConstantHoistingPass::runImpl(Function &Fn, TargetTransformInfo &TTI,
bool MadeChange = false;
if (!ConstIntInfoVec.empty())
MadeChange = emitBaseConstants(nullptr);
for (auto MapEntry : ConstGEPInfoMap)
for (const auto &MapEntry : ConstGEPInfoMap)
if (!MapEntry.second.empty())
MadeChange |= emitBaseConstants(MapEntry.first);