mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Make the dialect available everywhere.
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
|
||||
#include <libyul/Exceptions.h>
|
||||
#include <libyul/AsmData.h>
|
||||
#include <libyul/Dialect.h>
|
||||
|
||||
#include <libevmasm/SemanticInformation.h>
|
||||
|
||||
@@ -31,7 +32,13 @@ using namespace std;
|
||||
using namespace dev;
|
||||
using namespace yul;
|
||||
|
||||
MovableChecker::MovableChecker(Expression const& _expression)
|
||||
MovableChecker::MovableChecker(Dialect const& _dialect):
|
||||
m_dialect(_dialect)
|
||||
{
|
||||
}
|
||||
|
||||
MovableChecker::MovableChecker(Dialect const& _dialect, Expression const& _expression):
|
||||
MovableChecker(_dialect)
|
||||
{
|
||||
visit(_expression);
|
||||
}
|
||||
@@ -50,8 +57,14 @@ void MovableChecker::operator()(FunctionalInstruction const& _instr)
|
||||
ASTWalker::operator()(_instr);
|
||||
}
|
||||
|
||||
void MovableChecker::operator()(FunctionCall const&)
|
||||
void MovableChecker::operator()(FunctionCall const& _functionCall)
|
||||
{
|
||||
if (BuiltinFunction const* f = m_dialect.builtin(_functionCall.functionName.name))
|
||||
if (f->movable)
|
||||
{
|
||||
ASTWalker::operator()(_functionCall);
|
||||
return;
|
||||
}
|
||||
m_movable = false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user