9 #ifndef TALVOS_FUNCTION_H
10 #define TALVOS_FUNCTION_H
36 void addBlock(std::unique_ptr<Block> B);
64 typedef std::map<uint32_t, std::unique_ptr<Block>>
BlockMap;
Function(uint32_t Id, const Type *FunctionType)
Create a new function with an ID and a type.
Function & operator=(const Function &)=delete
void addParam(uint32_t Id)
Add a parameter to this function.
uint32_t Id
The ID of this function.
This class represents a function in a SPIR-V Module.
std::vector< uint32_t > Parameters
The function parameter IDs.
void setFirstBlock(uint32_t Id)
Sets the ID of the entry block in this function.
uint32_t getFirstBlockId() const
Returns the ID of the first block in this function.
BlockMap Blocks
The blocks in the function.
size_t getNumParams() const
Returns the number of parameters in this function.
std::map< uint32_t, std::unique_ptr< Block > > BlockMap
A mapping from IDs to Blocks.
void addBlock(std::unique_ptr< Block > B)
Add a block to this function.
uint32_t getParamId(uint32_t I) const
Returns the ID of the parameter at index I.
uint32_t getId() const
Returns the ID of this function.
const Block * getFirstBlock() const
Returns the first block in this function.
This class represents a SPIR-V type.
const Type * FunctionType
The function type.
const Block * getBlock(uint32_t Id) const
Returns the block with ID Id.
uint32_t FirstBlockId
The ID of the first block.
A block of instructions ending with a termination instruction.