Talvos
0.1
SPIR-V interpreter and dynamic analysis framework
|
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 Type * | getType () 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 Type * | Ty |
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... | |
This class represents a module-scope variable declaration.
Definition at line 21 of file Variable.h.
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.
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.
|
inline |
Returns the result ID of this variable.
Definition at line 35 of file Variable.h.
|
inline |
Returns the result ID of this variables initializer, or 0 if not present.
Definition at line 38 of file Variable.h.
|
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.
|
private |
Map of decorations.
Definition at line 60 of file Variable.h.
|
private |
Result ID of the variable.
Definition at line 51 of file Variable.h.
|
private |
Result ID of the initializer.
Definition at line 57 of file Variable.h.
|
private |
Type of the variable.
Definition at line 54 of file Variable.h.