mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Use optional for FunctionImport::returnType
This commit is contained in:
parent
20c8851f43
commit
899e6d7e2b
@ -25,6 +25,7 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <optional>
|
||||||
|
|
||||||
namespace solidity::yul::wasm
|
namespace solidity::yul::wasm
|
||||||
{
|
{
|
||||||
@ -76,7 +77,7 @@ struct FunctionImport {
|
|||||||
std::string externalName;
|
std::string externalName;
|
||||||
std::string internalName;
|
std::string internalName;
|
||||||
std::vector<std::string> paramTypes;
|
std::vector<std::string> paramTypes;
|
||||||
std::unique_ptr<std::string> returnType;
|
std::optional<std::string> returnType;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct FunctionDefinition
|
struct FunctionDefinition
|
||||||
|
@ -29,6 +29,8 @@
|
|||||||
|
|
||||||
#include <liblangutil/Exceptions.h>
|
#include <liblangutil/Exceptions.h>
|
||||||
|
|
||||||
|
#include <optional>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace solidity;
|
using namespace solidity;
|
||||||
using namespace solidity::yul;
|
using namespace solidity::yul;
|
||||||
@ -125,7 +127,7 @@ wasm::Expression WasmCodeTransform::operator()(FunctionCall const& _call)
|
|||||||
builtin->name.str().substr(4),
|
builtin->name.str().substr(4),
|
||||||
builtin->name.str(),
|
builtin->name.str(),
|
||||||
{},
|
{},
|
||||||
builtin->returns.empty() ? nullptr : make_unique<string>(builtin->returns.front().str())
|
builtin->returns.empty() ? nullopt : make_optional<string>(builtin->returns.front().str())
|
||||||
};
|
};
|
||||||
for (auto const& param: builtin->parameters)
|
for (auto const& param: builtin->parameters)
|
||||||
imp.paramTypes.emplace_back(param.str());
|
imp.paramTypes.emplace_back(param.str());
|
||||||
|
Loading…
Reference in New Issue
Block a user