8#ifndef SKSL_VARDECLARATIONS
9#define SKSL_VARDECLARATIONS
44 std::unique_ptr<Expression>
value,
51 , fIsClone(isClone) {}
55 if (fVar && !fIsClone) {
70 static std::unique_ptr<VarDeclaration>
Convert(
const Context& context,
75 std::string_view
name,
77 std::unique_ptr<Expression>
value);
82 static std::unique_ptr<VarDeclaration>
Convert(
const Context& context,
83 std::unique_ptr<Variable>
var,
84 std::unique_ptr<Expression>
value);
87 static std::unique_ptr<VarDeclaration>
Make(
const Context& context,
91 std::unique_ptr<Expression>
value);
108 std::unique_ptr<Expression>&
value() {
112 const std::unique_ptr<Expression>&
value()
const {
119 static bool ErrorCheckAndCoerce(
const Context& context,
122 std::unique_ptr<Expression>&
value);
125 const Type& fBaseType;
127 std::unique_ptr<Expression> fValue;
144 , fDeclaration(
std::move(decl)) {
170 std::unique_ptr<Statement> fDeclaration;
const VarDeclaration & varDeclaration() const
static constexpr Kind kIRNodeKind
const std::unique_ptr< Statement > & declaration() const
std::string description() const override
VarDeclaration & varDeclaration()
std::unique_ptr< Statement > & declaration()
GlobalVarDeclaration(std::unique_ptr< Statement > decl)
ProgramElement(Position pos, Kind kind)
Statement(Position pos, Kind kind)
const Type & baseType() const
static std::unique_ptr< VarDeclaration > Convert(const Context &context, Position overallPos, const Modifiers &modifiers, const Type &type, Position namePos, std::string_view name, VariableStorage storage, std::unique_ptr< Expression > value)
std::unique_ptr< Expression > & value()
static void ErrorCheck(const Context &context, Position pos, Position modifiersPosition, const Layout &layout, ModifierFlags modifierFlags, const Type *type, const Type *baseType, Variable::Storage storage)
const std::unique_ptr< Expression > & value() const
~VarDeclaration() override
std::string description() const override
static constexpr Kind kIRNodeKind
VarDeclaration(Variable *var, const Type *baseType, int arraySize, std::unique_ptr< Expression > value, bool isClone=false)
void detachDeadVariable()
static std::unique_ptr< VarDeclaration > Make(const Context &context, Variable *var, const Type *baseType, int arraySize, std::unique_ptr< Expression > value)
void setGlobalVarDeclaration(GlobalVarDeclaration *global)
void detachDeadVarDeclaration()
DEF_SWITCHES_START aot vmservice shared library name