LLVM API Documentation

llvm::MachineOperand Struct Reference

#include <MachineInstr.h>

Collaboration diagram for llvm::MachineOperand:

Collaboration graph
[legend]
List of all members.

Public Types

enum  UseType { Use = USEFLAG, Def = DEFFLAG, UseAndDef = Use | Def }
enum  MachineOperandType {
  MO_Register, MO_Immediate, MO_MachineBasicBlock, MO_FrameIndex,
  MO_ConstantPoolIndex, MO_JumpTableIndex, MO_ExternalSymbol, MO_GlobalAddress
}

Public Member Functions

 MachineOperand (const MachineOperand &M)
 ~MachineOperand ()
const MachineOperandoperator= (const MachineOperand &MO)
MachineOperandType getType () const
UseType getUseType () const
bool isRegister () const
bool isImmediate () const
bool isMachineBasicBlock () const
bool isFrameIndex () const
bool isConstantPoolIndex () const
bool isJumpTableIndex () const
bool isGlobalAddress () const
bool isExternalSymbol () const
int64_t getImmedValue () const
MachineBasicBlockgetMachineBasicBlock () const
void setMachineBasicBlock (MachineBasicBlock *MBB)
int getFrameIndex () const
unsigned getConstantPoolIndex () const
unsigned getJumpTableIndex () const
GlobalValuegetGlobal () const
int getOffset () const
const char * getSymbolName () const
bool isUse () const
MachineOperandsetUse ()
bool isDef () const
MachineOperandsetDef ()
unsigned getReg () const
void setReg (unsigned Reg)
void setImmedValue (int64_t immVal)
void setOffset (int Offset)
void ChangeToImmediate (int64_t ImmVal)
void ChangeToRegister (unsigned Reg)

Friends

class MachineInstr
std::ostream & operator<< (std::ostream &os, const MachineOperand &mop)

Detailed Description

Definition at line 40 of file MachineInstr.h.


Member Enumeration Documentation

enum llvm::MachineOperand::UseType

Enumerator:
Use 
Def  only read
UseAndDef  only written

Definition at line 55 of file MachineInstr.h.

enum llvm::MachineOperand::MachineOperandType

Enumerator:
MO_Register 
MO_Immediate 
MO_MachineBasicBlock 
MO_FrameIndex 
MO_ConstantPoolIndex 
MO_JumpTableIndex 
MO_ExternalSymbol 
MO_GlobalAddress 

Definition at line 61 of file MachineInstr.h.


Constructor & Destructor Documentation

llvm::MachineOperand::MachineOperand ( const MachineOperand M  )  [inline]

Definition at line 90 of file MachineInstr.h.

References M.

llvm::MachineOperand::~MachineOperand (  )  [inline]

Definition at line 94 of file MachineInstr.h.


Member Function Documentation

const MachineOperand& llvm::MachineOperand::operator= ( const MachineOperand MO  )  [inline]

Definition at line 96 of file MachineInstr.h.

References contents, flags, offset, and opType.

MachineOperandType llvm::MachineOperand::getType (  )  const [inline]

getType - Returns the MachineOperandType for this operand.

Definition at line 106 of file MachineInstr.h.

Referenced by llvm::operator<<(), print(), llvm::X86IntelAsmPrinter::printOp(), and llvm::X86ATTAsmPrinter::printOperand().

UseType llvm::MachineOperand::getUseType (  )  const [inline]

getUseType - Returns the MachineOperandUseType of this operand.

Definition at line 110 of file MachineInstr.h.

Referenced by MakeRMIInst(), and MakeRMInst().

bool llvm::MachineOperand::isRegister (  )  const [inline]

Accessors that tell you what kind of MachineOperand you're looking at.

Definition at line 114 of file MachineInstr.h.

References MO_Register.

Referenced by llvm::TargetInstrInfo::commuteInstruction(), llvm::SparcRegisterInfo::foldMemoryOperand(), getFPReg(), getReg(), InstructionUsesRegister(), llvm::X86InstrInfo::isLoadFromStackSlot(), llvm::X86SharedAsmPrinter::isMem(), llvm::X86InstrInfo::isMoveInstr(), llvm::SparcInstrInfo::isMoveInstr(), llvm::PPCInstrInfo::isMoveInstr(), llvm::IA64InstrInfo::isMoveInstr(), llvm::ARMInstrInfo::isMoveInstr(), llvm::AlphaInstrInfo::isMoveInstr(), llvm::X86InstrInfo::isStoreToStackSlot(), llvm::X86IntelAsmPrinter::printOperand(), and setReg().

bool llvm::MachineOperand::isImmediate (  )  const [inline]

Definition at line 115 of file MachineInstr.h.

References MO_Immediate.

Referenced by llvm::X86InstrInfo::convertToThreeAddress(), getImmedValue(), llvm::X86InstrInfo::isLoadFromStackSlot(), llvm::SparcInstrInfo::isLoadFromStackSlot(), llvm::PPCInstrInfo::isLoadFromStackSlot(), llvm::X86SharedAsmPrinter::isMem(), llvm::PPCInstrInfo::isMoveInstr(), llvm::X86SharedAsmPrinter::isScale(), llvm::X86InstrInfo::isStoreToStackSlot(), llvm::SparcInstrInfo::isStoreToStackSlot(), llvm::PPCInstrInfo::isStoreToStackSlot(), isZeroImm(), MakeMIInst(), and setImmedValue().

bool llvm::MachineOperand::isMachineBasicBlock (  )  const [inline]

Definition at line 116 of file MachineInstr.h.

References MO_MachineBasicBlock.

Referenced by getMachineBasicBlock(), and setMachineBasicBlock().

bool llvm::MachineOperand::isFrameIndex (  )  const [inline]

Definition at line 117 of file MachineInstr.h.

References MO_FrameIndex.

Referenced by llvm::X86RegisterInfo::eliminateFrameIndex(), llvm::SparcRegisterInfo::eliminateFrameIndex(), llvm::PPCRegisterInfo::eliminateFrameIndex(), llvm::IA64RegisterInfo::eliminateFrameIndex(), llvm::AlphaRegisterInfo::eliminateFrameIndex(), getFrameIndex(), llvm::X86InstrInfo::isLoadFromStackSlot(), llvm::SparcInstrInfo::isLoadFromStackSlot(), llvm::PPCInstrInfo::isLoadFromStackSlot(), llvm::AlphaInstrInfo::isLoadFromStackSlot(), llvm::X86SharedAsmPrinter::isMem(), llvm::X86InstrInfo::isStoreToStackSlot(), llvm::SparcInstrInfo::isStoreToStackSlot(), llvm::PPCInstrInfo::isStoreToStackSlot(), llvm::AlphaInstrInfo::isStoreToStackSlot(), llvm::X86IntelAsmPrinter::printMemReference(), and llvm::X86ATTAsmPrinter::printMemReference().

bool llvm::MachineOperand::isConstantPoolIndex (  )  const [inline]

Definition at line 118 of file MachineInstr.h.

References MO_ConstantPoolIndex.

Referenced by getConstantPoolIndex(), getOffset(), llvm::X86SharedAsmPrinter::isMem(), llvm::X86IntelAsmPrinter::printMemReference(), llvm::X86ATTAsmPrinter::printMemReference(), and setOffset().

bool llvm::MachineOperand::isJumpTableIndex (  )  const [inline]

Definition at line 119 of file MachineInstr.h.

References MO_JumpTableIndex.

Referenced by getJumpTableIndex(), MakeMIInst(), and setOffset().

bool llvm::MachineOperand::isGlobalAddress (  )  const [inline]

Definition at line 120 of file MachineInstr.h.

References MO_GlobalAddress.

Referenced by getGlobal(), getOffset(), llvm::X86SharedAsmPrinter::isMem(), MakeMIInst(), llvm::X86IntelAsmPrinter::printMemReference(), llvm::X86ATTAsmPrinter::printMemReference(), and setOffset().

bool llvm::MachineOperand::isExternalSymbol (  )  const [inline]

Definition at line 121 of file MachineInstr.h.

References MO_ExternalSymbol.

Referenced by getNumBytesForInstruction(), getOffset(), getSymbolName(), llvm::AsmPrinter::printInlineAsm(), and setOffset().

int64_t llvm::MachineOperand::getImmedValue (  )  const [inline]

Definition at line 123 of file MachineInstr.h.

References isImmediate().

Referenced by llvm::X86InstrInfo::commuteInstruction(), llvm::X86InstrInfo::convertToThreeAddress(), llvm::X86RegisterInfo::eliminateCallFramePseudoInstr(), llvm::SparcRegisterInfo::eliminateCallFramePseudoInstr(), llvm::PPCRegisterInfo::eliminateCallFramePseudoInstr(), llvm::IA64RegisterInfo::eliminateCallFramePseudoInstr(), llvm::AlphaRegisterInfo::eliminateCallFramePseudoInstr(), llvm::X86RegisterInfo::eliminateFrameIndex(), llvm::SparcRegisterInfo::eliminateFrameIndex(), llvm::PPCRegisterInfo::eliminateFrameIndex(), llvm::ARMRegisterInfo::eliminateFrameIndex(), llvm::X86TargetLowering::InsertAtEndOfBasicBlock(), llvm::PPCTargetLowering::InsertAtEndOfBasicBlock(), llvm::X86InstrInfo::isLoadFromStackSlot(), llvm::SparcInstrInfo::isLoadFromStackSlot(), llvm::PPCInstrInfo::isLoadFromStackSlot(), llvm::PPCInstrInfo::isMoveInstr(), llvm::X86SharedAsmPrinter::isScale(), llvm::X86InstrInfo::isStoreToStackSlot(), llvm::SparcInstrInfo::isStoreToStackSlot(), llvm::PPCInstrInfo::isStoreToStackSlot(), isZeroImm(), MakeMIInst(), MakeMRIInst(), MakeRMIInst(), llvm::operator<<(), print(), llvm::AsmPrinter::printInlineAsm(), llvm::X86IntelAsmPrinter::printMemReference(), llvm::X86ATTAsmPrinter::printMemReference(), llvm::X86IntelAsmPrinter::printOp(), llvm::X86ATTAsmPrinter::printOperand(), llvm::X86IntelAsmPrinter::printSSECC(), and llvm::X86ATTAsmPrinter::printSSECC().

MachineBasicBlock* llvm::MachineOperand::getMachineBasicBlock (  )  const [inline]

Definition at line 127 of file MachineInstr.h.

References isMachineBasicBlock().

Referenced by llvm::operator<<(), print(), llvm::X86IntelAsmPrinter::printOp(), llvm::X86ATTAsmPrinter::printOperand(), and llvm::LiveVariables::runOnMachineFunction().

void llvm::MachineOperand::setMachineBasicBlock ( MachineBasicBlock MBB  )  [inline]

Definition at line 131 of file MachineInstr.h.

References isMachineBasicBlock().

int llvm::MachineOperand::getFrameIndex (  )  const [inline]

Definition at line 135 of file MachineInstr.h.

References isFrameIndex().

Referenced by llvm::X86RegisterInfo::eliminateFrameIndex(), llvm::SparcRegisterInfo::eliminateFrameIndex(), llvm::PPCRegisterInfo::eliminateFrameIndex(), llvm::IA64RegisterInfo::eliminateFrameIndex(), llvm::ARMRegisterInfo::eliminateFrameIndex(), llvm::AlphaRegisterInfo::eliminateFrameIndex(), llvm::X86InstrInfo::isLoadFromStackSlot(), llvm::SparcInstrInfo::isLoadFromStackSlot(), llvm::PPCInstrInfo::isLoadFromStackSlot(), llvm::AlphaInstrInfo::isLoadFromStackSlot(), llvm::X86InstrInfo::isStoreToStackSlot(), llvm::SparcInstrInfo::isStoreToStackSlot(), llvm::PPCInstrInfo::isStoreToStackSlot(), llvm::AlphaInstrInfo::isStoreToStackSlot(), llvm::operator<<(), print(), llvm::X86IntelAsmPrinter::printMemReference(), and llvm::X86ATTAsmPrinter::printMemReference().

unsigned llvm::MachineOperand::getConstantPoolIndex (  )  const [inline]

Definition at line 139 of file MachineInstr.h.

References isConstantPoolIndex().

Referenced by llvm::operator<<(), print(), llvm::X86IntelAsmPrinter::printOp(), and llvm::X86ATTAsmPrinter::printOperand().

unsigned llvm::MachineOperand::getJumpTableIndex (  )  const [inline]

Definition at line 143 of file MachineInstr.h.

References isJumpTableIndex().

Referenced by MakeMIInst(), llvm::operator<<(), print(), and llvm::X86ATTAsmPrinter::printOperand().

GlobalValue* llvm::MachineOperand::getGlobal (  )  const [inline]

Definition at line 147 of file MachineInstr.h.

References isGlobalAddress().

Referenced by MakeMIInst(), llvm::operator<<(), print(), llvm::X86IntelAsmPrinter::printOp(), and llvm::X86ATTAsmPrinter::printOperand().

int llvm::MachineOperand::getOffset (  )  const [inline]

Definition at line 151 of file MachineInstr.h.

References isConstantPoolIndex(), isExternalSymbol(), and isGlobalAddress().

Referenced by MakeMIInst(), print(), llvm::X86IntelAsmPrinter::printOp(), and llvm::X86ATTAsmPrinter::printOperand().

const char* llvm::MachineOperand::getSymbolName (  )  const [inline]

Definition at line 156 of file MachineInstr.h.

References isExternalSymbol().

Referenced by getNumBytesForInstruction(), llvm::operator<<(), print(), llvm::AsmPrinter::printInlineAsm(), llvm::X86IntelAsmPrinter::printOp(), and llvm::X86ATTAsmPrinter::printOperand().

bool llvm::MachineOperand::isUse (  )  const [inline]

MachineOperand methods for testing that work on any kind of MachineOperand...

Definition at line 164 of file MachineInstr.h.

Referenced by InstructionUsesRegister(), llvm::operator<<(), and llvm::VirtRegMap::virtFolded().

MachineOperand& llvm::MachineOperand::setUse (  )  [inline]

Definition at line 165 of file MachineInstr.h.

Referenced by llvm::IA64RegisterInfo::eliminateFrameIndex().

bool llvm::MachineOperand::isDef (  )  const [inline]

Definition at line 166 of file MachineInstr.h.

Referenced by llvm::operator<<(), llvm::AsmPrinter::printInlineAsm(), and llvm::VirtRegMap::virtFolded().

MachineOperand& llvm::MachineOperand::setDef (  )  [inline]

Definition at line 167 of file MachineInstr.h.

unsigned llvm::MachineOperand::getReg (  )  const [inline]

getReg - Returns the register number.

Definition at line 171 of file MachineInstr.h.

References isRegister().

Referenced by llvm::X86InstrInfo::commuteInstruction(), llvm::TargetInstrInfo::commuteInstruction(), llvm::PPCInstrInfo::commuteInstruction(), llvm::X86InstrInfo::convertToThreeAddress(), llvm::PPCRegisterInfo::eliminateFrameIndex(), llvm::SparcRegisterInfo::foldMemoryOperand(), llvm::PPCRegisterInfo::foldMemoryOperand(), llvm::AlphaRegisterInfo::foldMemoryOperand(), getFPReg(), HandleVRSaveUpdate(), llvm::X86TargetLowering::InsertAtEndOfBasicBlock(), llvm::PPCTargetLowering::InsertAtEndOfBasicBlock(), llvm::LiveVariables::instructionChanged(), InstructionUsesRegister(), llvm::X86InstrInfo::isLoadFromStackSlot(), llvm::SparcInstrInfo::isLoadFromStackSlot(), llvm::PPCInstrInfo::isLoadFromStackSlot(), llvm::AlphaInstrInfo::isLoadFromStackSlot(), llvm::X86InstrInfo::isMoveInstr(), llvm::SparcInstrInfo::isMoveInstr(), llvm::PPCInstrInfo::isMoveInstr(), llvm::IA64InstrInfo::isMoveInstr(), llvm::ARMInstrInfo::isMoveInstr(), llvm::AlphaInstrInfo::isMoveInstr(), llvm::X86InstrInfo::isStoreToStackSlot(), llvm::SparcInstrInfo::isStoreToStackSlot(), llvm::PPCInstrInfo::isStoreToStackSlot(), llvm::AlphaInstrInfo::isStoreToStackSlot(), MakeMRIInst(), MakeMRInst(), MakeRMIInst(), MakeRMInst(), llvm::operator<<(), print(), llvm::X86IntelAsmPrinter::printAsmMRegister(), llvm::X86ATTAsmPrinter::printAsmMRegister(), llvm::X86IntelAsmPrinter::printMachineInstruction(), llvm::X86ATTAsmPrinter::printMachineInstruction(), llvm::X86IntelAsmPrinter::printMemReference(), llvm::X86ATTAsmPrinter::printMemReference(), llvm::X86IntelAsmPrinter::printOp(), llvm::X86IntelAsmPrinter::printOperand(), and llvm::X86ATTAsmPrinter::printOperand().

void llvm::MachineOperand::setReg ( unsigned  Reg  )  [inline]

MachineOperand mutators.

Definition at line 178 of file MachineInstr.h.

References isRegister().

Referenced by llvm::LiveIntervals::addIntervalsForSpills(), and llvm::TargetInstrInfo::commuteInstruction().

void llvm::MachineOperand::setImmedValue ( int64_t  immVal  )  [inline]

Definition at line 183 of file MachineInstr.h.

References isImmediate().

void llvm::MachineOperand::setOffset ( int  Offset  )  [inline]

Definition at line 188 of file MachineInstr.h.

References isConstantPoolIndex(), isExternalSymbol(), isGlobalAddress(), and isJumpTableIndex().

void llvm::MachineOperand::ChangeToImmediate ( int64_t  ImmVal  )  [inline]

ChangeToImmediate - Replace this operand with a new immediate operand of the specified value. If an operand is known to be an immediate already, the setImmedValue method should be used.

Definition at line 198 of file MachineInstr.h.

References MO_Immediate.

Referenced by llvm::X86RegisterInfo::eliminateFrameIndex(), llvm::SparcRegisterInfo::eliminateFrameIndex(), llvm::PPCRegisterInfo::eliminateFrameIndex(), llvm::ARMRegisterInfo::eliminateFrameIndex(), and llvm::AlphaRegisterInfo::eliminateFrameIndex().

void llvm::MachineOperand::ChangeToRegister ( unsigned  Reg  )  [inline]

ChangeToRegister - Replace this operand with a new register operand of the specified value. If an operand is known to be an register already, the setReg method should be used.

Definition at line 206 of file MachineInstr.h.

References MO_Register.

Referenced by llvm::X86RegisterInfo::eliminateFrameIndex(), llvm::SparcRegisterInfo::eliminateFrameIndex(), llvm::PPCRegisterInfo::eliminateFrameIndex(), llvm::IA64RegisterInfo::eliminateFrameIndex(), llvm::ARMRegisterInfo::eliminateFrameIndex(), and llvm::AlphaRegisterInfo::eliminateFrameIndex().


Friends And Related Function Documentation

friend class MachineInstr [friend]

Definition at line 213 of file MachineInstr.h.

std::ostream& operator<< ( std::ostream &  os,
const MachineOperand mop 
) [friend]

Definition at line 217 of file MachineInstr.cpp.


The documentation for this struct was generated from the following file: