chromium/third_party/skia/src/sksl/ir/SkSLVariable.h

/*
 * Copyright 2016 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef SKSL_VARIABLE
#define SKSL_VARIABLE

#include "include/core/SkTypes.h"
#include "src/sksl/SkSLPosition.h"
#include "src/sksl/ir/SkSLIRNode.h"
#include "src/sksl/ir/SkSLLayout.h"
#include "src/sksl/ir/SkSLModifierFlags.h"
#include "src/sksl/ir/SkSLStatement.h"
#include "src/sksl/ir/SkSLSymbol.h"
#include "src/sksl/ir/SkSLType.h"

#include <cstdint>
#include <memory>
#include <string>
#include <string_view>
#include <utility>

namespace SkSL {

class Context;
class Expression;
class GlobalVarDeclaration;
class InterfaceBlock;
class Mangler;
class SymbolTable;
class VarDeclaration;

enum class VariableStorage : int8_t {};

/**
 * Represents a variable, whether local, global, or a function parameter. This represents the
 * variable itself (the storage location), which is shared between all VariableReferences which
 * read or write that storage location.
 */
class Variable : public Symbol {};

/**
 * ExtendedVariable is functionally equivalent to a regular Variable, but it also contains extra
 * fields that most variables don't need:
 * - The variable's associated InterfaceBlock
 * - The variable's layout
 * - The variable's mangled name
 *
 * Some of these fields can be null/empty.
 */
class ExtendedVariable final : public Variable {};

} // namespace SkSL

#endif