19
19
20
20
#include < libyul/optimiser/ASTWalker.h>
21
21
#include < libyul/AST.h>
22
- #include < libyul/Dialect.h>
23
22
#include < libyul/Utilities.h>
24
23
25
24
using namespace solidity ;
@@ -32,35 +31,34 @@ class MaybeConstFunctionCallFinder: Base
32
31
{
33
32
public:
34
33
using MaybeConstBlock = std::conditional_t <std::is_const_v<ResultType>, Block const , Block>;
35
- static std::vector<ResultType*> run (MaybeConstBlock& _block, std::string_view const _functionName, Dialect const & _dialect )
34
+ static std::vector<ResultType*> run (MaybeConstBlock& _block, FunctionHandle const & _functionHandle )
36
35
{
37
- MaybeConstFunctionCallFinder functionCallFinder (_functionName, _dialect );
36
+ MaybeConstFunctionCallFinder functionCallFinder (_functionHandle );
38
37
functionCallFinder (_block);
39
38
return functionCallFinder.m_calls ;
40
39
}
41
40
private:
42
- explicit MaybeConstFunctionCallFinder (std::string_view const _functionName, Dialect const & _dialect ):
43
- m_dialect(_dialect), m_functionName(_functionName ), m_calls() {}
41
+ explicit MaybeConstFunctionCallFinder (FunctionHandle const & _functionHandle ):
42
+ m_functionHandle(_functionHandle ), m_calls() {}
44
43
45
44
using Base::operator ();
46
45
void operator ()(ResultType& _functionCall) override
47
46
{
48
47
Base::operator ()(_functionCall);
49
- if (resolveFunctionName (_functionCall.functionName , m_dialect ) == m_functionName )
48
+ if (functionNameToHandle (_functionCall.functionName ) == m_functionHandle )
50
49
m_calls.emplace_back (&_functionCall);
51
50
}
52
- Dialect const & m_dialect;
53
- std::string_view m_functionName;
51
+ FunctionHandle const & m_functionHandle;
54
52
std::vector<ResultType*> m_calls;
55
53
};
56
54
}
57
55
58
- std::vector<FunctionCall*> solidity:: yul::findFunctionCalls (Block& _block, std::string_view const _functionName, Dialect const & _dialect )
56
+ std::vector<FunctionCall*> yul::findFunctionCalls (Block& _block, FunctionHandle const & _functionHandle )
59
57
{
60
- return MaybeConstFunctionCallFinder<ASTModifier, FunctionCall>::run (_block, _functionName, _dialect );
58
+ return MaybeConstFunctionCallFinder<ASTModifier, FunctionCall>::run (_block, _functionHandle );
61
59
}
62
60
63
- std::vector<FunctionCall const *> solidity:: yul::findFunctionCalls (Block const & _block, std::string_view const _functionName, Dialect const & _dialect )
61
+ std::vector<FunctionCall const *> yul::findFunctionCalls (Block const & _block, FunctionHandle const & _functionHandle )
64
62
{
65
- return MaybeConstFunctionCallFinder<ASTWalker, FunctionCall const >::run (_block, _functionName, _dialect );
63
+ return MaybeConstFunctionCallFinder<ASTWalker, FunctionCall const >::run (_block, _functionHandle );
66
64
}
0 commit comments