mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Adjust uses of AsmCodeGen.
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
* Adaptor between the abstract assembly and eth assembly.
|
||||
*/
|
||||
|
||||
#include <libsolidity/codegen/AsmCodeGen.h>
|
||||
#include <libyul/backends/evm/AsmCodeGen.h>
|
||||
|
||||
#include <libyul/AsmData.h>
|
||||
#include <libyul/AsmAnalysisInfo.h>
|
||||
@@ -41,7 +41,6 @@ using namespace std;
|
||||
using namespace dev;
|
||||
using namespace langutil;
|
||||
using namespace yul;
|
||||
using namespace dev::solidity;
|
||||
|
||||
EthAssemblyAdapter::EthAssemblyAdapter(eth::Assembly& _assembly):
|
||||
m_assembly(_assembly)
|
||||
|
||||
@@ -20,16 +20,11 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <libyul/AsmAnalysis.h>
|
||||
#include <libyul/backends/evm/AbstractAssembly.h>
|
||||
#include <libyul/AsmAnalysis.h>
|
||||
#include <liblangutil/SourceLocation.h>
|
||||
#include <functional>
|
||||
|
||||
namespace yul
|
||||
{
|
||||
struct Block;
|
||||
}
|
||||
|
||||
namespace dev
|
||||
{
|
||||
namespace eth
|
||||
@@ -37,18 +32,20 @@ namespace eth
|
||||
class Assembly;
|
||||
class AssemblyItem;
|
||||
}
|
||||
}
|
||||
|
||||
namespace solidity
|
||||
namespace yul
|
||||
{
|
||||
struct Block;
|
||||
|
||||
class EthAssemblyAdapter: public yul::AbstractAssembly
|
||||
class EthAssemblyAdapter: public AbstractAssembly
|
||||
{
|
||||
public:
|
||||
explicit EthAssemblyAdapter(eth::Assembly& _assembly);
|
||||
explicit EthAssemblyAdapter(dev::eth::Assembly& _assembly);
|
||||
void setSourceLocation(langutil::SourceLocation const& _location) override;
|
||||
int stackHeight() const override;
|
||||
void appendInstruction(solidity::Instruction _instruction) override;
|
||||
void appendConstant(u256 const& _constant) override;
|
||||
void appendInstruction(dev::solidity::Instruction _instruction) override;
|
||||
void appendConstant(dev::u256 const& _constant) override;
|
||||
void appendLabel(LabelID _labelId) override;
|
||||
void appendLabelReference(LabelID _labelId) override;
|
||||
size_t newLabelId() override;
|
||||
@@ -67,9 +64,9 @@ public:
|
||||
SubID appendData(dev::bytes const& _data) override;
|
||||
|
||||
private:
|
||||
static LabelID assemblyTagToIdentifier(eth::AssemblyItem const& _tag);
|
||||
static LabelID assemblyTagToIdentifier(dev::eth::AssemblyItem const& _tag);
|
||||
|
||||
eth::Assembly& m_assembly;
|
||||
dev::eth::Assembly& m_assembly;
|
||||
std::map<SubID, dev::u256> m_dataHashBySubId;
|
||||
size_t m_nextDataCounter = std::numeric_limits<size_t>::max() / 2;
|
||||
};
|
||||
@@ -79,14 +76,13 @@ class CodeGenerator
|
||||
public:
|
||||
/// Performs code generation and appends generated to _assembly.
|
||||
static void assemble(
|
||||
yul::Block const& _parsedData,
|
||||
yul::AsmAnalysisInfo& _analysisInfo,
|
||||
Block const& _parsedData,
|
||||
AsmAnalysisInfo& _analysisInfo,
|
||||
dev::eth::Assembly& _assembly,
|
||||
yul::ExternalIdentifierAccess const& _identifierAccess = yul::ExternalIdentifierAccess(),
|
||||
ExternalIdentifierAccess const& _identifierAccess = ExternalIdentifierAccess(),
|
||||
bool _useNamedLabelsForFunctions = false,
|
||||
bool _optimize = false
|
||||
);
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user