mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
[Sol2Yul] Implements codegen part for try/catch statements.
This commit is contained in:
committed by
chriseth
parent
3b83365b42
commit
d00d3c45b1
@@ -24,6 +24,8 @@
|
||||
#include <libsolidity/codegen/ir/IRLValue.h>
|
||||
#include <libsolidity/codegen/ir/IRVariable.h>
|
||||
|
||||
#include <functional>
|
||||
|
||||
namespace solidity::frontend
|
||||
{
|
||||
|
||||
@@ -70,7 +72,21 @@ public:
|
||||
void endVisit(Identifier const& _identifier) override;
|
||||
bool visit(Literal const& _literal) override;
|
||||
|
||||
bool visit(TryStatement const& _tryStatement) override;
|
||||
bool visit(TryCatchClause const& _tryCatchClause) override;
|
||||
|
||||
private:
|
||||
/// Handles all catch cases of a try statement, except the success-case.
|
||||
void handleCatch(TryStatement const& _tryStatement);
|
||||
void handleCatchStructuredAndFallback(
|
||||
TryCatchClause const& _structured,
|
||||
TryCatchClause const* _fallback
|
||||
);
|
||||
void handleCatchFallback(TryCatchClause const& _fallback);
|
||||
|
||||
/// Generates code to rethrow an exception.
|
||||
void rethrow();
|
||||
|
||||
/// Appends code to call an external function with the given arguments.
|
||||
/// All involved expressions have already been visited.
|
||||
void appendExternalFunctionCall(
|
||||
|
||||
Reference in New Issue
Block a user