9 #ifndef TALVOS_VARIABLE_H
10 #define TALVOS_VARIABLE_H
This class represents a module-scope variable declaration.
uint32_t Id
Result ID of the variable.
bool isBufferVariable() const
Returns true if this variable has a buffer or uniform storage class.
Variable(uint32_t Id, const Type *Ty, uint32_t Initializer=0)
Create a module scope variable with an optional initializer.
const Type * getType() const
Returns the type of this variable.
std::map< uint32_t, uint32_t > Decorations
Map of decorations.
uint32_t getDecoration(uint32_t Decoration) const
Returns the decoration data associated with this variable.
uint32_t getInitializer() const
Returns the result ID of this variables initializer, or 0 if not present.
uint32_t Initializer
Result ID of the initializer.
uint32_t getId() const
Returns the result ID of this variable.
void addDecoration(uint32_t Decoration, uint32_t Data)
Add a decoration to this variable.
const Type * Ty
Type of the variable.
This class represents a SPIR-V type.
bool hasDecoration(uint32_t Decoration) const
Returns true if this variable has been decorated with Decoration.