3#include <gyoji-misc/pointers.hpp>
4#include <gyoji-mir/types.hpp>
5#include <gyoji-context.hpp>
850 void dump(FILE *out)
const;
963 size_t get_a()
const;
996 const Type *_cast_type
1015 const Type *cast_type;
1054 size_t get_a()
const;
1058 size_t get_b()
const;
1082 size_t _callee_tmpvar,
1154 size_t _array_tmpvar,
1155 size_t _index_tmpvar
1231 const Type * _var_type);
1240 const Type * get_var_type()
const;
1246 const Type * var_type;
1274 char get_literal_char()
const;
1278 const char literal_char;
1337 unsigned char _literal_u8
1349 unsigned short _literal_u16
1361 unsigned int _literal_u32
1373 unsigned long _literal_u64
1431 unsigned char get_literal_u8()
const;
1432 unsigned short get_literal_u16()
const;
1433 unsigned int get_literal_u32()
const;
1434 unsigned long get_literal_u64()
const;
1436 char get_literal_i8()
const;
1437 short get_literal_i16()
const;
1438 int get_literal_i32()
const;
1439 long get_literal_i64()
const;
1447 unsigned char literal_u8;
1448 unsigned short literal_u16;
1449 unsigned int literal_u32;
1450 unsigned long literal_u64;
1473 float _literal_float
1483 double _literal_float
1492 float get_literal_float()
const;
1493 double get_literal_double()
const;
1499 float literal_float_f32;
1500 double literal_float_f64;
1594 const Type * get_type()
const;
1747 const Type *_variable_type
1769 const Type *variable_type;
1800 void operation_static_init();
References a location in the source-file.
Definition source-reference.hpp:16
This subclass of OperationBinary represents indexing an array.
Definition operations.hpp:1141
virtual ~OperationArrayIndex()
Move along, nothing to see here.
Definition operation.cpp:329
This subclass of Operation represents a binary operation.
Definition operations.hpp:1028
size_t get_a() const
Access the first operand (a).
Definition operation.cpp:260
virtual ~OperationBinary()
Move along, nothing to see here.
Definition operation.cpp:257
size_t get_b() const
Access the second operand (b).
Definition operation.cpp:264
This subclass of OperationUnary represents a cast operation.
Definition operations.hpp:981
virtual ~OperationCast()
Move along, nothing to see here.
Definition operation.cpp:224
virtual std::string get_description() const
Produce a description of the operation.
Definition operation.cpp:232
const Type * get_cast_type() const
Get type being cast/converted to.
Definition operation.cpp:228
This subclass of Operation is used to access member variables of classes and other aggregate types by...
Definition operations.hpp:1177
virtual ~OperationDot()
Move along, nothing to see here.
Definition operation.cpp:345
virtual std::string get_description() const
Produce a description of the operation.
Definition operation.cpp:353
const std::string & get_member_name() const
Definition operation.cpp:349
Function call (invoke) operation.
Definition operations.hpp:1069
virtual ~OperationFunctionCall()
Move along, nothing to see here.
Definition operation.cpp:284
This operation represents a conditional jump.
Definition operations.hpp:1619
virtual std::string get_description() const
Produce a description of the operation.
Definition operation.cpp:819
virtual ~OperationJumpConditional()
Move along, nothing to see here.
Definition operation.cpp:815
Unconditional Jump.
Definition operations.hpp:1655
virtual ~OperationJump()
Move along, nothing to see here.
Definition operation.cpp:841
virtual std::string get_description() const
Produce a description of the operation.
Definition operation.cpp:845
Literal bool.
Definition operations.hpp:1512
bool get_literal_bool() const
Definition operation.cpp:770
virtual ~OperationLiteralBool()
Move along, nothing to see here.
Definition operation.cpp:767
virtual std::string get_description() const
Produce a description of the operation.
Definition operation.cpp:773
Literal character.
Definition operations.hpp:1256
virtual ~OperationLiteralChar()
Move along, nothing to see here.
Definition operation.cpp:413
virtual std::string get_description() const
Produce a description of the operation.
Definition operation.cpp:421
Literal float.
Definition operations.hpp:1463
virtual ~OperationLiteralFloat()
Move along, nothing to see here.
Definition operation.cpp:717
virtual std::string get_description() const
Produce a description of the operation.
Definition operation.cpp:732
Literal integer.
Definition operations.hpp:1325
virtual ~OperationLiteralInt()
Move along, nothing to see here.
Definition operation.cpp:610
virtual std::string get_description() const
Produce a description of the operation.
Definition operation.cpp:642
Literal null.
Definition operations.hpp:1549
virtual std::string get_description() const
Produce a description of the operation.
Definition operation.cpp:794
virtual ~OperationLiteralNull()
Move along, nothing to see here.
Definition operation.cpp:791
Literal string.
Definition operations.hpp:1287
virtual std::string get_description() const
Produce a description of the operation.
Definition operation.cpp:455
virtual ~OperationLiteralString()
Move along, nothing to see here.
Definition operation.cpp:447
Declare a local variable in scope.
Definition operations.hpp:1742
virtual std::string get_description() const
Produce a description of the operation.
Definition operation.cpp:921
const Type * get_variable_type() const
Definition operation.cpp:917
const std::string & get_variable() const
Definition operation.cpp:914
virtual ~OperationLocalDeclare()
Move along, nothing to see here.
Definition operation.cpp:911
Un-declare a variable (remove it from scope)
Definition operations.hpp:1780
virtual ~OperationLocalUndeclare()
Move along, nothing to see here.
Definition operation.cpp:943
virtual std::string get_description() const
Produce a description of the operation.
Definition operation.cpp:947
Load a local variable.
Definition operations.hpp:1220
virtual std::string get_description() const
Produce a description of the operation.
Definition operation.cpp:390
virtual ~OperationLocalVariable()
Move along, nothing to see here.
Definition operation.cpp:378
Return from a function without a value.
Definition operations.hpp:1714
virtual ~OperationReturnVoid()
Move along, nothing to see here.
Definition operation.cpp:888
virtual std::string get_description() const
Produce a description of the operation.
Definition operation.cpp:892
Return from a function with a value.
Definition operations.hpp:1691
virtual ~OperationReturn()
Move along, nothing to see here.
Definition operation.cpp:865
virtual std::string get_description() const
Produce a description of the operation.
Definition operation.cpp:869
The operation for obtaining the storage size of a type.
Definition operations.hpp:1579
virtual ~OperationSizeofType()
Move along, nothing to see here.
Definition operation.cpp:968
Symbol-table lookup.
Definition operations.hpp:1102
const std::string & get_symbol_name() const
Definition operation.cpp:303
virtual std::string get_description() const
Produce a description of the operation.
Definition operation.cpp:307
virtual ~OperationSymbol()
Move along, nothing to see here.
Definition operation.cpp:299
This subclass of Operation represents a unary operation.
Definition operations.hpp:939
size_t get_a() const
Returns the operand of the unary operation.
Definition operation.cpp:209
virtual ~OperationUnary()
Move along, nothing to see here.
Definition operation.cpp:206
Operations inside basic blocks, the virtual instruction-set of the MIR.
Definition operations.hpp:53
virtual ~Operation()
Move along, nothing to see here.
Definition operation.cpp:138
bool is_terminating() const
Returns true if this is a terminating operation for a block.
Definition operation.cpp:162
OperationType get_type() const
Opcode of this operation.
Definition operation.cpp:173
const Gyoji::context::SourceReference & get_source_ref() const
Get the reference to the source which originated this operation.
Definition operation.cpp:185
virtual std::string get_description() const
Produce a description of the operation.
Definition operation.cpp:148
size_t get_result() const
Get the result of this operation.
Definition operation.cpp:181
void add_operand(size_t operand)
Add an operand.
Definition operation.cpp:142
OperationType
Operations of the MIR virtual-machine.
Definition operations.hpp:72
@ OP_DEREFERENCE
De-references the given pointer.
Definition operations.hpp:445
@ OP_LITERAL_STRING
Loads a string constant.
Definition operations.hpp:358
@ OP_ASSIGN
Assign value.
Definition operations.hpp:743
@ OP_BITWISE_AND
Bitwise AND.
Definition operations.hpp:604
@ OP_LOCAL_UNDECLARE
Undeclare local variable.
Definition operations.hpp:302
@ OP_NEGATE
Negates a signed integer.
Definition operations.hpp:453
@ OP_ADD
Arithmetic add.
Definition operations.hpp:498
@ OP_WIDEN_FLOAT
Widen a floating-point integer to wider type.
Definition operations.hpp:200
@ OP_LITERAL_CHAR
Loads a literal character constant.
Definition operations.hpp:339
@ OP_MODULO
Modulo.
Definition operations.hpp:569
@ OP_WIDEN_SIGNED
Widen a signed integer to a larger type.
Definition operations.hpp:152
@ OP_ADDRESSOF
Returns the address of the given variable.
Definition operations.hpp:429
@ OP_COMPARE_GREATER
Compare numbers for greater-than.
Definition operations.hpp:685
@ OP_LITERAL_FLOAT
Loads an integer constant.
Definition operations.hpp:384
@ OP_WIDEN_UNSIGNED
Widen an unsigned integer to a larger type.
Definition operations.hpp:178
@ OP_ARRAY_INDEX
Access a value inside an array.
Definition operations.hpp:222
@ OP_BITWISE_XOR
Bitwise XOR.
Definition operations.hpp:631
@ OP_LOCAL_VARIABLE
Load value from variable.
Definition operations.hpp:325
@ OP_RETURN
Return from function.
Definition operations.hpp:780
@ OP_SUBTRACT
Arithmetic subtract.
Definition operations.hpp:514
@ OP_LOGICAL_NOT
This opcode performs a boolean NOT of the given operand.
Definition operations.hpp:471
@ OP_BITWISE_NOT
Performs a bitwise not on an unsigned integer.
Definition operations.hpp:463
@ OP_COMPARE_EQUAL
Compare numbers for equality.
Definition operations.hpp:729
@ OP_RETURN_VOID
Return from function without supplying a value.
Definition operations.hpp:789
@ OP_BITWISE_OR
Bitwise OR.
Definition operations.hpp:617
@ OP_SYMBOL
Load a symbol from the symbol-table.
Definition operations.hpp:123
@ OP_SIZEOF_TYPE
Returns the size of a specific type.
Definition operations.hpp:480
@ OP_SHIFT_RIGHT
Bitwise Shift Right.
Definition operations.hpp:661
@ OP_LITERAL_INT
Loads an integer constant.
Definition operations.hpp:371
@ OP_JUMP_CONDITIONAL
Conditional Jump.
Definition operations.hpp:758
@ OP_LITERAL_NULL
Loads a null pointer literal constant.
Definition operations.hpp:408
@ OP_COMPARE_LESS_EQUAL
Compare numbers for less-than or equal to.
Definition operations.hpp:696
@ OP_COMPARE_GREATER_EQUAL
Compare numbers for greater-than or equal to.
Definition operations.hpp:707
@ OP_LOCAL_DECLARE
Declare local variable.
Definition operations.hpp:277
@ OP_LOGICAL_AND
Logical AND.
Definition operations.hpp:580
@ OP_DOT
Access a value inside a class.
Definition operations.hpp:245
@ OP_SHIFT_LEFT
Bitwise Shift left.
Definition operations.hpp:646
@ OP_COMPARE_LESS
Compare numbers for less-than.
Definition operations.hpp:674
@ OP_FUNCTION_CALL
Function call.
Definition operations.hpp:97
@ OP_LITERAL_BOOL
Loads a boolean literal value.
Definition operations.hpp:395
@ OP_DIVIDE
Arithmetic multiply.
Definition operations.hpp:549
@ OP_LOGICAL_OR
Logical OR.
Definition operations.hpp:589
@ OP_MULTIPLY
Arithmetic multiply.
Definition operations.hpp:530
@ OP_COMPARE_NOT_EQUAL
Compare numbers for not equal-to.
Definition operations.hpp:718
@ OP_JUMP
Jump (Unconditional)
Definition operations.hpp:767
const std::vector< size_t > & get_operands() const
Get the operands.
Definition operation.cpp:177
void dump(FILE *out) const
Definition operation.cpp:189
This represents a type as declared in a translation unit.
Definition types.hpp:299
TypeType
Type of type.
Definition types.hpp:321
Middle intermediate representation (MIR) of a translation unit.
Definition gyoji-mir.hpp:37