From: Dan Gohman Date: Mon, 16 Aug 2010 16:30:01 +0000 (+0000) Subject: Use const_iterator in a few places. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=8d9c7a67015d6e9413f96eca26633ad7ec74d013;p=oota-llvm.git Use const_iterator in a few places. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111144 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp index e4c96438fe3..20b886e4aa0 100644 --- a/lib/Analysis/ScalarEvolution.cpp +++ b/lib/Analysis/ScalarEvolution.cpp @@ -1494,7 +1494,7 @@ const SCEV *ScalarEvolution::getAddExpr(SmallVectorImpl &Ops, // re-generate the operands list. Group the operands by constant scale, // to avoid multiplying by the same constant scale multiple times. std::map, APIntCompare> MulOpLists; - for (SmallVector::iterator I = NewOps.begin(), + for (SmallVector::const_iterator I = NewOps.begin(), E = NewOps.end(); I != E; ++I) MulOpLists[M.find(*I)->second].push_back(*I); // Re-generate the operands list. @@ -2465,7 +2465,7 @@ const SCEV *ScalarEvolution::getCouldNotCompute() { const SCEV *ScalarEvolution::getSCEV(Value *V) { assert(isSCEVable(V->getType()) && "Value is not SCEVable!"); - std::map::iterator I = Scalars.find(V); + std::map::const_iterator I = Scalars.find(V); if (I != Scalars.end()) return I->second; const SCEV *S = createSCEV(V); Scalars.insert(std::make_pair(SCEVCallbackVH(V, this), S)); @@ -4284,7 +4284,7 @@ Constant * ScalarEvolution::getConstantEvolutionLoopExitValue(PHINode *PN, const APInt &BEs, const Loop *L) { - std::map::iterator I = + std::map::const_iterator I = ConstantEvolutionLoopExitValue.find(PN); if (I != ConstantEvolutionLoopExitValue.end()) return I->second;