9 #ifndef TALVOS_INSTRUCTION_H
10 #define TALVOS_INSTRUCTION_H
52 uint32_t
getOperand(
unsigned i)
const {
return Operands[i]; }
78 void print(std::ostream &O,
bool Align =
true)
const;
89 std::unique_ptr<Instruction>
Next;
uint16_t Opcode
The instruction opcode.
const Instruction & operator=(const Instruction &)=delete
std::unique_ptr< Instruction > Next
The next instruction in the block.
uint32_t getOperand(unsigned i) const
Returns the operand at index i;.
uint32_t * Operands
The operand values.
void insertAfter(Instruction *I)
Insert this instruction into a sequence, immediately following I.
uint16_t getOpcode() const
Returns the opcode.
const Type * ResultType
The type of the instruction result.
~Instruction()
Destroy this instruction.
Instruction(uint16_t Opcode, uint16_t NumOperands, const uint32_t *Operands, const Type *ResultType)
Create a new instruction.
void print(std::ostream &O, bool Align=true) const
Print a human-readable form of this instruction to O.
const Instruction * previous() const
Get the previous instruction in the containing block.
uint16_t getNumOperands() const
Returns the number of operands this instruction has.
const Type * getResultType() const
Returns the result type of this instruction, or nullptr if it does not produce a result.
const uint32_t * getOperands() const
Returns the operands.
uint16_t NumOperands
The number of operands in this instruction.
This class represents a SPIR-V type.
const Instruction * next() const
Get the next instruction in the containing block.
This class represents a SPIR-V instruction.
const Instruction * Previous
The previous instruction in the block.
static const char * opcodeToString(uint16_t Opcode)
Return the string representation of an instruction opcode.