Gyoji Compiler
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
Gyoji::mir::OperationLiteralInt Class Reference

Literal integer. More...

#include <operations.hpp>

Inheritance diagram for Gyoji::mir::OperationLiteralInt:
Inheritance graph
[legend]
Collaboration diagram for Gyoji::mir::OperationLiteralInt:
Collaboration graph
[legend]

Public Member Functions

 OperationLiteralInt (const Gyoji::context::SourceReference &_src_ref, size_t _result, Type::TypeType _literal_type, unsigned char _literal_u8)
 
 OperationLiteralInt (const Gyoji::context::SourceReference &_src_ref, size_t _result, Type::TypeType _literal_type, unsigned short _literal_u16)
 
 OperationLiteralInt (const Gyoji::context::SourceReference &_src_ref, size_t _result, Type::TypeType _literal_type, unsigned int _literal_u32)
 
 OperationLiteralInt (const Gyoji::context::SourceReference &_src_ref, size_t _result, Type::TypeType _literal_type, unsigned long _literal_u64)
 
 OperationLiteralInt (const Gyoji::context::SourceReference &_src_ref, size_t _result, Type::TypeType _literal_type, char _literal_i8)
 
 OperationLiteralInt (const Gyoji::context::SourceReference &_src_ref, size_t _result, Type::TypeType _literal_type, short _literal_i16)
 
 OperationLiteralInt (const Gyoji::context::SourceReference &_src_ref, size_t _result, Type::TypeType _literal_type, int _literal_i32)
 
 OperationLiteralInt (const Gyoji::context::SourceReference &_src_ref, size_t _result, Type::TypeType _literal_type, long _literal_i64)
 
virtual ~OperationLiteralInt ()
 Move along, nothing to see here.
 
- Public Member Functions inherited from Gyoji::mir::Operation
 Operation (OperationType _type, const Gyoji::context::SourceReference &_src_ref, size_t _result)
 
 Operation (OperationType _type, const Gyoji::context::SourceReference &_src_ref, size_t _result, size_t _operand)
 
 Operation (OperationType _type, const Gyoji::context::SourceReference &_src_ref, size_t _result, size_t _operand_a, size_t _operand_b)
 
 Operation (OperationType _type, const Gyoji::context::SourceReference &_src_ref, size_t _result, size_t _operand_a, size_t _operand_b, size_t _operand_c)
 
virtual ~Operation ()
 Move along, nothing to see here.
 
void dump (FILE *out) const
 
OperationType get_type () const
 Opcode of this operation.
 
const std::vector< size_t > & get_operands () const
 Get the operands.
 
size_t get_result () const
 Get the result of this operation.
 
bool is_terminating () const
 Returns true if this is a terminating operation for a block.
 
const Gyoji::context::SourceReferenceget_source_ref () const
 Get the reference to the source which originated this operation.
 

Protected Member Functions

virtual std::string get_description () const
 Produce a description of the operation.
 
- Protected Member Functions inherited from Gyoji::mir::Operation
void add_operand (size_t operand)
 Add an operand.
 

Additional Inherited Members

- Public Types inherited from Gyoji::mir::Operation
enum  OperationType {
  OP_FUNCTION_CALL , OP_SYMBOL , OP_WIDEN_SIGNED , OP_WIDEN_UNSIGNED ,
  OP_WIDEN_FLOAT , OP_ARRAY_INDEX , OP_DOT , OP_LOCAL_DECLARE ,
  OP_LOCAL_UNDECLARE , OP_LOCAL_VARIABLE , OP_LITERAL_CHAR , OP_LITERAL_STRING ,
  OP_LITERAL_INT , OP_LITERAL_FLOAT , OP_LITERAL_BOOL , OP_LITERAL_NULL ,
  OP_ADDRESSOF , OP_DEREFERENCE , OP_NEGATE , OP_BITWISE_NOT ,
  OP_LOGICAL_NOT , OP_SIZEOF_TYPE , OP_ADD , OP_SUBTRACT ,
  OP_MULTIPLY , OP_DIVIDE , OP_MODULO , OP_LOGICAL_AND ,
  OP_LOGICAL_OR , OP_BITWISE_AND , OP_BITWISE_OR , OP_BITWISE_XOR ,
  OP_SHIFT_LEFT , OP_SHIFT_RIGHT , OP_COMPARE_LESS , OP_COMPARE_GREATER ,
  OP_COMPARE_LESS_EQUAL , OP_COMPARE_GREATER_EQUAL , OP_COMPARE_NOT_EQUAL , OP_COMPARE_EQUAL ,
  OP_ASSIGN , OP_JUMP_CONDITIONAL , OP_JUMP , OP_RETURN ,
  OP_RETURN_VOID
}
 Operations of the MIR virtual-machine. More...
 

Detailed Description

Literal integer.

This operation loads a constant integer one of (i8,i16,i32,i64,u8,u16,u32,u64) into the return-value. See OP_LITERAL_INT. The type of data returned depends exactly on the type of data given and no type conversions are done at this stage. If type conversions are needed, they should be performed ahead of time using the OP_WIDEN_SIGNED or other cast operations depending on the type of data needed.

Constructor & Destructor Documentation

◆ OperationLiteralInt() [1/8]

OperationLiteralInt::OperationLiteralInt ( const Gyoji::context::SourceReference _src_ref,
size_t  _result,
Type::TypeType  _literal_type,
unsigned char  _literal_u8 
)

Create an operation to load the given constant literal integer into the return-value. The type of data given here is an unsigned 8-bit value.

◆ OperationLiteralInt() [2/8]

OperationLiteralInt::OperationLiteralInt ( const Gyoji::context::SourceReference _src_ref,
size_t  _result,
Type::TypeType  _literal_type,
unsigned short  _literal_u16 
)

Create an operation to load the given constant literal integer into the return-value. The type of data given here is an unsigned 16-bit value.

◆ OperationLiteralInt() [3/8]

OperationLiteralInt::OperationLiteralInt ( const Gyoji::context::SourceReference _src_ref,
size_t  _result,
Type::TypeType  _literal_type,
unsigned int  _literal_u32 
)

Create an operation to load the given constant literal integer into the return-value. The type of data given here is an unsigned 32-bit value.

◆ OperationLiteralInt() [4/8]

OperationLiteralInt::OperationLiteralInt ( const Gyoji::context::SourceReference _src_ref,
size_t  _result,
Type::TypeType  _literal_type,
unsigned long  _literal_u64 
)

Create an operation to load the given constant literal integer into the return-value. The type of data given here is an unsigned 64-bit value.

◆ OperationLiteralInt() [5/8]

OperationLiteralInt::OperationLiteralInt ( const Gyoji::context::SourceReference _src_ref,
size_t  _result,
Type::TypeType  _literal_type,
char  _literal_i8 
)

Create an operation to load the given constant literal integer into the return-value. The type of data given here is a signed 8-bit value.

◆ OperationLiteralInt() [6/8]

OperationLiteralInt::OperationLiteralInt ( const Gyoji::context::SourceReference _src_ref,
size_t  _result,
Type::TypeType  _literal_type,
short  _literal_i16 
)

Create an operation to load the given constant literal integer into the return-value. The type of data given here is a signed 16-bit value.

◆ OperationLiteralInt() [7/8]

OperationLiteralInt::OperationLiteralInt ( const Gyoji::context::SourceReference _src_ref,
size_t  _result,
Type::TypeType  _literal_type,
int  _literal_i32 
)

Create an operation to load the given constant literal integer into the return-value. The type of data given here is a signed 32-bit value.

◆ OperationLiteralInt() [8/8]

OperationLiteralInt::OperationLiteralInt ( const Gyoji::context::SourceReference _src_ref,
size_t  _result,
Type::TypeType  _literal_type,
long  _literal_i64 
)

Create an operation to load the given constant literal integer into the return-value. The type of data given here is a signed 64-bit value.

◆ ~OperationLiteralInt()

OperationLiteralInt::~OperationLiteralInt ( )
virtual

Move along, nothing to see here.

Move along, nothing to see here.

Member Function Documentation

◆ get_description()

std::string OperationLiteralInt::get_description ( ) const
protectedvirtual

Produce a description of the operation.

This method returns a full description of the operation including the return-value, operands, and any other ancilary information about the operation. This is a string that is constructed dynamically when needed and is used almost exclusively by the "dump" method to provide debuginng information.

Reimplemented from Gyoji::mir::Operation.


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