Refactoring yul source locations.

This commit is contained in:
Djordje Mijovic
2021-05-04 16:05:23 +02:00
parent fe4822a1d2
commit e404b6e7a6
62 changed files with 394 additions and 358 deletions
+5 -5
View File
@@ -268,7 +268,7 @@ vector<Statement> InlineModifier::performInline(Statement& _statement, FunctionC
auto newVariable = [&](TypedName const& _existingVariable, Expression* _value) {
YulString newName = m_nameDispenser.newName(_existingVariable.name);
variableReplacements[_existingVariable.name] = newName;
VariableDeclaration varDecl{_funCall.location, {{_funCall.location, newName, _existingVariable.type}}, {}};
VariableDeclaration varDecl{_funCall.debugData, {{_funCall.debugData, newName, _existingVariable.type}}, {}};
if (_value)
varDecl.value = make_unique<Expression>(std::move(*_value));
else
@@ -290,10 +290,10 @@ vector<Statement> InlineModifier::performInline(Statement& _statement, FunctionC
{
for (size_t i = 0; i < _assignment.variableNames.size(); ++i)
newStatements.emplace_back(Assignment{
_assignment.location,
_assignment.debugData,
{_assignment.variableNames[i]},
make_unique<Expression>(Identifier{
_assignment.location,
_assignment.debugData,
variableReplacements.at(function->returnVariables[i].name)
})
});
@@ -302,10 +302,10 @@ vector<Statement> InlineModifier::performInline(Statement& _statement, FunctionC
{
for (size_t i = 0; i < _varDecl.variables.size(); ++i)
newStatements.emplace_back(VariableDeclaration{
_varDecl.location,
_varDecl.debugData,
{std::move(_varDecl.variables[i])},
make_unique<Expression>(Identifier{
_varDecl.location,
_varDecl.debugData,
variableReplacements.at(function->returnVariables[i].name)
})
});