diff --git a/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp b/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp index 613c16db751..ffb45d64130 100644 --- a/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp +++ b/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp @@ -200,11 +200,10 @@ void PhyRegAlloc::setCallInterferences(const MachineInstr *MInst, if (DEBUG_RA >= RA_DEBUG_Interference) cerr << "\n For call inst: " << *MInst; - ValueSet::const_iterator LIt = LVSetAft->begin(); - // for each live var in live variable set after machine inst // - for ( ; LIt != LVSetAft->end(); ++LIt) { + for (ValueSet::const_iterator LIt = LVSetAft->begin(), LEnd = LVSetAft->end(); + LIt != LEnd; ++LIt) { // get the live range corresponding to live var // diff --git a/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp b/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp index 613c16db751..ffb45d64130 100644 --- a/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp +++ b/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp @@ -200,11 +200,10 @@ void PhyRegAlloc::setCallInterferences(const MachineInstr *MInst, if (DEBUG_RA >= RA_DEBUG_Interference) cerr << "\n For call inst: " << *MInst; - ValueSet::const_iterator LIt = LVSetAft->begin(); - // for each live var in live variable set after machine inst // - for ( ; LIt != LVSetAft->end(); ++LIt) { + for (ValueSet::const_iterator LIt = LVSetAft->begin(), LEnd = LVSetAft->end(); + LIt != LEnd; ++LIt) { // get the live range corresponding to live var //