mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Specify default type for word size transform externally.
This commit is contained in:
parent
8a7e1d651a
commit
9f0cef97c2
@ -1232,7 +1232,7 @@ Object EVMToEwasmTranslator::run(Object const& _object)
|
||||
MainFunction{}(ast);
|
||||
ForLoopConditionIntoBody::run(context, ast);
|
||||
ExpressionSplitter::run(context, ast);
|
||||
WordSizeTransform::run(m_dialect, ast, nameDispenser);
|
||||
WordSizeTransform::run(m_dialect, WasmDialect::instance().defaultType, ast, nameDispenser);
|
||||
|
||||
NameDisplacer{nameDispenser, m_polyfillFunctions}(ast);
|
||||
for (auto const& st: m_polyfill->statements)
|
||||
|
@ -204,12 +204,16 @@ void WordSizeTransform::operator()(Block& _block)
|
||||
);
|
||||
}
|
||||
|
||||
void WordSizeTransform::run(Dialect const& _inputDialect, Block& _ast, NameDispenser& _nameDispenser)
|
||||
void WordSizeTransform::run(
|
||||
Dialect const& _inputDialect,
|
||||
YulString _targetDefaultType,
|
||||
Block& _ast,
|
||||
NameDispenser& _nameDispenser
|
||||
)
|
||||
{
|
||||
// Free the name `or_bool`.
|
||||
NameDisplacer{_nameDispenser, {"or_bool"_yulstring}}(_ast);
|
||||
YulString defaultType; // should be i64 at some point.
|
||||
WordSizeTransform{_inputDialect, _nameDispenser, defaultType}(_ast);
|
||||
WordSizeTransform{_inputDialect, _nameDispenser, _targetDefaultType}(_ast);
|
||||
}
|
||||
|
||||
void WordSizeTransform::rewriteVarDeclList(TypedNameList& _nameList)
|
||||
|
@ -67,7 +67,12 @@ public:
|
||||
void operator()(ForLoop&) override;
|
||||
void operator()(Block& _block) override;
|
||||
|
||||
static void run(Dialect const& _inputDialect, Block& _ast, NameDispenser& _nameDispenser);
|
||||
static void run(
|
||||
Dialect const& _inputDialect,
|
||||
YulString _targetDefaultType,
|
||||
Block& _ast,
|
||||
NameDispenser& _nameDispenser
|
||||
);
|
||||
|
||||
private:
|
||||
explicit WordSizeTransform(
|
||||
|
@ -349,7 +349,7 @@ TestCase::TestResult YulOptimizerTest::run(ostream& _stream, string const& _line
|
||||
{
|
||||
disambiguate();
|
||||
ExpressionSplitter::run(*m_context, *m_ast);
|
||||
WordSizeTransform::run(*m_dialect, *m_ast, *m_nameDispenser);
|
||||
WordSizeTransform::run(*m_dialect, ""_yulstring, *m_ast, *m_nameDispenser);
|
||||
}
|
||||
else if (m_optimizerStep == "fullSuite")
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user