mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #5341 from ethereum/optimizeAssemblyCommandline
Apply the optimize commandline parameter to assembly mode.
This commit is contained in:
@@ -34,6 +34,8 @@
|
||||
|
||||
#include <libevmasm/Assembly.h>
|
||||
|
||||
#include <libyul/optimiser/Suite.h>
|
||||
|
||||
using namespace std;
|
||||
using namespace dev;
|
||||
using namespace langutil;
|
||||
@@ -79,6 +81,13 @@ bool AssemblyStack::parseAndAnalyze(std::string const& _sourceName, std::string
|
||||
return analyzeParsed();
|
||||
}
|
||||
|
||||
void AssemblyStack::optimize()
|
||||
{
|
||||
solAssert(m_language != Language::Assembly, "Optimization requested for loose assembly.");
|
||||
yul::OptimiserSuite::run(*m_parserResult->code, *m_parserResult->analysisInfo);
|
||||
solAssert(analyzeParsed(), "Invalid source code after optimization.");
|
||||
}
|
||||
|
||||
bool AssemblyStack::analyzeParsed()
|
||||
{
|
||||
solAssert(m_parserResult, "");
|
||||
|
||||
Reference in New Issue
Block a user