mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-26 12:20:42 +00:00
Convert operand iterator over to work like an STL iterator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1720 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -187,7 +187,8 @@ MethodLiveVarInfo::getLiveVarSetAfterMInst(const MachineInstr *MI,
|
||||
// machine instruction operand.
|
||||
//
|
||||
static void applyTranferFuncForMInst(ValueSet &LVS, const MachineInstr *MInst) {
|
||||
for (MachineInstr::val_const_op_iterator OpI(MInst); !OpI.done(); ++OpI) {
|
||||
for (MachineInstr::const_val_op_iterator OpI = MInst->begin(),
|
||||
OpE = MInst->end(); OpI != OpE; ++OpI) {
|
||||
if (OpI.isDef()) // kill only if this operand is a def
|
||||
LVS.insert(*OpI); // this definition kills any uses
|
||||
}
|
||||
@@ -198,7 +199,8 @@ static void applyTranferFuncForMInst(ValueSet &LVS, const MachineInstr *MInst) {
|
||||
LVS.erase(MInst->getImplicitRef(i));
|
||||
}
|
||||
|
||||
for (MachineInstr::val_const_op_iterator OpI(MInst); !OpI.done(); ++OpI) {
|
||||
for (MachineInstr::const_val_op_iterator OpI = MInst->begin(),
|
||||
OpE = MInst->end(); OpI != OpE; ++OpI) {
|
||||
if (isa<BasicBlock>(*OpI)) continue; // don't process labels
|
||||
|
||||
if (!OpI.isDef()) // add only if this operand is a use
|
||||
@@ -206,7 +208,7 @@ static void applyTranferFuncForMInst(ValueSet &LVS, const MachineInstr *MInst) {
|
||||
}
|
||||
|
||||
// do for implicit operands as well
|
||||
for (unsigned i=0; i < MInst->getNumImplicitRefs(); ++i) {
|
||||
for (unsigned i = 0; i < MInst->getNumImplicitRefs(); ++i) {
|
||||
if (!MInst->implicitRefIsDefined(i))
|
||||
LVS.insert(MInst->getImplicitRef(i));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user