mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Initial still broken version.
This commit is contained in:
@@ -39,7 +39,12 @@ string check(string const& _input)
|
||||
Object obj;
|
||||
std::tie(obj.code, obj.analysisInfo) = yul::test::parse(_input, false);
|
||||
BOOST_REQUIRE(obj.code);
|
||||
auto functions = CompilabilityChecker(EVMDialect::strictAssemblyForEVM(solidity::test::CommonOptions::get().evmVersion()), obj, true).stackDeficit;
|
||||
auto functions = CompilabilityChecker(
|
||||
EVMDialect::strictAssemblyForEVM(solidity::test::CommonOptions::get().evmVersion()),
|
||||
solidity::test::CommonOptions::get().eofVersion(),
|
||||
obj,
|
||||
true
|
||||
).stackDeficit;
|
||||
string out;
|
||||
for (auto const& function: functions)
|
||||
out += function.first.str() + ": " + to_string(function.second) + " ";
|
||||
|
||||
@@ -208,7 +208,7 @@ TestCase::TestResult ControlFlowGraphTest::run(ostream& _stream, string const& _
|
||||
|
||||
std::ostringstream output;
|
||||
|
||||
std::unique_ptr<CFG> cfg = ControlFlowGraphBuilder::build(*analysisInfo, *m_dialect, *object->code);
|
||||
std::unique_ptr<CFG> cfg = ControlFlowGraphBuilder::build(*analysisInfo, *m_dialect, nullopt /* TODO */, *object->code);
|
||||
|
||||
output << "digraph CFG {\nnodesep=0.7;\nnode[shape=box];\n\n";
|
||||
ControlFlowGraphPrinter printer{output};
|
||||
|
||||
@@ -51,7 +51,7 @@ protected:
|
||||
|
||||
NameDispenser dispenser(m_dialect, *m_object->code);
|
||||
std::set<YulString> reserved;
|
||||
OptimiserStepContext context{m_dialect, dispenser, reserved, 0};
|
||||
OptimiserStepContext context{m_dialect, nullopt /* TODO */, dispenser, reserved, 0};
|
||||
CommonSubexpressionEliminator::run(context, *m_object->code);
|
||||
|
||||
m_ssaValues(*m_object->code);
|
||||
|
||||
@@ -225,7 +225,7 @@ TestCase::TestResult StackLayoutGeneratorTest::run(ostream& _stream, string cons
|
||||
|
||||
std::ostringstream output;
|
||||
|
||||
std::unique_ptr<CFG> cfg = ControlFlowGraphBuilder::build(*analysisInfo, *m_dialect, *object->code);
|
||||
std::unique_ptr<CFG> cfg = ControlFlowGraphBuilder::build(*analysisInfo, *m_dialect, nullopt /* TODO */, *object->code);
|
||||
StackLayout stackLayout = StackLayoutGenerator::run(*cfg);
|
||||
|
||||
output << "digraph CFG {\nnodesep=0.7;\nnode[shape=box];\n\n";
|
||||
|
||||
@@ -323,7 +323,7 @@ YulOptimizerTestCommon::YulOptimizerTestCommon(
|
||||
FunctionHoister::run(*m_context, *m_ast);
|
||||
FunctionGrouper::run(*m_context, *m_ast);
|
||||
size_t maxIterations = 16;
|
||||
StackCompressor::run(*m_dialect, *m_object, true, maxIterations);
|
||||
StackCompressor::run(*m_dialect, nullopt /* TODO */, *m_object, true, maxIterations);
|
||||
BlockFlattener::run(*m_context, *m_ast);
|
||||
}},
|
||||
{"wordSizeTransform", [&]() {
|
||||
@@ -335,6 +335,7 @@ YulOptimizerTestCommon::YulOptimizerTestCommon(
|
||||
GasMeter meter(dynamic_cast<EVMDialect const&>(*m_dialect), false, 200);
|
||||
OptimiserSuite::run(
|
||||
*m_dialect,
|
||||
nullopt, // TODO
|
||||
&meter,
|
||||
*m_object,
|
||||
true,
|
||||
@@ -347,6 +348,7 @@ YulOptimizerTestCommon::YulOptimizerTestCommon(
|
||||
disambiguate();
|
||||
StackLimitEvader::run(*m_context, *m_object, CompilabilityChecker{
|
||||
*m_dialect,
|
||||
nullopt, // TODO
|
||||
*m_object,
|
||||
true
|
||||
}.unreachableVariables);
|
||||
@@ -461,6 +463,7 @@ void YulOptimizerTestCommon::updateContext()
|
||||
m_nameDispenser = make_unique<NameDispenser>(*m_dialect, *m_object->code, m_reservedIdentifiers);
|
||||
m_context = make_unique<OptimiserStepContext>(OptimiserStepContext{
|
||||
*m_dialect,
|
||||
nullopt, // TODO
|
||||
*m_nameDispenser,
|
||||
m_reservedIdentifiers,
|
||||
frontend::OptimiserSettings::standard().expectedExecutionsPerDeployment
|
||||
|
||||
@@ -441,6 +441,9 @@ u256 EVMInstructionInterpreter::eval(
|
||||
case Instruction::SWAP14:
|
||||
case Instruction::SWAP15:
|
||||
case Instruction::SWAP16:
|
||||
case Instruction::CALLF:
|
||||
case Instruction::RETF:
|
||||
case Instruction::JUMPF:
|
||||
{
|
||||
yulAssert(false, "");
|
||||
return 0;
|
||||
|
||||
@@ -222,7 +222,7 @@ public:
|
||||
{
|
||||
Object obj;
|
||||
obj.code = m_ast;
|
||||
StackCompressor::run(m_dialect, obj, true, 16);
|
||||
StackCompressor::run(m_dialect, nullopt /* TODO */, obj, true, 16);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@@ -251,6 +251,7 @@ private:
|
||||
NameDispenser m_nameDispenser{m_dialect, m_reservedIdentifiers};
|
||||
OptimiserStepContext m_context{
|
||||
m_dialect,
|
||||
nullopt, // TODO
|
||||
m_nameDispenser,
|
||||
m_reservedIdentifiers,
|
||||
solidity::frontend::OptimiserSettings::standard().expectedExecutionsPerDeployment
|
||||
|
||||
Reference in New Issue
Block a user