/** * 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 { public: using Storage = VariableStorage;
void detachDeadVarDeclaration() { // The VarDeclaration is being deleted, so our reference to it has become stale.
fDeclaringElement = nullptr;
}
// The interfaceBlock methods are no-op stubs here. They have proper implementations in // ExtendedVariable, declared below this class, which dedicates extra space to store the pointer // back to the InterfaceBlock. virtual InterfaceBlock* interfaceBlock() const { return nullptr; }
/** * 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 { public:
ExtendedVariable(Position pos, Position modifiersPosition, const Layout& layout,
ModifierFlags flags, std::string_view name, const Type* type, bool builtin,
Storage storage, std::string mangledName)
: INHERITED(pos, modifiersPosition, flags, name, type, builtin, storage)
, fLayout(layout)
, fMangledName(std::move(mangledName)) {}
void detachDeadInterfaceBlock() override { // The InterfaceBlock is being deleted, so our reference to it has become stale.
fInterfaceBlockElement = nullptr;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.