#pragma once
#include <optional>
#include <string>
#include <vector>
namespace solidity::frontend
{
class VariableDeclaration;
class Type;
class Expression;
class IRVariable
{
public:
IRVariable(std::string _baseName, Type const& _type);
explicit IRVariable(VariableDeclaration const& _decl);
IRVariable(Expression const& _expression);
std::string name() const;
std::string commaSeparatedList() const;
std::string commaSeparatedListPrefixed() const;
IRVariable tupleComponent(std::size_t _i) const;
Type const& type() const { return m_type; }
IRVariable part(std::string const& _slot) const;
bool hasPart(std::string const& _name) const;
std::vector<std::string> stackSlots() const;
private:
std::string suffixedName(std::string const& _suffix) const;
std::string m_baseName;
Type const& m_type;
};
}