mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Supply full object to stack compressor and Optimizer Suite.
This commit is contained in:
@@ -37,9 +37,10 @@ namespace
|
||||
{
|
||||
string check(string const& _input)
|
||||
{
|
||||
shared_ptr<Block> ast = yul::test::parse(_input, false).first;
|
||||
BOOST_REQUIRE(ast);
|
||||
map<YulString, int> functions = CompilabilityChecker::run(EVMDialect::strictAssemblyForEVM(dev::test::Options::get().evmVersion()), *ast, true);
|
||||
Object obj;
|
||||
std::tie(obj.code, obj.analysisInfo) = yul::test::parse(_input, false);
|
||||
BOOST_REQUIRE(obj.code);
|
||||
map<YulString, int> functions = CompilabilityChecker::run(EVMDialect::strictAssemblyForEVM(dev::test::Options::get().evmVersion()), obj, true);
|
||||
string out;
|
||||
for (auto const& function: functions)
|
||||
out += function.first.str() + ": " + to_string(function.second) + " ";
|
||||
|
||||
@@ -574,6 +574,7 @@ BOOST_AUTO_TEST_CASE(builtins_analysis)
|
||||
CHECK_ERROR_DIALECT("{ let a, b := builtin(1, 2) }", DeclarationError, "Variable count mismatch: 2 variables and 3 values.", dialect);
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
||||
}
|
||||
|
||||
@@ -305,7 +305,10 @@ TestCase::TestResult YulOptimizerTest::run(ostream& _stream, string const& _line
|
||||
disambiguate();
|
||||
(FunctionGrouper{})(*m_ast);
|
||||
size_t maxIterations = 16;
|
||||
StackCompressor::run(*m_dialect, *m_ast, true, maxIterations);
|
||||
Object obj;
|
||||
obj.code = m_ast;
|
||||
StackCompressor::run(*m_dialect, obj, true, maxIterations);
|
||||
m_ast = obj.code;
|
||||
(BlockFlattener{})(*m_ast);
|
||||
}
|
||||
else if (m_optimizerStep == "wordSizeTransform")
|
||||
@@ -318,7 +321,10 @@ TestCase::TestResult YulOptimizerTest::run(ostream& _stream, string const& _line
|
||||
else if (m_optimizerStep == "fullSuite")
|
||||
{
|
||||
GasMeter meter(dynamic_cast<EVMDialect const&>(*m_dialect), false, 200);
|
||||
OptimiserSuite::run(*m_dialect, &meter, *m_ast, *m_analysisInfo, true);
|
||||
yul::Object obj;
|
||||
obj.code = m_ast;
|
||||
obj.analysisInfo = m_analysisInfo;
|
||||
OptimiserSuite::run(*m_dialect, &meter, obj, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user