mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge Parser::instructions() into EVMDialect
This commit is contained in:
@@ -115,18 +115,23 @@ pair<YulString, BuiltinFunctionForEVM> createFunction(
|
||||
map<YulString, BuiltinFunctionForEVM> createBuiltins(langutil::EVMVersion _evmVersion, bool _objectAccess)
|
||||
{
|
||||
map<YulString, BuiltinFunctionForEVM> builtins;
|
||||
// NOTE: Parser::instructions() will filter JUMPDEST and PUSHnn too
|
||||
for (auto const& instr: Parser::instructions())
|
||||
for (auto const& instr: evmasm::c_instructions)
|
||||
{
|
||||
string name = instr.first;
|
||||
transform(name.begin(), name.end(), name.begin(), [](unsigned char _c) { return tolower(_c); });
|
||||
auto const opcode = instr.second;
|
||||
|
||||
if (
|
||||
!evmasm::isDupInstruction(instr.second) &&
|
||||
!evmasm::isSwapInstruction(instr.second) &&
|
||||
!evmasm::isPushInstruction(instr.second) &&
|
||||
instr.second != evmasm::Instruction::JUMP &&
|
||||
instr.second != evmasm::Instruction::JUMPI &&
|
||||
instr.second != evmasm::Instruction::JUMPDEST &&
|
||||
_evmVersion.hasOpcode(instr.second)
|
||||
!evmasm::isDupInstruction(opcode) &&
|
||||
!evmasm::isSwapInstruction(opcode) &&
|
||||
!evmasm::isPushInstruction(opcode) &&
|
||||
opcode != evmasm::Instruction::JUMP &&
|
||||
opcode != evmasm::Instruction::JUMPI &&
|
||||
opcode != evmasm::Instruction::JUMPDEST &&
|
||||
_evmVersion.hasOpcode(opcode)
|
||||
)
|
||||
builtins.emplace(createEVMFunction(instr.first, instr.second));
|
||||
builtins.emplace(createEVMFunction(name, opcode));
|
||||
}
|
||||
|
||||
if (_objectAccess)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user