mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Overload MSizeFinder::containsMSize() for Yul objects
This commit is contained in:
parent
8e35e8dd8e
commit
dff774d82f
@ -94,6 +94,19 @@ bool MSizeFinder::containsMSize(Dialect const& _dialect, Block const& _ast)
|
||||
return finder.m_msizeFound;
|
||||
}
|
||||
|
||||
bool MSizeFinder::containsMSize(Dialect const& _dialect, Object const& _object)
|
||||
{
|
||||
if (containsMSize(_dialect, *_object.code))
|
||||
return true;
|
||||
|
||||
for (shared_ptr<ObjectNode> const& node: _object.subObjects)
|
||||
if (auto const* object = dynamic_cast<Object const*>(node.get()))
|
||||
if (containsMSize(_dialect, *object))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void MSizeFinder::operator()(FunctionCall const& _functionCall)
|
||||
{
|
||||
ASTWalker::operator()(_functionCall);
|
||||
|
@ -21,10 +21,11 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <libyul/optimiser/ASTWalker.h>
|
||||
#include <libyul/SideEffects.h>
|
||||
#include <libyul/optimiser/CallGraphGenerator.h>
|
||||
#include <libyul/AST.h>
|
||||
#include <libyul/Object.h>
|
||||
#include <libyul/SideEffects.h>
|
||||
#include <libyul/optimiser/ASTWalker.h>
|
||||
#include <libyul/optimiser/CallGraphGenerator.h>
|
||||
|
||||
#include <set>
|
||||
|
||||
@ -143,6 +144,7 @@ class MSizeFinder: public ASTWalker
|
||||
{
|
||||
public:
|
||||
static bool containsMSize(Dialect const& _dialect, Block const& _ast);
|
||||
static bool containsMSize(Dialect const& _dialect, Object const& _object);
|
||||
|
||||
using ASTWalker::operator();
|
||||
void operator()(FunctionCall const& _funCall) override;
|
||||
|
Loading…
Reference in New Issue
Block a user