mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Helper function for analysis.
This commit is contained in:
parent
dd5b43741c
commit
4f641e3732
@ -55,6 +55,26 @@ bool AsmAnalyzer::analyze(Block const& _block)
|
|||||||
return (*this)(_block);
|
return (*this)(_block);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AsmAnalysisInfo AsmAnalyzer::analyzeStrictAssertCorrect(
|
||||||
|
shared_ptr<Dialect> _dialect,
|
||||||
|
EVMVersion _evmVersion,
|
||||||
|
Block const& _ast
|
||||||
|
)
|
||||||
|
{
|
||||||
|
ErrorList errorList;
|
||||||
|
langutil::ErrorReporter errors(errorList);
|
||||||
|
yul::AsmAnalysisInfo analysisInfo;
|
||||||
|
bool success = yul::AsmAnalyzer(
|
||||||
|
analysisInfo,
|
||||||
|
errors,
|
||||||
|
_evmVersion,
|
||||||
|
Error::Type::SyntaxError,
|
||||||
|
_dialect
|
||||||
|
).analyze(_ast);
|
||||||
|
solAssert(success && errorList.empty(), "Invalid assembly/yul code.");
|
||||||
|
return analysisInfo;
|
||||||
|
}
|
||||||
|
|
||||||
bool AsmAnalyzer::operator()(Label const& _label)
|
bool AsmAnalyzer::operator()(Label const& _label)
|
||||||
{
|
{
|
||||||
solAssert(!_label.name.empty(), "");
|
solAssert(!_label.name.empty(), "");
|
||||||
|
@ -72,6 +72,12 @@ public:
|
|||||||
|
|
||||||
bool analyze(Block const& _block);
|
bool analyze(Block const& _block);
|
||||||
|
|
||||||
|
static AsmAnalysisInfo analyzeStrictAssertCorrect(
|
||||||
|
std::shared_ptr<Dialect> _dialect,
|
||||||
|
dev::solidity::EVMVersion _evmVersion,
|
||||||
|
Block const& _ast
|
||||||
|
);
|
||||||
|
|
||||||
bool operator()(Instruction const&);
|
bool operator()(Instruction const&);
|
||||||
bool operator()(Literal const& _literal);
|
bool operator()(Literal const& _literal);
|
||||||
bool operator()(Identifier const&);
|
bool operator()(Identifier const&);
|
||||||
|
Loading…
Reference in New Issue
Block a user