mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Remove asm flavour.
This commit is contained in:
@@ -97,12 +97,12 @@ void WordSizeTransform::operator()(Block& _block)
|
||||
for (int i = 0; i < 3; i++)
|
||||
ret.push_back(VariableDeclaration{
|
||||
varDecl.location,
|
||||
{TypedName{varDecl.location, newLhs[i], "u64"_yulstring}},
|
||||
make_unique<Expression>(Literal{locationOf(*varDecl.value), LiteralKind::Number, "0"_yulstring, "u64"_yulstring})
|
||||
{TypedName{varDecl.location, newLhs[i], m_defaultType}},
|
||||
make_unique<Expression>(Literal{locationOf(*varDecl.value), LiteralKind::Number, "0"_yulstring, m_defaultType})
|
||||
});
|
||||
ret.push_back(VariableDeclaration{
|
||||
varDecl.location,
|
||||
{TypedName{varDecl.location, newLhs[3], "u64"_yulstring}},
|
||||
{TypedName{varDecl.location, newLhs[3], m_defaultType}},
|
||||
std::move(varDecl.value)
|
||||
});
|
||||
return {std::move(ret)};
|
||||
@@ -130,7 +130,7 @@ void WordSizeTransform::operator()(Block& _block)
|
||||
ret.push_back(
|
||||
VariableDeclaration{
|
||||
varDecl.location,
|
||||
{TypedName{varDecl.location, newLhs[i], "u64"_yulstring}},
|
||||
{TypedName{varDecl.location, newLhs[i], m_defaultType}},
|
||||
std::move(newRhs[i])
|
||||
}
|
||||
);
|
||||
@@ -157,7 +157,7 @@ void WordSizeTransform::operator()(Block& _block)
|
||||
ret.push_back(Assignment{
|
||||
assignment.location,
|
||||
{Identifier{assignment.location, newLhs[i]}},
|
||||
make_unique<Expression>(Literal{locationOf(*assignment.value), LiteralKind::Number, "0"_yulstring, "u64"_yulstring})
|
||||
make_unique<Expression>(Literal{locationOf(*assignment.value), LiteralKind::Number, "0"_yulstring, m_defaultType})
|
||||
});
|
||||
ret.push_back(Assignment{
|
||||
assignment.location,
|
||||
@@ -208,7 +208,8 @@ void WordSizeTransform::run(Dialect const& _inputDialect, Block& _ast, NameDispe
|
||||
{
|
||||
// Free the name `or_bool`.
|
||||
NameDisplacer{_nameDispenser, {"or_bool"_yulstring}}(_ast);
|
||||
WordSizeTransform{_inputDialect, _nameDispenser}(_ast);
|
||||
YulString defaultType; // should be i64 at some point.
|
||||
WordSizeTransform{_inputDialect, _nameDispenser, defaultType}(_ast);
|
||||
}
|
||||
|
||||
void WordSizeTransform::rewriteVarDeclList(TypedNameList& _nameList)
|
||||
@@ -219,7 +220,7 @@ void WordSizeTransform::rewriteVarDeclList(TypedNameList& _nameList)
|
||||
{
|
||||
TypedNameList ret;
|
||||
for (auto newName: generateU64IdentifierNames(_n.name))
|
||||
ret.emplace_back(TypedName{_n.location, newName, "u64"_yulstring});
|
||||
ret.emplace_back(TypedName{_n.location, newName, m_defaultType});
|
||||
return ret;
|
||||
}
|
||||
);
|
||||
@@ -283,7 +284,7 @@ vector<Statement> WordSizeTransform::handleSwitchInternal(
|
||||
|
||||
for (auto& c: cases)
|
||||
{
|
||||
Literal label{_location, LiteralKind::Number, YulString(c.first.str()), "u64"_yulstring};
|
||||
Literal label{_location, LiteralKind::Number, YulString(c.first.str()), m_defaultType};
|
||||
ret.cases.emplace_back(Case{
|
||||
c.second.front().location,
|
||||
make_unique<Literal>(std::move(label)),
|
||||
@@ -304,7 +305,7 @@ vector<Statement> WordSizeTransform::handleSwitchInternal(
|
||||
Assignment{
|
||||
_location,
|
||||
{{_location, _runDefaultFlag}},
|
||||
make_unique<Expression>(Literal{_location, LiteralKind::Number, "1"_yulstring, "u64"_yulstring})
|
||||
make_unique<Expression>(Literal{_location, LiteralKind::Number, "1"_yulstring, m_defaultType})
|
||||
}
|
||||
)}
|
||||
});
|
||||
@@ -329,7 +330,7 @@ std::vector<Statement> WordSizeTransform::handleSwitch(Switch& _switch)
|
||||
_switch.cases.pop_back();
|
||||
ret.emplace_back(VariableDeclaration{
|
||||
_switch.location,
|
||||
{TypedName{_switch.location, runDefaultFlag, "u64"_yulstring}},
|
||||
{TypedName{_switch.location, runDefaultFlag, m_defaultType}},
|
||||
{}
|
||||
});
|
||||
}
|
||||
@@ -384,7 +385,7 @@ array<unique_ptr<Expression>, 4> WordSizeTransform::expandValue(Expression const
|
||||
lit.location,
|
||||
LiteralKind::Number,
|
||||
YulString(currentVal.str()),
|
||||
"u64"_yulstring
|
||||
m_defaultType
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user