LLVM API Documentation

llvm::MachineOperand Struct Reference

#include <MachineInstr.h>

Collaboration diagram for llvm::MachineOperand:

Collaboration graph
[legend]
List of all members.

Public Types

 Use = USEFLAG
 Def = DEFFLAG
 only read
 UseAndDef = Use | Def
 only written
 MO_VirtualRegister
 MO_MachineRegister
 MO_CCRegister
 MO_SignExtendedImmed
 MO_UnextendedImmed
 MO_PCRelativeDisp
 MO_MachineBasicBlock
 MO_FrameIndex
 MO_ConstantPoolIndex
 MO_ExternalSymbol
 MO_GlobalAddress
enum  UseType { Use = USEFLAG, Def = DEFFLAG, UseAndDef = Use | Def }
enum  MachineOperandType {
  MO_VirtualRegister, MO_MachineRegister, MO_CCRegister, MO_SignExtendedImmed,
  MO_UnextendedImmed, MO_PCRelativeDisp, MO_MachineBasicBlock, MO_FrameIndex,
  MO_ConstantPoolIndex, MO_ExternalSymbol, MO_GlobalAddress
}

Public Member Functions

 MachineOperand (const MachineOperand &M)
 ~MachineOperand ()
const MachineOperandoperator= (const MachineOperand &MO)
MachineOperandType getType () const
UseType getUseType () const
bool isPCRelative () const
bool isRegister () const
bool isMachineBasicBlock () const
bool isPCRelativeDisp () const
bool isImmediate () const
bool isFrameIndex () const
bool isConstantPoolIndex () const
bool isGlobalAddress () const
bool isExternalSymbol () const
ValuegetVRegValueOrNull () const
ValuegetVRegValue () const
int getMachineRegNum () const
int64_t getImmedValue () const
MachineBasicBlockgetMachineBasicBlock () const
void setMachineBasicBlock (MachineBasicBlock *MBB)
int getFrameIndex () const
unsigned getConstantPoolIndex () const
GlobalValuegetGlobal () const
int getOffset () const
const char * getSymbolName () const
bool isUse () const
MachineOperandsetUse ()
bool isDef () const
MachineOperandsetDef ()
bool isHiBits32 () const
bool isLoBits32 () const
bool isHiBits64 () const
bool isLoBits64 () const
bool hasAllocatedReg () const
unsigned getReg () const
void setReg (unsigned Reg)
void setValueReg (Value *val)
void setImmedValue (int immVal)
void setOffset (int Offset)
void markHi32 ()
void markLo32 ()
void markHi64 ()
void markLo64 ()

Friends

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

Detailed Description

Definition at line 72 of file MachineInstr.h.


Member Enumeration Documentation

enum llvm::MachineOperand::MachineOperandType

Enumerator:
MO_VirtualRegister 
MO_MachineRegister 
MO_CCRegister 
MO_SignExtendedImmed 
MO_UnextendedImmed 
MO_PCRelativeDisp 
MO_MachineBasicBlock 
MO_FrameIndex 
MO_ConstantPoolIndex 
MO_ExternalSymbol 
MO_GlobalAddress 

Definition at line 98 of file MachineInstr.h.

enum llvm::MachineOperand::UseType

Enumerator:
Use 
Def  only read
UseAndDef  only written

Definition at line 92 of file MachineInstr.h.


Constructor & Destructor Documentation

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

Definition at line 193 of file MachineInstr.h.

References M.

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

Definition at line 201 of file MachineInstr.h.


Member Function Documentation

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

Definition at line 284 of file MachineInstr.h.

References isConstantPoolIndex().

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

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

Definition at line 280 of file MachineInstr.h.

References isFrameIndex().

Referenced by llvm::X86RegisterInfo::eliminateFrameIndex(), llvm::SparcRegisterInfo::eliminateFrameIndex(), llvm::PPCRegisterInfo::eliminateFrameIndex(), llvm::IA64RegisterInfo::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().

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

Definition at line 288 of file MachineInstr.h.

References isGlobalAddress().

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

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

Definition at line 268 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::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(), llvm::IsUselessCopy(), 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 272 of file MachineInstr.h.

References isMachineBasicBlock().

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

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

Definition at line 264 of file MachineInstr.h.

References MO_MachineRegister.

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

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

Definition at line 292 of file MachineInstr.h.

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

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

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

getReg - Returns the register number. It is a runtime error to call this if a register is not allocated.

Definition at line 326 of file MachineInstr.h.

References hasAllocatedReg().

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(), llvm::CallArgsDescriptor::get(), 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::AlphaInstrInfo::isMoveInstr(), llvm::X86InstrInfo::isStoreToStackSlot(), llvm::SparcInstrInfo::isStoreToStackSlot(), llvm::PPCInstrInfo::isStoreToStackSlot(), llvm::AlphaInstrInfo::isStoreToStackSlot(), llvm::IsUselessCopy(), MakeMRIInst(), MakeMRInst(), MakeRMIInst(), MakeRMInst(), llvm::operator<<(), print(), llvm::X86IntelAsmPrinter::printMemReference(), llvm::X86ATTAsmPrinter::printMemReference(), llvm::X86IntelAsmPrinter::printOp(), llvm::X86IntelAsmPrinter::printOperand(), and llvm::X86ATTAsmPrinter::printOperand().

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

Definition at line 297 of file MachineInstr.h.

References isExternalSymbol().

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

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

getType - Returns the MachineOperandType for this operand.

Definition at line 213 of file MachineInstr.h.

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

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

getUseType - Returns the MachineOperandUseType of this operand.

Definition at line 217 of file MachineInstr.h.

Referenced by MakeRMIInst(), and MakeRMInst().

Value* llvm::MachineOperand::getVRegValue (  )  const [inline]

MachineOperand accessors that only work on certain types of MachineOperand...

Definition at line 259 of file MachineInstr.h.

References isPCRelativeDisp(), MO_CCRegister, and MO_VirtualRegister.

Referenced by llvm::CallArgsDescriptor::get(), llvm::MachineInstr::getImplicitRef(), llvm::isVarArgsCall(), llvm::MSchedGraphSB::MSchedGraphSB(), llvm::operator<<(), print(), and llvm::SparcV9RegInfo::suggestReg4RetValue().

Value* llvm::MachineOperand::getVRegValueOrNull (  )  const [inline]

getVRegValueOrNull - Get the Value* out of a MachineOperand if it has one. This is deprecated and only used by the SPARC v9 backend.

Definition at line 251 of file MachineInstr.h.

References isPCRelativeDisp(), MO_CCRegister, and MO_VirtualRegister.

Referenced by llvm::X86IntelAsmPrinter::printOp(), and setValueReg().

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

hasAllocatedReg - Returns true iff a machine register has been allocated to this operand.

Definition at line 317 of file MachineInstr.h.

References MO_CCRegister, MO_MachineRegister, and MO_VirtualRegister.

Referenced by getReg(), llvm::IsUselessCopy(), llvm::operator<<(), print(), and setReg().

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

Definition at line 244 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::isDef (  )  const [inline]

Definition at line 307 of file MachineInstr.h.

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

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

Definition at line 246 of file MachineInstr.h.

References MO_ExternalSymbol.

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

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

Definition at line 243 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::isGlobalAddress (  )  const [inline]

Definition at line 245 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::isHiBits32 (  )  const [inline]

Definition at line 309 of file MachineInstr.h.

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

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

Definition at line 311 of file MachineInstr.h.

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

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

Definition at line 240 of file MachineInstr.h.

References MO_SignExtendedImmed, and MO_UnextendedImmed.

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::isLoBits32 (  )  const [inline]

Definition at line 310 of file MachineInstr.h.

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

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

Definition at line 312 of file MachineInstr.h.

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

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

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

Definition at line 238 of file MachineInstr.h.

References MO_MachineBasicBlock.

Referenced by getMachineBasicBlock(), and setMachineBasicBlock().

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

isPCRelative - This returns the value of the PCRELATIVE flag, which indicates whether this operand should be emitted as a PC relative value instead of a global address. This is used for operands of the forms: MachineBasicBlock, GlobalAddress, ExternalSymbol

Definition at line 224 of file MachineInstr.h.

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

Definition at line 239 of file MachineInstr.h.

References MO_PCRelativeDisp.

Referenced by getVRegValue(), and getVRegValueOrNull().

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

isRegister - Return true if this operand is a register operand. The X86 backend currently can't decide whether to use MO_MR or MO_VR to represent them, so we accept both.

Note: The sparc backend should not use this method.

Definition at line 232 of file MachineInstr.h.

References MO_MachineRegister, and MO_VirtualRegister.

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

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

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

Definition at line 305 of file MachineInstr.h.

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

void llvm::MachineOperand::markHi32 (  )  [inline]

markHi32, markLo32, etc. - These methods are deprecated and only used by the SPARC v9 back-end.

Definition at line 361 of file MachineInstr.h.

Referenced by llvm::SparcV9RegInfo::cpMem2RegMI(), llvm::SparcV9RegInfo::cpReg2MemMI(), and llvm::SparcV9CodeEmitter::runOnMachineFunction().

void llvm::MachineOperand::markHi64 (  )  [inline]

Definition at line 363 of file MachineInstr.h.

Referenced by llvm::SparcV9CodeEmitter::runOnMachineFunction().

void llvm::MachineOperand::markLo32 (  )  [inline]

Definition at line 362 of file MachineInstr.h.

Referenced by llvm::SparcV9RegInfo::cpMem2RegMI(), llvm::SparcV9RegInfo::cpReg2MemMI(), and llvm::SparcV9CodeEmitter::runOnMachineFunction().

void llvm::MachineOperand::markLo64 (  )  [inline]

Definition at line 364 of file MachineInstr.h.

Referenced by llvm::SparcV9CodeEmitter::runOnMachineFunction().

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

Definition at line 203 of file MachineInstr.h.

References contents, extra, flags, and opType.

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

Definition at line 308 of file MachineInstr.h.

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

Definition at line 345 of file MachineInstr.h.

References isImmediate().

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

Definition at line 276 of file MachineInstr.h.

References isMachineBasicBlock().

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

Definition at line 350 of file MachineInstr.h.

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

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

MachineOperand mutators...

Definition at line 333 of file MachineInstr.h.

References hasAllocatedReg().

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

Definition at line 306 of file MachineInstr.h.

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

void llvm::MachineOperand::setValueReg ( Value val  )  [inline]

Definition at line 340 of file MachineInstr.h.

References getVRegValueOrNull().


Friends And Related Function Documentation

friend class MachineInstr [friend]

Definition at line 377 of file MachineInstr.h.

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


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