mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Remove ContainsMSize from side-effect-collector.
This commit is contained in:
@@ -61,8 +61,6 @@ void SideEffectsCollector::operator()(FunctionalInstruction const& _instr)
|
||||
m_sideEffectFree = false;
|
||||
if (!eth::SemanticInformation::sideEffectFreeIfNoMSize(_instr.instruction))
|
||||
m_sideEffectFreeIfNoMSize = false;
|
||||
if (_instr.instruction == eth::Instruction::MSIZE)
|
||||
m_containsMSize = true;
|
||||
if (eth::SemanticInformation::invalidatesStorage(_instr.instruction))
|
||||
m_invalidatesStorage = true;
|
||||
if (eth::SemanticInformation::invalidatesMemory(_instr.instruction))
|
||||
@@ -81,8 +79,6 @@ void SideEffectsCollector::operator()(FunctionCall const& _functionCall)
|
||||
m_sideEffectFree = false;
|
||||
if (!f->sideEffectFreeIfNoMSize)
|
||||
m_sideEffectFreeIfNoMSize = false;
|
||||
if (f->isMSize)
|
||||
m_containsMSize = true;
|
||||
if (f->invalidatesStorage)
|
||||
m_invalidatesStorage = true;
|
||||
if (f->invalidatesMemory)
|
||||
@@ -98,6 +94,30 @@ void SideEffectsCollector::operator()(FunctionCall const& _functionCall)
|
||||
}
|
||||
}
|
||||
|
||||
bool MSizeFinder::containsMSize(Dialect const& _dialect, Block const& _ast)
|
||||
{
|
||||
MSizeFinder finder(_dialect);
|
||||
finder(_ast);
|
||||
return finder.m_msizeFound;
|
||||
}
|
||||
|
||||
void MSizeFinder::operator()(FunctionalInstruction const& _instr)
|
||||
{
|
||||
ASTWalker::operator()(_instr);
|
||||
|
||||
if (_instr.instruction == eth::Instruction::MSIZE)
|
||||
m_msizeFound = true;
|
||||
}
|
||||
|
||||
void MSizeFinder::operator()(FunctionCall const& _functionCall)
|
||||
{
|
||||
ASTWalker::operator()(_functionCall);
|
||||
|
||||
if (BuiltinFunction const* f = m_dialect.builtin(_functionCall.functionName.name))
|
||||
if (f->isMSize)
|
||||
m_msizeFound = true;
|
||||
}
|
||||
|
||||
MovableChecker::MovableChecker(Dialect const& _dialect, Expression const& _expression):
|
||||
MovableChecker(_dialect)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user