14#define OP(Opcode) Opcode,
20#define OP(Opcode) #Opcode,
34#define OP(Opcode) using OP_##Opcode = Op<OpType::Opcode>;
35#define OP_LAST(Opcode) using OP_##Opcode = Op<OpType::Opcode>;
46template <
class OpLit,
class... Operands>
51 std::tuple<Operands...>
args;
60 if (
label.size() > 0) {
66 template <
size_t N = 0,
typename T>
68 if constexpr (N < std::tuple_size<T>::value) {
69 const auto& x = std::get<N>(t);
79#define INSTR(Opcode, ...) using INSTRUCTION_TYPE_ALIAS(Opcode, __VA_ARGS__) = Instruction<OP_##Opcode, __VA_ARGS__>;
85#define INSTR(Opcode, ...) INSTRUCTION_TYPE_ALIAS(Opcode, __VA_ARGS__),
86#define INSTR_LAST(Opcode, ...) INSTRUCTION_TYPE_ALIAS(Opcode, __VA_ARGS__)
this file contains a list of macros defining the opcodes used in the IR. These opcodes are used in de...
Definition InstructionVisitor.cc:7
OpType
Definition opcode.h:13
std::variant< #define INSTR(Opcode,...) #define INSTR_LAST(Opcode,...) # 1 "/github/workspace/quisp/runtime/def_instructions.h" 1 # 87 "/github/workspace/quisp/runtime/opcode.h" 2 > InstructionTypes
a variant that is capable of storing all instructions
Definition opcode.h:84
static const std::string OpTypeStr[]
Definition opcode.h:19
this file contains the definitions of all the user-defined types widely used alongside the runtime::R...
This class represents IR (intermediate representation) instruction. Program consists of Instructions.
Definition opcode.h:47
Instruction(std::tuple< Operands... > args, Label label)
Definition opcode.h:49
std::string label
Definition opcode.h:52
int opcode
Definition opcode.h:50
void toStringArgs(const T &t, std::stringstream &s) const
Definition opcode.h:67
Instruction(std::tuple< Operands... > args, std::string label="")
Definition opcode.h:48
std::tuple< Operands... > args
Definition opcode.h:51
std::string toString() const
returns string representation for debugging
Definition opcode.h:55
label to annotate the instruction index in a Program.
Definition types.h:95
@ Value
Definition opcode.h:108