From: Dan Gohman Date: Mon, 28 Apr 2008 17:42:03 +0000 (+0000) Subject: Don't call size() on each iteration of the loop. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b20d4f8d499c4c5315de69bd22c652665a7e3ab8;p=oota-llvm.git Don't call size() on each iteration of the loop. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50361 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 500caaf71c9..f883209b568 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -158,7 +158,7 @@ namespace { unsigned Reg, const Type *Ty) : TLI(&tli) { ComputeValueVTs(tli, Ty, ValueVTs); - for (unsigned Value = 0; Value != ValueVTs.size(); ++Value) { + for (unsigned Value = 0, e = ValueVTs.size(); Value != e; ++Value) { MVT::ValueType ValueVT = ValueVTs[Value]; unsigned NumRegs = TLI->getNumRegisters(ValueVT); MVT::ValueType RegisterVT = TLI->getRegisterType(ValueVT); @@ -364,7 +364,7 @@ unsigned FunctionLoweringInfo::CreateRegForValue(const Value *V) { ComputeValueVTs(TLI, V->getType(), ValueVTs); unsigned FirstReg = 0; - for (unsigned Value = 0; Value != ValueVTs.size(); ++Value) { + for (unsigned Value = 0, e = ValueVTs.size(); Value != e; ++Value) { MVT::ValueType ValueVT = ValueVTs[Value]; MVT::ValueType RegisterVT = TLI.getRegisterType(ValueVT);