2020-07-02 10:48:20 +00:00
|
|
|
/*
|
|
|
|
This file is part of solidity.
|
|
|
|
|
|
|
|
solidity is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
solidity is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with solidity. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
#include <libyul/optimiser/StackToMemoryMover.h>
|
2021-11-04 14:40:57 +00:00
|
|
|
#include <libyul/optimiser/NameCollector.h>
|
2020-07-02 10:48:20 +00:00
|
|
|
#include <libyul/optimiser/NameDispenser.h>
|
|
|
|
#include <libyul/backends/evm/EVMDialect.h>
|
|
|
|
|
2020-10-29 14:00:27 +00:00
|
|
|
#include <libyul/AST.h>
|
2020-07-02 10:48:20 +00:00
|
|
|
|
|
|
|
#include <libsolutil/CommonData.h>
|
2020-10-13 01:18:21 +00:00
|
|
|
|
|
|
|
#include <range/v3/algorithm/none_of.hpp>
|
|
|
|
#include <range/v3/view/filter.hpp>
|
|
|
|
#include <range/v3/view/transform.hpp>
|
|
|
|
#include <range/v3/view/zip.hpp>
|
|
|
|
#include <range/v3/range/conversion.hpp>
|
2020-07-02 10:48:20 +00:00
|
|
|
|
|
|
|
using namespace solidity;
|
|
|
|
using namespace solidity::yul;
|
|
|
|
|
|
|
|
namespace
|
|
|
|
{
|
2023-08-23 02:03:44 +00:00
|
|
|
std::vector<Statement> generateMemoryStore(
|
2020-09-17 16:00:08 +00:00
|
|
|
Dialect const& _dialect,
|
2023-08-23 02:03:44 +00:00
|
|
|
std::shared_ptr<DebugData const> const& _debugData,
|
2020-07-02 10:48:20 +00:00
|
|
|
YulString _mpos,
|
|
|
|
Expression _value
|
|
|
|
)
|
|
|
|
{
|
2020-09-17 16:00:08 +00:00
|
|
|
BuiltinFunction const* memoryStoreFunction = _dialect.memoryStoreFunction(_dialect.defaultType);
|
|
|
|
yulAssert(memoryStoreFunction, "");
|
2023-08-23 02:03:44 +00:00
|
|
|
std::vector<Statement> result;
|
2021-04-27 14:53:04 +00:00
|
|
|
result.emplace_back(ExpressionStatement{_debugData, FunctionCall{
|
|
|
|
_debugData,
|
|
|
|
Identifier{_debugData, memoryStoreFunction->name},
|
2020-07-02 10:48:20 +00:00
|
|
|
{
|
2021-04-27 14:53:04 +00:00
|
|
|
Literal{_debugData, LiteralKind::Number, _mpos, {}},
|
2022-08-23 17:28:45 +00:00
|
|
|
std::move(_value)
|
2020-07-02 10:48:20 +00:00
|
|
|
}
|
|
|
|
}});
|
2020-09-17 15:25:37 +00:00
|
|
|
return result;
|
2020-07-02 10:48:20 +00:00
|
|
|
}
|
2020-10-13 10:12:36 +00:00
|
|
|
|
2021-04-27 14:53:04 +00:00
|
|
|
FunctionCall generateMemoryLoad(Dialect const& _dialect, std::shared_ptr<DebugData const> const& _debugData, YulString _mpos)
|
2020-10-13 10:12:36 +00:00
|
|
|
{
|
|
|
|
BuiltinFunction const* memoryLoadFunction = _dialect.memoryLoadFunction(_dialect.defaultType);
|
|
|
|
yulAssert(memoryLoadFunction, "");
|
|
|
|
return FunctionCall{
|
2021-04-27 14:53:04 +00:00
|
|
|
_debugData,
|
|
|
|
Identifier{_debugData, memoryLoadFunction->name}, {
|
2020-10-13 10:12:36 +00:00
|
|
|
Literal{
|
2021-04-27 14:53:04 +00:00
|
|
|
_debugData,
|
2020-10-13 10:12:36 +00:00
|
|
|
LiteralKind::Number,
|
|
|
|
_mpos,
|
|
|
|
{}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
2020-07-02 10:48:20 +00:00
|
|
|
}
|
|
|
|
|
2020-09-17 15:25:37 +00:00
|
|
|
void StackToMemoryMover::run(
|
|
|
|
OptimiserStepContext& _context,
|
|
|
|
u256 _reservedMemory,
|
2023-08-23 02:03:44 +00:00
|
|
|
std::map<YulString, uint64_t> const& _memorySlots,
|
2020-09-17 15:36:18 +00:00
|
|
|
uint64_t _numRequiredSlots,
|
2020-09-17 15:25:37 +00:00
|
|
|
Block& _block
|
|
|
|
)
|
|
|
|
{
|
2020-10-06 09:10:43 +00:00
|
|
|
VariableMemoryOffsetTracker memoryOffsetTracker(_reservedMemory, _memorySlots, _numRequiredSlots);
|
2020-10-13 01:18:21 +00:00
|
|
|
StackToMemoryMover stackToMemoryMover(
|
|
|
|
_context,
|
|
|
|
memoryOffsetTracker,
|
|
|
|
util::applyMap(
|
2021-11-04 14:40:57 +00:00
|
|
|
allFunctionDefinitions(_block),
|
2020-10-13 01:18:21 +00:00
|
|
|
util::mapTuple([](YulString _name, FunctionDefinition const* _funDef) {
|
|
|
|
return make_pair(_name, _funDef->returnVariables);
|
|
|
|
}),
|
2023-08-23 02:03:44 +00:00
|
|
|
std::map<YulString, TypedNameList>{}
|
2020-10-13 01:18:21 +00:00
|
|
|
)
|
|
|
|
);
|
2020-09-17 15:25:37 +00:00
|
|
|
stackToMemoryMover(_block);
|
2022-08-23 17:28:45 +00:00
|
|
|
_block.statements += std::move(stackToMemoryMover.m_newFunctionDefinitions);
|
2020-09-17 15:25:37 +00:00
|
|
|
}
|
|
|
|
|
2020-07-02 10:48:20 +00:00
|
|
|
StackToMemoryMover::StackToMemoryMover(
|
|
|
|
OptimiserStepContext& _context,
|
2020-10-13 01:18:21 +00:00
|
|
|
VariableMemoryOffsetTracker const& _memoryOffsetTracker,
|
2023-08-23 02:03:44 +00:00
|
|
|
std::map<YulString, TypedNameList> _functionReturnVariables
|
2020-09-17 15:36:18 +00:00
|
|
|
):
|
2020-09-17 16:00:08 +00:00
|
|
|
m_context(_context),
|
2020-10-06 09:10:43 +00:00
|
|
|
m_memoryOffsetTracker(_memoryOffsetTracker),
|
2020-10-13 01:18:21 +00:00
|
|
|
m_nameDispenser(_context.dispenser),
|
2022-08-23 17:28:45 +00:00
|
|
|
m_functionReturnVariables(std::move(_functionReturnVariables))
|
2020-07-02 10:48:20 +00:00
|
|
|
{
|
|
|
|
auto const* evmDialect = dynamic_cast<EVMDialect const*>(&_context.dialect);
|
|
|
|
yulAssert(
|
|
|
|
evmDialect && evmDialect->providesObjectAccess(),
|
|
|
|
"StackToMemoryMover can only be run on objects using the EVMDialect with object access."
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
void StackToMemoryMover::operator()(FunctionDefinition& _functionDefinition)
|
|
|
|
{
|
2020-10-13 01:18:21 +00:00
|
|
|
// It is important to first visit the function body, so that it doesn't replace the memory inits for
|
|
|
|
// variable arguments we might generate below.
|
2020-10-06 08:38:26 +00:00
|
|
|
ASTModifier::operator()(_functionDefinition);
|
2020-10-13 01:18:21 +00:00
|
|
|
|
2023-08-23 02:03:44 +00:00
|
|
|
std::vector<Statement> memoryVariableInits;
|
2020-10-13 01:18:21 +00:00
|
|
|
|
|
|
|
// All function parameters with a memory slot are moved at the beginning of the function body.
|
|
|
|
for (TypedName const& param: _functionDefinition.parameters)
|
|
|
|
if (auto slot = m_memoryOffsetTracker(param.name))
|
|
|
|
memoryVariableInits += generateMemoryStore(
|
|
|
|
m_context.dialect,
|
|
|
|
param.debugData,
|
|
|
|
*slot,
|
|
|
|
Identifier{param.debugData, param.name}
|
|
|
|
);
|
|
|
|
|
|
|
|
// All memory return variables have to be initialized to zero in memory.
|
|
|
|
for (TypedName const& returnVariable: _functionDefinition.returnVariables)
|
|
|
|
if (auto slot = m_memoryOffsetTracker(returnVariable.name))
|
|
|
|
memoryVariableInits += generateMemoryStore(
|
|
|
|
m_context.dialect,
|
|
|
|
returnVariable.debugData,
|
|
|
|
*slot,
|
|
|
|
Literal{returnVariable.debugData, LiteralKind::Number, "0"_yulstring, {}}
|
|
|
|
);
|
|
|
|
|
|
|
|
// Special case of a function with a single return argument that needs to move to memory.
|
|
|
|
if (_functionDefinition.returnVariables.size() == 1 && m_memoryOffsetTracker(_functionDefinition.returnVariables.front().name))
|
|
|
|
{
|
|
|
|
TypedNameList stackParameters = _functionDefinition.parameters | ranges::views::filter(
|
2023-08-23 02:03:44 +00:00
|
|
|
std::not_fn(m_memoryOffsetTracker)
|
2020-10-13 01:18:21 +00:00
|
|
|
) | ranges::to<TypedNameList>;
|
|
|
|
// Generate new function without return variable and with only the non-moved parameters.
|
|
|
|
YulString newFunctionName = m_context.dispenser.newName(_functionDefinition.name);
|
|
|
|
m_newFunctionDefinitions.emplace_back(FunctionDefinition{
|
|
|
|
_functionDefinition.debugData,
|
|
|
|
newFunctionName,
|
|
|
|
stackParameters,
|
|
|
|
{},
|
2022-08-23 17:28:45 +00:00
|
|
|
std::move(_functionDefinition.body)
|
2020-10-13 01:18:21 +00:00
|
|
|
});
|
2021-06-14 14:30:56 +00:00
|
|
|
// Generate new names for the arguments to maintain disambiguation.
|
|
|
|
std::map<YulString, YulString> newArgumentNames;
|
|
|
|
for (TypedName const& _var: stackParameters)
|
|
|
|
newArgumentNames[_var.name] = m_context.dispenser.newName(_var.name);
|
|
|
|
for (auto& parameter: _functionDefinition.parameters)
|
|
|
|
parameter.name = util::valueOrDefault(newArgumentNames, parameter.name, parameter.name);
|
2020-10-13 01:18:21 +00:00
|
|
|
// Replace original function by a call to the new function and an assignment to the return variable from memory.
|
2022-08-23 17:28:45 +00:00
|
|
|
_functionDefinition.body = Block{_functionDefinition.debugData, std::move(memoryVariableInits)};
|
2020-10-13 01:18:21 +00:00
|
|
|
_functionDefinition.body.statements.emplace_back(ExpressionStatement{
|
|
|
|
_functionDefinition.debugData,
|
|
|
|
FunctionCall{
|
|
|
|
_functionDefinition.debugData,
|
|
|
|
Identifier{_functionDefinition.debugData, newFunctionName},
|
|
|
|
stackParameters | ranges::views::transform([&](TypedName const& _arg) {
|
2021-06-14 14:30:56 +00:00
|
|
|
return Expression{Identifier{_arg.debugData, newArgumentNames.at(_arg.name)}};
|
2023-08-23 02:03:44 +00:00
|
|
|
}) | ranges::to<std::vector<Expression>>
|
2020-10-13 01:18:21 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
_functionDefinition.body.statements.emplace_back(Assignment{
|
|
|
|
_functionDefinition.debugData,
|
|
|
|
{Identifier{_functionDefinition.debugData, _functionDefinition.returnVariables.front().name}},
|
2023-08-23 02:03:44 +00:00
|
|
|
std::make_unique<Expression>(generateMemoryLoad(
|
2020-10-13 01:18:21 +00:00
|
|
|
m_context.dialect,
|
|
|
|
_functionDefinition.debugData,
|
|
|
|
*m_memoryOffsetTracker(_functionDefinition.returnVariables.front().name)
|
|
|
|
))
|
|
|
|
});
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!memoryVariableInits.empty())
|
2022-08-23 17:28:45 +00:00
|
|
|
_functionDefinition.body.statements = std::move(memoryVariableInits) + std::move(_functionDefinition.body.statements);
|
2020-10-13 01:18:21 +00:00
|
|
|
|
|
|
|
_functionDefinition.returnVariables = _functionDefinition.returnVariables | ranges::views::filter(
|
2023-08-23 02:03:44 +00:00
|
|
|
std::not_fn(m_memoryOffsetTracker)
|
2020-10-13 01:18:21 +00:00
|
|
|
) | ranges::to<TypedNameList>;
|
2020-07-02 10:48:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void StackToMemoryMover::operator()(Block& _block)
|
|
|
|
{
|
2023-08-23 02:03:44 +00:00
|
|
|
using OptionalStatements = std::optional<std::vector<Statement>>;
|
2020-10-13 01:18:21 +00:00
|
|
|
|
|
|
|
auto rewriteAssignmentOrVariableDeclarationLeftHandSide = [this](
|
2020-10-13 10:12:36 +00:00
|
|
|
auto& _stmt,
|
2020-10-13 01:18:21 +00:00
|
|
|
auto& _lhsVars
|
2020-10-13 10:12:36 +00:00
|
|
|
) -> OptionalStatements {
|
2023-08-23 02:03:44 +00:00
|
|
|
using StatementType = std::decay_t<decltype(_stmt)>;
|
2020-10-13 10:12:36 +00:00
|
|
|
|
2020-10-13 01:18:21 +00:00
|
|
|
auto debugData = _stmt.debugData;
|
|
|
|
if (_lhsVars.size() == 1)
|
2020-10-06 09:10:43 +00:00
|
|
|
{
|
2023-08-23 02:03:44 +00:00
|
|
|
if (std::optional<YulString> offset = m_memoryOffsetTracker(_lhsVars.front().name))
|
2020-10-13 01:18:21 +00:00
|
|
|
return generateMemoryStore(
|
|
|
|
m_context.dialect,
|
|
|
|
debugData,
|
|
|
|
*offset,
|
2022-08-23 17:28:45 +00:00
|
|
|
_stmt.value ? *std::move(_stmt.value) : Literal{debugData, LiteralKind::Number, "0"_yulstring, {}}
|
2020-10-13 01:18:21 +00:00
|
|
|
);
|
|
|
|
else
|
|
|
|
return {};
|
2020-10-06 09:10:43 +00:00
|
|
|
}
|
2023-08-23 02:03:44 +00:00
|
|
|
std::vector<std::optional<YulString>> rhsMemorySlots;
|
2020-10-13 01:18:21 +00:00
|
|
|
if (_stmt.value)
|
|
|
|
{
|
2023-08-23 02:03:44 +00:00
|
|
|
FunctionCall const* functionCall = std::get_if<FunctionCall>(_stmt.value.get());
|
2020-10-13 01:18:21 +00:00
|
|
|
yulAssert(functionCall, "");
|
|
|
|
if (m_context.dialect.builtin(functionCall->functionName.name))
|
2023-08-23 02:03:44 +00:00
|
|
|
rhsMemorySlots = std::vector<std::optional<YulString>>(_lhsVars.size(), std::nullopt);
|
2020-10-13 01:18:21 +00:00
|
|
|
else
|
|
|
|
rhsMemorySlots =
|
|
|
|
m_functionReturnVariables.at(functionCall->functionName.name) |
|
|
|
|
ranges::views::transform(m_memoryOffsetTracker) |
|
2023-08-23 02:03:44 +00:00
|
|
|
ranges::to<std::vector<std::optional<YulString>>>;
|
2020-10-13 01:18:21 +00:00
|
|
|
}
|
|
|
|
else
|
2023-08-23 02:03:44 +00:00
|
|
|
rhsMemorySlots = std::vector<std::optional<YulString>>(_lhsVars.size(), std::nullopt);
|
2020-10-13 01:18:21 +00:00
|
|
|
|
|
|
|
// Nothing to do, if the right-hand-side remains entirely on the stack and
|
|
|
|
// none of the variables in the left-hand-side are moved.
|
|
|
|
if (
|
2023-08-23 02:03:44 +00:00
|
|
|
ranges::none_of(rhsMemorySlots, [](std::optional<YulString> const& _slot) { return _slot.has_value(); }) &&
|
2020-10-13 01:18:21 +00:00
|
|
|
!util::contains_if(_lhsVars, m_memoryOffsetTracker)
|
|
|
|
)
|
|
|
|
return {};
|
2020-07-02 10:48:20 +00:00
|
|
|
|
2023-08-23 02:03:44 +00:00
|
|
|
std::vector<Statement> memoryAssignments;
|
|
|
|
std::vector<Statement> variableAssignments;
|
2022-08-23 17:28:45 +00:00
|
|
|
VariableDeclaration tempDecl{debugData, {}, std::move(_stmt.value)};
|
2020-10-13 01:18:21 +00:00
|
|
|
|
|
|
|
yulAssert(rhsMemorySlots.size() == _lhsVars.size(), "");
|
|
|
|
for (auto&& [lhsVar, rhsSlot]: ranges::views::zip(_lhsVars, rhsMemorySlots))
|
2020-07-02 10:48:20 +00:00
|
|
|
{
|
2023-08-23 02:03:44 +00:00
|
|
|
std::unique_ptr<Expression> rhs;
|
2020-10-13 01:18:21 +00:00
|
|
|
if (rhsSlot)
|
2023-08-23 02:03:44 +00:00
|
|
|
rhs = std::make_unique<Expression>(generateMemoryLoad(m_context.dialect, debugData, *rhsSlot));
|
2020-10-13 01:18:21 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
YulString tempVarName = m_nameDispenser.newName(lhsVar.name);
|
|
|
|
tempDecl.variables.emplace_back(TypedName{lhsVar.debugData, tempVarName, {}});
|
2023-08-23 02:03:44 +00:00
|
|
|
rhs = std::make_unique<Expression>(Identifier{debugData, tempVarName});
|
2020-10-13 01:18:21 +00:00
|
|
|
}
|
2020-07-02 10:48:20 +00:00
|
|
|
|
2023-08-23 02:03:44 +00:00
|
|
|
if (std::optional<YulString> offset = m_memoryOffsetTracker(lhsVar.name))
|
2020-09-17 16:00:08 +00:00
|
|
|
memoryAssignments += generateMemoryStore(
|
|
|
|
m_context.dialect,
|
2021-04-27 14:53:04 +00:00
|
|
|
_stmt.debugData,
|
2020-10-06 09:10:43 +00:00
|
|
|
*offset,
|
2022-08-23 17:28:45 +00:00
|
|
|
std::move(*rhs)
|
2020-09-17 16:00:08 +00:00
|
|
|
);
|
2020-07-02 10:48:20 +00:00
|
|
|
else
|
2020-10-13 10:12:36 +00:00
|
|
|
variableAssignments.emplace_back(StatementType{
|
2020-10-13 01:18:21 +00:00
|
|
|
debugData,
|
2022-08-23 17:28:45 +00:00
|
|
|
{ std::move(lhsVar) },
|
|
|
|
std::move(rhs)
|
2020-07-02 10:48:20 +00:00
|
|
|
});
|
|
|
|
}
|
2020-10-13 01:18:21 +00:00
|
|
|
|
2023-08-23 02:03:44 +00:00
|
|
|
std::vector<Statement> result;
|
2020-10-13 01:18:21 +00:00
|
|
|
if (tempDecl.variables.empty())
|
2022-08-23 17:28:45 +00:00
|
|
|
result.emplace_back(ExpressionStatement{debugData, *std::move(tempDecl.value)});
|
2020-10-13 01:18:21 +00:00
|
|
|
else
|
2022-08-23 17:28:45 +00:00
|
|
|
result.emplace_back(std::move(tempDecl));
|
2020-10-13 01:18:21 +00:00
|
|
|
reverse(memoryAssignments.begin(), memoryAssignments.end());
|
2022-08-23 17:28:45 +00:00
|
|
|
result += std::move(memoryAssignments);
|
2020-10-13 01:18:21 +00:00
|
|
|
reverse(variableAssignments.begin(), variableAssignments.end());
|
2022-08-23 17:28:45 +00:00
|
|
|
result += std::move(variableAssignments);
|
|
|
|
return OptionalStatements{std::move(result)};
|
2020-07-02 10:48:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
util::iterateReplacing(
|
|
|
|
_block.statements,
|
2020-10-13 01:18:21 +00:00
|
|
|
[&](Statement& _statement) -> OptionalStatements
|
2020-07-02 10:48:20 +00:00
|
|
|
{
|
2020-10-13 01:18:21 +00:00
|
|
|
visit(_statement);
|
2023-08-23 02:03:44 +00:00
|
|
|
if (auto* assignment = std::get_if<Assignment>(&_statement))
|
2020-10-13 01:18:21 +00:00
|
|
|
return rewriteAssignmentOrVariableDeclarationLeftHandSide(*assignment, assignment->variableNames);
|
2023-08-23 02:03:44 +00:00
|
|
|
else if (auto* varDecl = std::get_if<VariableDeclaration>(&_statement))
|
2020-10-13 01:18:21 +00:00
|
|
|
return rewriteAssignmentOrVariableDeclarationLeftHandSide(*varDecl, varDecl->variables);
|
|
|
|
return {};
|
2020-10-13 10:12:36 +00:00
|
|
|
}
|
|
|
|
);
|
2020-07-02 10:48:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void StackToMemoryMover::visit(Expression& _expression)
|
|
|
|
{
|
2020-10-13 10:12:36 +00:00
|
|
|
ASTModifier::visit(_expression);
|
2023-08-23 02:03:44 +00:00
|
|
|
if (Identifier* identifier = std::get_if<Identifier>(&_expression))
|
|
|
|
if (std::optional<YulString> offset = m_memoryOffsetTracker(identifier->name))
|
2021-04-27 14:53:04 +00:00
|
|
|
_expression = generateMemoryLoad(m_context.dialect, identifier->debugData, *offset);
|
2020-07-02 10:48:20 +00:00
|
|
|
}
|
|
|
|
|
2023-08-23 02:03:44 +00:00
|
|
|
std::optional<YulString> StackToMemoryMover::VariableMemoryOffsetTracker::operator()(YulString _variable) const
|
2020-07-02 10:48:20 +00:00
|
|
|
{
|
2020-10-06 09:10:43 +00:00
|
|
|
if (m_memorySlots.count(_variable))
|
|
|
|
{
|
|
|
|
uint64_t slot = m_memorySlots.at(_variable);
|
|
|
|
yulAssert(slot < m_numRequiredSlots, "");
|
2021-09-16 14:33:28 +00:00
|
|
|
return YulString{toCompactHexWithPrefix(m_reservedMemory + 32 * (m_numRequiredSlots - slot - 1))};
|
2020-10-06 09:10:43 +00:00
|
|
|
}
|
|
|
|
else
|
2023-08-23 02:03:44 +00:00
|
|
|
return std::nullopt;
|
2020-10-13 01:18:21 +00:00
|
|
|
}
|
|
|
|
|
2023-08-23 02:03:44 +00:00
|
|
|
std::optional<YulString> StackToMemoryMover::VariableMemoryOffsetTracker::operator()(TypedName const& _variable) const
|
2020-10-13 01:18:21 +00:00
|
|
|
{
|
|
|
|
return (*this)(_variable.name);
|
|
|
|
}
|
|
|
|
|
2023-08-23 02:03:44 +00:00
|
|
|
std::optional<YulString> StackToMemoryMover::VariableMemoryOffsetTracker::operator()(Identifier const& _variable) const
|
2020-10-13 01:18:21 +00:00
|
|
|
{
|
|
|
|
return (*this)(_variable.name);
|
2020-07-02 10:48:20 +00:00
|
|
|
}
|