48#include "data/untypedSharedPtr.h"
93 const uint64_t& opIdx)
const;
146 inline static const std::string GET_PRINT_PRIMITIVE_OPERAND_TYPE{
147 "(const )?((struct )?[\\w:\\*]*)[ ]?(\\[(\\d)+\\])*"};
161 const std::vector<std::reference_wrapper<const std::type_info>>&
181 const std::vector<Data::UntypedSharedPtr>& arguments)
const;
197 const std::vector<Data::UntypedSharedPtr>& args)
const = 0;
200#ifndef CODE_GENERATION
213 std::vector<std::reference_wrapper<const std::type_info>> operandTypes;
This abstract class is the base class for any instruction to be used in a Program.
Definition instruction.h:61
const std::vector< std::reference_wrapper< const std::type_info > > & getOperandTypes() const
Get the list of operand types needed by the Instruction.
Definition instruction.cpp:57
unsigned int getNbOperands() const
Get the number of operands required to execute the Instruction.
Definition instruction.cpp:62
virtual std::string getPrintablePrimitiveOperandType(const uint64_t &opIdx) const
Retrieve the primitive data type of the operand.
Definition instruction.cpp:114
virtual double execute(const std::vector< Data::UntypedSharedPtr > &args) const =0
Execute the Instruction for the given arguments.
Definition instruction.cpp:82
Instruction(std::string printTemplate)
Protected constructor to force the class abstract nature.
Definition instruction.cpp:99
virtual const std::string & getPrintTemplate() const
This function return the printTemplate of the line of code used to represent the instruction.
Definition instruction.cpp:109
virtual bool isPrintable() const
function saying if an Instruction can be printed in a C file during the code gen.
Definition instruction.cpp:104
virtual bool checkOperandTypes(const std::vector< Data::UntypedSharedPtr > &arguments) const
Check if a given vector contains elements whose types corresponds to the types of the Instruction ope...
Definition instruction.cpp:67
virtual ~Instruction()=default
Default virtual destructor for polyphormism.
std::string printTemplate
Definition instruction.h:112
Definition addPrimitiveType.h:49