diff --git a/libyul/backends/wasm/WasmAST.h b/libyul/backends/wasm/WasmAST.h index 02862aea2..635b7c4ea 100644 --- a/libyul/backends/wasm/WasmAST.h +++ b/libyul/backends/wasm/WasmAST.h @@ -25,6 +25,7 @@ #include #include #include +#include namespace solidity::yul::wasm { @@ -76,7 +77,7 @@ struct FunctionImport { std::string externalName; std::string internalName; std::vector paramTypes; - std::unique_ptr returnType; + std::optional returnType; }; struct FunctionDefinition diff --git a/libyul/backends/wasm/WasmCodeTransform.cpp b/libyul/backends/wasm/WasmCodeTransform.cpp index 9c553b380..ea88efbf7 100644 --- a/libyul/backends/wasm/WasmCodeTransform.cpp +++ b/libyul/backends/wasm/WasmCodeTransform.cpp @@ -29,6 +29,8 @@ #include +#include + using namespace std; using namespace solidity; using namespace solidity::yul; @@ -125,7 +127,7 @@ wasm::Expression WasmCodeTransform::operator()(FunctionCall const& _call) builtin->name.str().substr(4), builtin->name.str(), {}, - builtin->returns.empty() ? nullptr : make_unique(builtin->returns.front().str()) + builtin->returns.empty() ? nullopt : make_optional(builtin->returns.front().str()) }; for (auto const& param: builtin->parameters) imp.paramTypes.emplace_back(param.str());