//===-- BBLiveVar.cpp - Live Variable Analysis for a BasicBlock -----------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file was developed by the LLVM research group and is distributed under
+// the University of Illinois Open Source License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
//
// This is a wrapper class for BasicBlock which is used by live var analysis.
//
// iterate over MI operands to find defs
for (MachineInstr::const_val_op_iterator OpI = MI->begin(), OpE = MI->end();
OpI != OpE; ++OpI)
- if (OpI.isDef()) // add to Defs only if this operand is a def
+ if (OpI.isDefOnly() || OpI.isDefAndUse()) // add to Defs if this operand is a def
addDef(*OpI);
// do for implicit operands as well
for (unsigned i = 0; i < MI->getNumImplicitRefs(); ++i)
- if (MI->implicitRefIsDefined(i))
+ if (MI->getImplicitOp(i).opIsDefOnly() || MI->getImplicitOp(i).opIsDefAndUse())
addDef(MI->getImplicitRef(i));
// iterate over MI operands to find uses
if (isa<BasicBlock>(Op))
continue; // don't process labels
- if (!OpI.isDef() || OpI.isDefAndUse()) {
+ if (OpI.isUseOnly() || OpI.isDefAndUse()) {
// add to Uses only if this operand is a use
//
// *** WARNING: The following code for handling dummy PHI machine
// do for implicit operands as well
for (unsigned i = 0; i < MI->getNumImplicitRefs(); ++i) {
- assert(MI->getOpCode() != V9::PHI && "Phi cannot have implicit opeands");
+ assert(MI->getOpCode() != V9::PHI && "Phi cannot have implicit operands");
const Value *Op = MI->getImplicitRef(i);
if (Op->getType() == Type::LabelTy) // don't process labels
continue;
- if (!MI->implicitRefIsDefined(i) || MI->implicitRefIsDefinedAndUsed(i) )
+ if (MI->getImplicitOp(i).opIsUse() || MI->getImplicitOp(i).opIsDefAndUse())
addUse(Op);
}
} // for all machine instructions