Talvos  0.1
SPIR-V interpreter and dynamic analysis framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Private Types | Private Attributes | List of all members
talvos::Function Class Reference

This class represents a function in a SPIR-V Module. More...

#include <talvos/Function.h>

Public Member Functions

 Function (uint32_t Id, const Type *FunctionType)
 Create a new function with an ID and a type. More...
 
void addBlock (std::unique_ptr< Block > B)
 Add a block to this function. More...
 
void addParam (uint32_t Id)
 Add a parameter to this function. More...
 
const BlockgetBlock (uint32_t Id) const
 Returns the block with ID Id. More...
 
const BlockgetFirstBlock () const
 Returns the first block in this function. More...
 
uint32_t getFirstBlockId () const
 Returns the ID of the first block in this function. More...
 
uint32_t getId () const
 Returns the ID of this function. More...
 
uint32_t getParamId (uint32_t I) const
 Returns the ID of the parameter at index I. More...
 
size_t getNumParams () const
 Returns the number of parameters in this function. More...
 
void setFirstBlock (uint32_t Id)
 Sets the ID of the entry block in this function. More...
 
 Function (const Function &)=delete
 
Functionoperator= (const Function &)=delete
 

Private Types

typedef std::map< uint32_t,
std::unique_ptr< Block > > 
BlockMap
 A mapping from IDs to Blocks. More...
 

Private Attributes

uint32_t Id
 The ID of this function. More...
 
const TypeFunctionType
 The function type. More...
 
uint32_t FirstBlockId
 The ID of the first block. More...
 
BlockMap Blocks
 The blocks in the function. More...
 
std::vector< uint32_t > Parameters
 The function parameter IDs. More...
 

Detailed Description

This class represents a function in a SPIR-V Module.

Definition at line 23 of file Function.h.

Member Typedef Documentation

typedef std::map<uint32_t, std::unique_ptr<Block> > talvos::Function::BlockMap
private

A mapping from IDs to Blocks.

Definition at line 64 of file Function.h.

Constructor & Destructor Documentation

talvos::Function::Function ( uint32_t  Id,
const Type FunctionType 
)

Create a new function with an ID and a type.

Definition at line 18 of file Function.cpp.

talvos::Function::Function ( const Function )
delete

Member Function Documentation

void talvos::Function::addBlock ( std::unique_ptr< Block B)

Add a block to this function.

Definition at line 24 of file Function.cpp.

void talvos::Function::addParam ( uint32_t  Id)
inline

Add a parameter to this function.

Definition at line 39 of file Function.h.

const Block* talvos::Function::getBlock ( uint32_t  Id) const
inline

Returns the block with ID Id.

Definition at line 42 of file Function.h.

const Block* talvos::Function::getFirstBlock ( ) const
inline

Returns the first block in this function.

Definition at line 45 of file Function.h.

uint32_t talvos::Function::getFirstBlockId ( ) const
inline

Returns the ID of the first block in this function.

Definition at line 48 of file Function.h.

uint32_t talvos::Function::getId ( ) const
inline

Returns the ID of this function.

Definition at line 51 of file Function.h.

size_t talvos::Function::getNumParams ( ) const
inline

Returns the number of parameters in this function.

Definition at line 57 of file Function.h.

uint32_t talvos::Function::getParamId ( uint32_t  I) const
inline

Returns the ID of the parameter at index I.

Definition at line 54 of file Function.h.

Function& talvos::Function::operator= ( const Function )
delete
void talvos::Function::setFirstBlock ( uint32_t  Id)
inline

Sets the ID of the entry block in this function.

Definition at line 60 of file Function.h.

Member Data Documentation

BlockMap talvos::Function::Blocks
private

The blocks in the function.

Definition at line 69 of file Function.h.

uint32_t talvos::Function::FirstBlockId
private

The ID of the first block.

Definition at line 68 of file Function.h.

const Type* talvos::Function::FunctionType
private

The function type.

Definition at line 67 of file Function.h.

uint32_t talvos::Function::Id
private

The ID of this function.

Definition at line 66 of file Function.h.

std::vector<uint32_t> talvos::Function::Parameters
private

The function parameter IDs.

Definition at line 71 of file Function.h.