LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Member Functions | Protected Member Functions | List of all members
llvm::MachineOperandIteratorBase Class Reference

#include <MachineInstrBundle.h>

Inheritance diagram for llvm::MachineOperandIteratorBase:
Inheritance graph
[legend]

Classes

struct  PhysRegInfo
 
struct  VirtRegInfo
 

Public Member Functions

bool isValid () const
 isValid - Returns true until all the operands have been visited. More...
 
void operator++ ()
 Preincrement. Move to the next operand. More...
 
unsigned getOperandNo () const
 
VirtRegInfo analyzeVirtReg (unsigned Reg, SmallVectorImpl< std::pair< MachineInstr *, unsigned > > *Ops=0)
 
PhysRegInfo analyzePhysReg (unsigned Reg, const TargetRegisterInfo *TRI)
 

Protected Member Functions

 MachineOperandIteratorBase (MachineInstr *MI, bool WholeBundle)
 
MachineOperandderef () const
 

Detailed Description

MachineOperandIteratorBase - Iterator that can visit all operands on a MachineInstr, or all operands on a bundle of MachineInstrs. This class is not intended to be used directly, use one of the sub-classes instead.

Intended use:

for (MIBundleOperands MIO(MI); MIO.isValid(); ++MIO) { if (!MIO->isReg()) continue; ... }

Definition at line 94 of file MachineInstrBundle.h.

Constructor & Destructor Documentation

llvm::MachineOperandIteratorBase::MachineOperandIteratorBase ( MachineInstr MI,
bool  WholeBundle 
)
inlineexplicitprotected

MachineOperandIteratorBase - Create an iterator that visits all operands on MI, or all operands on every instruction in the bundle containing MI.

Parameters
MIThe instruction to examine.
WholeBundleWhen true, visit all operands on the entire bundle.

Definition at line 117 of file MachineInstrBundle.h.

References llvm::getBundleStart(), llvm::MachineInstr::getParent(), llvm::MachineBasicBlock::instr_end(), and llvm::A64CC::MI.

Member Function Documentation

MachineOperandIteratorBase::PhysRegInfo MachineOperandIteratorBase::analyzePhysReg ( unsigned  Reg,
const TargetRegisterInfo TRI 
)
MachineOperandIteratorBase::VirtRegInfo MachineOperandIteratorBase::analyzeVirtReg ( unsigned  Reg,
SmallVectorImpl< std::pair< MachineInstr *, unsigned > > *  Ops = 0 
)

analyzeVirtReg - Analyze how the current instruction or bundle uses a virtual register. This function should not be called after operator++(), it expects a fresh iterator.

Parameters
RegThe virtual register to analyze.
OpsWhen set, this vector will receive an (MI, OpNum) entry for each operand referring to Reg.
Returns
A filled-in RegInfo struct.

Definition at line 252 of file MachineInstrBundle.cpp.

References deref(), getOperandNo(), llvm::MachineOperand::getParent(), llvm::MachineOperand::getReg(), if(), llvm::MachineOperand::isDef(), llvm::MachineOperand::isReg(), llvm::MachineInstr::isRegTiedToDefOperand(), isValid(), llvm::MachineOperandIteratorBase::VirtRegInfo::Reads, llvm::MachineOperand::readsReg(), llvm::MachineOperandIteratorBase::VirtRegInfo::Tied, and llvm::MachineOperandIteratorBase::VirtRegInfo::Writes.

MachineOperand& llvm::MachineOperandIteratorBase::deref ( ) const
inlineprotected
unsigned llvm::MachineOperandIteratorBase::getOperandNo ( ) const
inline

getOperandNo - Returns the number of the current operand relative to its instruction.

Definition at line 147 of file MachineInstrBundle.h.

Referenced by analyzeVirtReg().

bool llvm::MachineOperandIteratorBase::isValid ( ) const
inline
void llvm::MachineOperandIteratorBase::operator++ ( )
inline

Preincrement. Move to the next operand.

Definition at line 138 of file MachineInstrBundle.h.

References isValid().


The documentation for this class was generated from the following files: