LLVM API Documentation

Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes
llvm::X86Operand Struct Reference

#include <X86Operand.h>

Inheritance diagram for llvm::X86Operand:
Inheritance graph
[legend]
Collaboration diagram for llvm::X86Operand:
Collaboration graph
[legend]

List of all members.

Classes

struct  ImmOp
struct  MemOp
struct  RegOp
struct  TokOp

Public Types

enum  KindTy { Token, Register, Immediate, Memory }

Public Member Functions

 X86Operand (KindTy K, SMLoc Start, SMLoc End)
StringRef getSymName () override
void * getOpDecl () override
SMLoc getStartLoc () const override
 getStartLoc - Get the location of the first token of this operand.
SMLoc getEndLoc () const override
 getEndLoc - Get the location of the last token of this operand.
SMRange getLocRange () const
SMLoc getOffsetOfLoc () const override
 getOffsetOfLoc - Get the location of the offset operator.
void print (raw_ostream &OS) const override
 print - Print a debug representation of the operand to the given stream.
StringRef getToken () const
void setTokenValue (StringRef Value)
unsigned getReg () const override
const MCExprgetImm () const
const MCExprgetMemDisp () const
unsigned getMemSegReg () const
unsigned getMemBaseReg () const
unsigned getMemIndexReg () const
unsigned getMemScale () const
bool isToken () const override
 isToken - Is this a token operand?
bool isImm () const override
 isImm - Is this an immediate operand?
bool isImmSExti16i8 () const
bool isImmSExti32i8 () const
bool isImmSExti64i8 () const
bool isImmSExti64i32 () const
bool isOffsetOf () const override
bool needAddressOf () const override
bool isMem () const override
 isMem - Is this a memory operand?
bool isMemUnsized () const
bool isMem8 () const
bool isMem16 () const
bool isMem32 () const
bool isMem64 () const
bool isMem80 () const
bool isMem128 () const
bool isMem256 () const
bool isMem512 () const
bool isMemVX32 () const
bool isMemVY32 () const
bool isMemVX64 () const
bool isMemVY64 () const
bool isMemVZ32 () const
bool isMemVZ64 () const
bool isAbsMem () const
bool isSrcIdx () const
bool isSrcIdx8 () const
bool isSrcIdx16 () const
bool isSrcIdx32 () const
bool isSrcIdx64 () const
bool isDstIdx () const
bool isDstIdx8 () const
bool isDstIdx16 () const
bool isDstIdx32 () const
bool isDstIdx64 () const
bool isMemOffs8 () const
bool isMemOffs16 () const
bool isMemOffs32 () const
bool isMemOffs64 () const
bool isReg () const override
 isReg - Is this a register operand?
bool isGR32orGR64 () const
void addExpr (MCInst &Inst, const MCExpr *Expr) const
void addRegOperands (MCInst &Inst, unsigned N) const
void addGR32orGR64Operands (MCInst &Inst, unsigned N) const
void addImmOperands (MCInst &Inst, unsigned N) const
void addMemOperands (MCInst &Inst, unsigned N) const
void addAbsMemOperands (MCInst &Inst, unsigned N) const
void addSrcIdxOperands (MCInst &Inst, unsigned N) const
void addDstIdxOperands (MCInst &Inst, unsigned N) const
void addMemOffsOperands (MCInst &Inst, unsigned N) const

Static Public Member Functions

static unsigned getGR32FromGR64 (unsigned RegNo)
static std::unique_ptr
< X86Operand
CreateToken (StringRef Str, SMLoc Loc)
static std::unique_ptr
< X86Operand
CreateReg (unsigned RegNo, SMLoc StartLoc, SMLoc EndLoc, bool AddressOf=false, SMLoc OffsetOfLoc=SMLoc(), StringRef SymName=StringRef(), void *OpDecl=nullptr)
static std::unique_ptr
< X86Operand
CreateImm (const MCExpr *Val, SMLoc StartLoc, SMLoc EndLoc)
static std::unique_ptr
< X86Operand
CreateMem (const MCExpr *Disp, SMLoc StartLoc, SMLoc EndLoc, unsigned Size=0, StringRef SymName=StringRef(), void *OpDecl=nullptr)
 Create an absolute memory operand.
static std::unique_ptr
< X86Operand
CreateMem (unsigned SegReg, const MCExpr *Disp, unsigned BaseReg, unsigned IndexReg, unsigned Scale, SMLoc StartLoc, SMLoc EndLoc, unsigned Size=0, StringRef SymName=StringRef(), void *OpDecl=nullptr)
 Create a generalized memory operand.

Public Attributes

enum llvm::X86Operand::KindTy Kind
SMLoc StartLoc
SMLoc EndLoc
SMLoc OffsetOfLoc
StringRef SymName
void * OpDecl
bool AddressOf
union {
   struct TokOp   Tok
   struct RegOp   Reg
   struct ImmOp   Imm
   struct MemOp   Mem
}; 

Detailed Description

X86Operand - Instances of this class represent a parsed X86 machine instruction.

Definition at line 22 of file X86Operand.h.


Member Enumeration Documentation

Enumerator:
Token 
Register 
Immediate 
Memory 

Definition at line 23 of file X86Operand.h.


Constructor & Destructor Documentation

llvm::X86Operand::X86Operand ( KindTy  K,
SMLoc  Start,
SMLoc  End 
) [inline]

Definition at line 65 of file X86Operand.h.


Member Function Documentation

void llvm::X86Operand::addAbsMemOperands ( MCInst Inst,
unsigned  N 
) const [inline]
void llvm::X86Operand::addDstIdxOperands ( MCInst Inst,
unsigned  N 
) const [inline]
void llvm::X86Operand::addExpr ( MCInst Inst,
const MCExpr Expr 
) const [inline]
void llvm::X86Operand::addGR32orGR64Operands ( MCInst Inst,
unsigned  N 
) const [inline]
void llvm::X86Operand::addImmOperands ( MCInst Inst,
unsigned  N 
) const [inline]

Definition at line 360 of file X86Operand.h.

References addExpr(), and getImm().

void llvm::X86Operand::addMemOffsOperands ( MCInst Inst,
unsigned  N 
) const [inline]
void llvm::X86Operand::addMemOperands ( MCInst Inst,
unsigned  N 
) const [inline]
void llvm::X86Operand::addRegOperands ( MCInst Inst,
unsigned  N 
) const [inline]

Definition at line 324 of file X86Operand.h.

References llvm::MCInst::addOperand(), llvm::MCOperand::CreateReg(), and getReg().

void llvm::X86Operand::addSrcIdxOperands ( MCInst Inst,
unsigned  N 
) const [inline]
static std::unique_ptr<X86Operand> llvm::X86Operand::CreateImm ( const MCExpr Val,
SMLoc  StartLoc,
SMLoc  EndLoc 
) [inline, static]

Definition at line 424 of file X86Operand.h.

References EndLoc, Immediate, and StartLoc.

static std::unique_ptr<X86Operand> llvm::X86Operand::CreateMem ( const MCExpr Disp,
SMLoc  StartLoc,
SMLoc  EndLoc,
unsigned  Size = 0,
StringRef  SymName = StringRef(),
void *  OpDecl = nullptr 
) [inline, static]

Create an absolute memory operand.

Definition at line 433 of file X86Operand.h.

References EndLoc, Memory, OpDecl, StartLoc, and SymName.

static std::unique_ptr<X86Operand> llvm::X86Operand::CreateMem ( unsigned  SegReg,
const MCExpr Disp,
unsigned  BaseReg,
unsigned  IndexReg,
unsigned  Scale,
SMLoc  StartLoc,
SMLoc  EndLoc,
unsigned  Size = 0,
StringRef  SymName = StringRef(),
void *  OpDecl = nullptr 
) [inline, static]

Create a generalized memory operand.

Definition at line 450 of file X86Operand.h.

References EndLoc, Memory, OpDecl, StartLoc, and SymName.

static std::unique_ptr<X86Operand> llvm::X86Operand::CreateReg ( unsigned  RegNo,
SMLoc  StartLoc,
SMLoc  EndLoc,
bool  AddressOf = false,
SMLoc  OffsetOfLoc = SMLoc(),
StringRef  SymName = StringRef(),
void *  OpDecl = nullptr 
) [inline, static]

Definition at line 412 of file X86Operand.h.

References AddressOf, EndLoc, OffsetOfLoc, OpDecl, Register, StartLoc, and SymName.

static std::unique_ptr<X86Operand> llvm::X86Operand::CreateToken ( StringRef  Str,
SMLoc  Loc 
) [inline, static]
SMLoc llvm::X86Operand::getEndLoc ( ) const [inline, override, virtual]

getEndLoc - Get the location of the last token of this operand.

Implements llvm::MCParsedAsmOperand.

Definition at line 74 of file X86Operand.h.

References EndLoc.

static unsigned llvm::X86Operand::getGR32FromGR64 ( unsigned  RegNo) [inline, static]
const MCExpr* llvm::X86Operand::getImm ( ) const [inline]

getLocRange - Get the range between the first and last token of this operand.

Definition at line 77 of file X86Operand.h.

References EndLoc, and StartLoc.

SMLoc llvm::X86Operand::getOffsetOfLoc ( ) const [inline, override, virtual]

getOffsetOfLoc - Get the location of the offset operator.

Reimplemented from llvm::MCParsedAsmOperand.

Definition at line 79 of file X86Operand.h.

References OffsetOfLoc.

void* llvm::X86Operand::getOpDecl ( ) [inline, override, virtual]

Reimplemented from llvm::MCParsedAsmOperand.

Definition at line 69 of file X86Operand.h.

References OpDecl.

unsigned llvm::X86Operand::getReg ( ) const [inline, override, virtual]

Implements llvm::MCParsedAsmOperand.

Definition at line 93 of file X86Operand.h.

References Kind, Reg, Register, and llvm::X86Operand::RegOp::RegNo.

Referenced by addGR32orGR64Operands(), addRegOperands(), and isGR32orGR64().

SMLoc llvm::X86Operand::getStartLoc ( ) const [inline, override, virtual]

getStartLoc - Get the location of the first token of this operand.

Implements llvm::MCParsedAsmOperand.

Definition at line 72 of file X86Operand.h.

References StartLoc.

StringRef llvm::X86Operand::getSymName ( ) [inline, override, virtual]

Reimplemented from llvm::MCParsedAsmOperand.

Definition at line 68 of file X86Operand.h.

References SymName.

bool llvm::X86Operand::isAbsMem ( ) const [inline]

Definition at line 247 of file X86Operand.h.

References getMemBaseReg(), getMemIndexReg(), getMemScale(), getMemSegReg(), and Kind.

bool llvm::X86Operand::isDstIdx ( ) const [inline]
bool llvm::X86Operand::isDstIdx16 ( ) const [inline]

Definition at line 281 of file X86Operand.h.

References isDstIdx(), and isMem16().

bool llvm::X86Operand::isDstIdx32 ( ) const [inline]

Definition at line 284 of file X86Operand.h.

References isDstIdx(), and isMem32().

bool llvm::X86Operand::isDstIdx64 ( ) const [inline]

Definition at line 287 of file X86Operand.h.

References isDstIdx(), and isMem64().

bool llvm::X86Operand::isDstIdx8 ( ) const [inline]

Definition at line 278 of file X86Operand.h.

References isDstIdx(), and isMem8().

Definition at line 310 of file X86Operand.h.

References getReg(), Kind, and Register.

bool llvm::X86Operand::isImm ( ) const [inline, override, virtual]

isImm - Is this an immediate operand?

Implements llvm::MCParsedAsmOperand.

Definition at line 126 of file X86Operand.h.

References Immediate, and Kind.

Referenced by isImmSExti16i8(), isImmSExti32i8(), isImmSExti64i32(), and isImmSExti64i8().

bool llvm::X86Operand::isMem ( ) const [inline, override, virtual]

isMem - Is this a memory operand?

Implements llvm::MCParsedAsmOperand.

Definition at line 193 of file X86Operand.h.

References Kind, and Memory.

bool llvm::X86Operand::isMem128 ( ) const [inline]

Definition at line 212 of file X86Operand.h.

References Kind, Mem, and llvm::X86Operand::MemOp::Size.

bool llvm::X86Operand::isMem16 ( ) const [inline]

Definition at line 200 of file X86Operand.h.

References Kind, Mem, and llvm::X86Operand::MemOp::Size.

Referenced by isDstIdx16(), and isSrcIdx16().

bool llvm::X86Operand::isMem256 ( ) const [inline]

Definition at line 215 of file X86Operand.h.

References Kind, Mem, and llvm::X86Operand::MemOp::Size.

bool llvm::X86Operand::isMem32 ( ) const [inline]

Definition at line 203 of file X86Operand.h.

References Kind, Mem, and llvm::X86Operand::MemOp::Size.

Referenced by isDstIdx32(), and isSrcIdx32().

bool llvm::X86Operand::isMem512 ( ) const [inline]

Definition at line 218 of file X86Operand.h.

References Kind, Mem, and llvm::X86Operand::MemOp::Size.

bool llvm::X86Operand::isMem64 ( ) const [inline]

Definition at line 206 of file X86Operand.h.

References Kind, Mem, and llvm::X86Operand::MemOp::Size.

Referenced by isDstIdx64(), and isSrcIdx64().

bool llvm::X86Operand::isMem8 ( ) const [inline]

Definition at line 197 of file X86Operand.h.

References Kind, Mem, and llvm::X86Operand::MemOp::Size.

Referenced by isDstIdx8(), and isSrcIdx8().

bool llvm::X86Operand::isMem80 ( ) const [inline]

Definition at line 209 of file X86Operand.h.

References Kind, Mem, and llvm::X86Operand::MemOp::Size.

bool llvm::X86Operand::isMemOffs16 ( ) const [inline]
bool llvm::X86Operand::isMemOffs32 ( ) const [inline]
bool llvm::X86Operand::isMemOffs64 ( ) const [inline]
bool llvm::X86Operand::isMemOffs8 ( ) const [inline]

Definition at line 194 of file X86Operand.h.

References Kind, Mem, and llvm::X86Operand::MemOp::Size.

bool llvm::X86Operand::isMemVX32 ( ) const [inline]

Definition at line 222 of file X86Operand.h.

References getMemIndexReg(), Kind, Mem, and llvm::X86Operand::MemOp::Size.

bool llvm::X86Operand::isMemVX64 ( ) const [inline]

Definition at line 230 of file X86Operand.h.

References getMemIndexReg(), Kind, Mem, and llvm::X86Operand::MemOp::Size.

bool llvm::X86Operand::isMemVY32 ( ) const [inline]

Definition at line 226 of file X86Operand.h.

References getMemIndexReg(), Kind, Mem, and llvm::X86Operand::MemOp::Size.

bool llvm::X86Operand::isMemVY64 ( ) const [inline]

Definition at line 234 of file X86Operand.h.

References getMemIndexReg(), Kind, Mem, and llvm::X86Operand::MemOp::Size.

bool llvm::X86Operand::isMemVZ32 ( ) const [inline]

Definition at line 238 of file X86Operand.h.

References getMemIndexReg(), Kind, Mem, and llvm::X86Operand::MemOp::Size.

bool llvm::X86Operand::isMemVZ64 ( ) const [inline]

Definition at line 242 of file X86Operand.h.

References getMemIndexReg(), Kind, Mem, and llvm::X86Operand::MemOp::Size.

bool llvm::X86Operand::isOffsetOf ( ) const [inline, override, virtual]

isOffsetOf - Do we need to emit code to get the offset of the variable, rather then the value of the variable? Only valid when parsing MS-style inline assembly.

Reimplemented from llvm::MCParsedAsmOperand.

Definition at line 185 of file X86Operand.h.

References llvm::SMLoc::getPointer(), and OffsetOfLoc.

bool llvm::X86Operand::isReg ( ) const [inline, override, virtual]

isReg - Is this a register operand?

Implements llvm::MCParsedAsmOperand.

Definition at line 308 of file X86Operand.h.

References Kind, and Register.

bool llvm::X86Operand::isSrcIdx ( ) const [inline]
bool llvm::X86Operand::isSrcIdx16 ( ) const [inline]

Definition at line 261 of file X86Operand.h.

References isMem16(), and isSrcIdx().

bool llvm::X86Operand::isSrcIdx32 ( ) const [inline]

Definition at line 264 of file X86Operand.h.

References isMem32(), and isSrcIdx().

bool llvm::X86Operand::isSrcIdx64 ( ) const [inline]

Definition at line 267 of file X86Operand.h.

References isMem64(), and isSrcIdx().

bool llvm::X86Operand::isSrcIdx8 ( ) const [inline]

Definition at line 258 of file X86Operand.h.

References isMem8(), and isSrcIdx().

bool llvm::X86Operand::isToken ( ) const [inline, override, virtual]

isToken - Is this a token operand?

Implements llvm::MCParsedAsmOperand.

Definition at line 124 of file X86Operand.h.

References Kind, and Token.

bool llvm::X86Operand::needAddressOf ( ) const [inline, override, virtual]

needAddressOf - Do we need to emit code to get the address of the variable/label? Only valid when parsing MS-style inline assembly.

Reimplemented from llvm::MCParsedAsmOperand.

Definition at line 189 of file X86Operand.h.

References AddressOf.

void llvm::X86Operand::print ( raw_ostream OS) const [inline, override, virtual]

print - Print a debug representation of the operand to the given stream.

Implements llvm::MCParsedAsmOperand.

Definition at line 81 of file X86Operand.h.

void llvm::X86Operand::setTokenValue ( StringRef  Value) [inline]

Member Data Documentation

union { ... }

Definition at line 34 of file X86Operand.h.

Referenced by CreateReg(), and needAddressOf().

Definition at line 30 of file X86Operand.h.

Referenced by CreateImm(), CreateMem(), CreateReg(), CreateToken(), getEndLoc(), and getLocRange().

Definition at line 61 of file X86Operand.h.

Referenced by getImm().

Definition at line 31 of file X86Operand.h.

Referenced by CreateReg(), getOffsetOfLoc(), and isOffsetOf().

Definition at line 33 of file X86Operand.h.

Referenced by CreateMem(), CreateReg(), and getOpDecl().

Definition at line 60 of file X86Operand.h.

Referenced by getReg().

Definition at line 30 of file X86Operand.h.

Referenced by CreateImm(), CreateMem(), CreateReg(), getLocRange(), and getStartLoc().

Definition at line 32 of file X86Operand.h.

Referenced by CreateMem(), CreateReg(), and getSymName().

Definition at line 59 of file X86Operand.h.

Referenced by getToken(), and setTokenValue().


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