LLVM API Documentation

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

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_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
int 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 71 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 97 of file MachineInstr.h.

enum llvm::MachineOperand::UseType
 

Enumerator:
Use 
Def  only read
UseAndDef  only written

Definition at line 91 of file MachineInstr.h.


Constructor & Destructor Documentation

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

Definition at line 187 of file MachineInstr.h.

References contents, and extra.

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

Definition at line 195 of file MachineInstr.h.


Member Function Documentation

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

Definition at line 278 of file MachineInstr.h.

References isConstantPoolIndex().

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

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

Definition at line 274 of file MachineInstr.h.

References isFrameIndex().

Referenced by llvm::X86RegisterInfo::eliminateFrameIndex(), llvm::PPC64RegisterInfo::eliminateFrameIndex(), llvm::PPC32RegisterInfo::eliminateFrameIndex(), llvm::operator<<(), and print().

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

Definition at line 282 of file MachineInstr.h.

References isGlobalAddress().

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

int llvm::MachineOperand::getImmedValue  )  const [inline]
 

Definition at line 262 of file MachineInstr.h.

References isImmediate().

Referenced by llvm::X86RegisterInfo::eliminateCallFramePseudoInstr(), llvm::PPC64RegisterInfo::eliminateCallFramePseudoInstr(), llvm::PPC32RegisterInfo::eliminateCallFramePseudoInstr(), llvm::X86RegisterInfo::eliminateFrameIndex(), llvm::PPC64RegisterInfo::eliminateFrameIndex(), llvm::PPC32RegisterInfo::eliminateFrameIndex(), llvm::PPC64InstrInfo::isMoveInstr(), llvm::PPC32InstrInfo::isMoveInstr(), isScale(), llvm::IsUselessCopy(), MakeMIInst(), MakeMRIInst(), MakeRMIInst(), llvm::operator<<(), and print().

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

Definition at line 266 of file MachineInstr.h.

References isMachineBasicBlock().

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

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

Definition at line 258 of file MachineInstr.h.

References MO_MachineRegister.

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

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

Definition at line 286 of file MachineInstr.h.

References isExternalSymbol(), and isGlobalAddress().

Referenced by print().

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 320 of file MachineInstr.h.

References hasAllocatedReg().

Referenced by llvm::LiveIntervals::addIntervalsForSpills(), llvm::LiveRangeInfo::constructLiveRanges(), llvm::PPC64RegisterInfo::eliminateFrameIndex(), llvm::PPC32RegisterInfo::eliminateFrameIndex(), llvm::CallArgsDescriptor::get(), getFPReg(), llvm::LiveVariables::instructionChanged(), llvm::X86InstrInfo::isMoveInstr(), llvm::PPC64InstrInfo::isMoveInstr(), llvm::PPC32InstrInfo::isMoveInstr(), llvm::IsUselessCopy(), MakeMRIInst(), MakeMRInst(), MakeRMIInst(), MakeRMInst(), llvm::operator<<(), print(), llvm::LiveVariables::runOnMachineFunction(), and llvm::LiveIntervals::runOnMachineFunction().

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

Definition at line 291 of file MachineInstr.h.

References isExternalSymbol().

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

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

getType - Returns the MachineOperandType for this operand.

Definition at line 207 of file MachineInstr.h.

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

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

getUseType - Returns the MachineOperandUseType of this operand.

Definition at line 211 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 253 of file MachineInstr.h.

References isPCRelativeDisp(), MO_CCRegister, and MO_VirtualRegister.

Referenced by llvm::CallArgsDescriptor::get(), llvm::MachineInstr::getImplicitRef(), llvm::isVarArgsCall(), 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 245 of file MachineInstr.h.

References isPCRelativeDisp(), MO_CCRegister, and MO_VirtualRegister.

Referenced by llvm::LiveVariables::runOnMachineFunction(), and setValueReg().

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

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

Definition at line 311 of file MachineInstr.h.

References MO_CCRegister, MO_MachineRegister, and MO_VirtualRegister.

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

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

Definition at line 238 of file MachineInstr.h.

References MO_ConstantPoolIndex.

Referenced by getConstantPoolIndex(), and isMem().

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

Definition at line 301 of file MachineInstr.h.

Referenced by llvm::LiveIntervals::addIntervalsForSpills(), llvm::applyTranferFuncForMInst(), llvm::LiveRangeInfo::constructLiveRanges(), llvm::LiveVariables::instructionChanged(), llvm::operator<<(), llvm::MachineInstr::print(), llvm::LiveVariables::runOnMachineFunction(), llvm::LiveIntervals::runOnMachineFunction(), llvm::MachineInstr::substituteValue(), and llvm::VirtRegMap::virtFolded().

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

Definition at line 240 of file MachineInstr.h.

References MO_ExternalSymbol.

Referenced by getOffset(), getSymbolName(), and setOffset().

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

Definition at line 237 of file MachineInstr.h.

References MO_FrameIndex.

Referenced by llvm::X86RegisterInfo::eliminateFrameIndex(), llvm::PPC64RegisterInfo::eliminateFrameIndex(), llvm::PPC32RegisterInfo::eliminateFrameIndex(), getFrameIndex(), and isMem().

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

Definition at line 239 of file MachineInstr.h.

References MO_GlobalAddress.

Referenced by getGlobal(), getOffset(), isMem(), MakeMIInst(), and setOffset().

bool llvm::MachineOperand::isHiBits32  )  const [inline]
 

Definition at line 303 of file MachineInstr.h.

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

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

Definition at line 305 of file MachineInstr.h.

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

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

Definition at line 234 of file MachineInstr.h.

References MO_SignExtendedImmed, and MO_UnextendedImmed.

Referenced by getImmedValue(), isMem(), llvm::PPC64InstrInfo::isMoveInstr(), llvm::PPC32InstrInfo::isMoveInstr(), isScale(), MakeMIInst(), and setImmedValue().

bool llvm::MachineOperand::isLoBits32  )  const [inline]
 

Definition at line 304 of file MachineInstr.h.

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

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

Definition at line 306 of file MachineInstr.h.

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

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

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

Definition at line 232 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 218 of file MachineInstr.h.

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

Definition at line 233 of file MachineInstr.h.

References MO_PCRelativeDisp.

Referenced by getVRegValue(), getVRegValueOrNull(), and llvm::SparcV9CodeEmitter::runOnMachineFunction().

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 226 of file MachineInstr.h.

References MO_MachineRegister, and MO_VirtualRegister.

Referenced by llvm::LiveIntervals::addIntervalsForSpills(), getFPReg(), llvm::LiveVariables::instructionChanged(), isMem(), llvm::X86InstrInfo::isMoveInstr(), llvm::PPC64InstrInfo::isMoveInstr(), llvm::PPC32InstrInfo::isMoveInstr(), llvm::LiveVariables::runOnMachineFunction(), and llvm::LiveIntervals::runOnMachineFunction().

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

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

Definition at line 299 of file MachineInstr.h.

Referenced by llvm::LiveIntervals::addIntervalsForSpills(), llvm::applyTranferFuncForMInst(), llvm::operator<<(), llvm::MachineInstr::print(), llvm::LiveVariables::runOnMachineFunction(), llvm::LiveIntervals::runOnMachineFunction(), llvm::MachineInstr::substituteValue(), 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 355 of file MachineInstr.h.

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

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

Definition at line 357 of file MachineInstr.h.

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

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

Definition at line 356 of file MachineInstr.h.

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

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

Definition at line 358 of file MachineInstr.h.

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

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

Definition at line 197 of file MachineInstr.h.

References contents, extra, flags, and opType.

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

Definition at line 302 of file MachineInstr.h.

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

Definition at line 339 of file MachineInstr.h.

References isImmediate().

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

Definition at line 270 of file MachineInstr.h.

References isMachineBasicBlock().

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

Definition at line 344 of file MachineInstr.h.

References isExternalSymbol(), and isGlobalAddress().

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

MachineOperand mutators...

Definition at line 327 of file MachineInstr.h.

References hasAllocatedReg().

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

Definition at line 300 of file MachineInstr.h.

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

Definition at line 334 of file MachineInstr.h.

References getVRegValueOrNull().


Friends And Related Function Documentation

friend class MachineInstr [friend]
 

Definition at line 371 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: