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 Attributes | List of all members
talvos::Variable Class Reference

This class represents a module-scope variable declaration. More...

#include <talvos/Variable.h>

Public Member Functions

 Variable (uint32_t Id, const Type *Ty, uint32_t Initializer=0)
 Create a module scope variable with an optional initializer. More...
 
void addDecoration (uint32_t Decoration, uint32_t Data)
 Add a decoration to this variable. More...
 
uint32_t getDecoration (uint32_t Decoration) const
 Returns the decoration data associated with this variable. More...
 
uint32_t getId () const
 Returns the result ID of this variable. More...
 
uint32_t getInitializer () const
 Returns the result ID of this variables initializer, or 0 if not present. More...
 
const TypegetType () const
 Returns the type of this variable. More...
 
bool hasDecoration (uint32_t Decoration) const
 Returns true if this variable has been decorated with Decoration. More...
 
bool isBufferVariable () const
 Returns true if this variable has a buffer or uniform storage class. More...
 

Private Attributes

uint32_t Id
 Result ID of the variable. More...
 
const TypeTy
 Type of the variable. More...
 
uint32_t Initializer
 Result ID of the initializer. More...
 
std::map< uint32_t, uint32_t > Decorations
 Map of decorations. More...
 

Detailed Description

This class represents a module-scope variable declaration.

Definition at line 21 of file Variable.h.

Constructor & Destructor Documentation

talvos::Variable::Variable ( uint32_t  Id,
const Type Ty,
uint32_t  Initializer = 0 
)

Create a module scope variable with an optional initializer.

Definition at line 18 of file Variable.cpp.

Member Function Documentation

void talvos::Variable::addDecoration ( uint32_t  Decoration,
uint32_t  Data 
)

Add a decoration to this variable.

Definition at line 22 of file Variable.cpp.

uint32_t talvos::Variable::getDecoration ( uint32_t  Decoration) const

Returns the decoration data associated with this variable.

Decoration must be a valid decoration that is present on this variable.

Definition at line 27 of file Variable.cpp.

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

Returns the result ID of this variable.

Definition at line 35 of file Variable.h.

uint32_t talvos::Variable::getInitializer ( ) const
inline

Returns the result ID of this variables initializer, or 0 if not present.

Definition at line 38 of file Variable.h.

const Type* talvos::Variable::getType ( ) const
inline

Returns the type of this variable.

Definition at line 41 of file Variable.h.

bool talvos::Variable::hasDecoration ( uint32_t  Decoration) const

Returns true if this variable has been decorated with Decoration.

Definition at line 33 of file Variable.cpp.

bool talvos::Variable::isBufferVariable ( ) const

Returns true if this variable has a buffer or uniform storage class.

Definition at line 38 of file Variable.cpp.

Member Data Documentation

std::map<uint32_t, uint32_t> talvos::Variable::Decorations
private

Map of decorations.

Definition at line 60 of file Variable.h.

uint32_t talvos::Variable::Id
private

Result ID of the variable.

Definition at line 51 of file Variable.h.

uint32_t talvos::Variable::Initializer
private

Result ID of the initializer.

Definition at line 57 of file Variable.h.

const Type* talvos::Variable::Ty
private

Type of the variable.

Definition at line 54 of file Variable.h.