Nearly CC
An educational compiler skeleton
Public Types | Public Member Functions | List of all members
Operand Class Reference

Public Types

enum  Kind {
  NONE , VREG , VREG_MEM , VREG_MEM_OFF ,
  MREG8 , MREG16 , MREG32 , MREG64 ,
  MREG64_MEM , MREG64_MEM_IDX , MREG64_MEM_OFF , MREG64_MEM_IDX_SCALE ,
  IMM_IVAL , LABEL , IMM_LABEL
}
 

Public Member Functions

 Operand (Kind kind=NONE)
 
 Operand (Kind kind, long ival1)
 
 Operand (Kind kind, int basereg, long ival2)
 
 Operand (Kind kind, int basereg, int indexreg, int scale)
 
 Operand (Kind kind, const std::string &label)
 
bool operator== (const Operand &rhs) const
 
Kind get_kind () const
 
bool is_imm_ival () const
 
bool is_label () const
 
bool is_imm_label () const
 
bool has_base_reg () const
 
bool has_index_reg () const
 
bool has_offset () const
 
bool has_scale () const
 
bool is_non_reg () const
 
bool is_memref () const
 
bool has_imm_ival () const
 
bool has_label () const
 
int get_base_reg () const
 
int get_index_reg () const
 
long get_imm_ival () const
 
long get_offset () const
 
long get_scale () const
 
void set_base_reg (int regnum)
 
void set_index_reg (int regnum)
 
void set_imm_ival (long ival)
 
void set_offset (long offset)
 
Operand to_memref () const
 
std::string get_label () const
 

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