Skip to content

Commit

Permalink
[Tools] Add the multi-memory proposal option of the tools.
Browse files Browse the repository at this point in the history
Signed-off-by: YiYing He <[email protected]>
  • Loading branch information
q82419 authored and hydai committed Jan 13, 2022
1 parent d3cb49e commit fb54491
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
12 changes: 9 additions & 3 deletions tools/wasmedge/wasmedgec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ int main(int Argc, const char *Argv[]) {
PO::Option<PO::Toggle> PropRefTypes(
PO::Description("Disable Reference types proposal"sv));
PO::Option<PO::Toggle> PropSIMD(PO::Description("Disable SIMD proposal"sv));
PO::Option<PO::Toggle> PropMultiMem(
PO::Description("Enable Multiple memories proposal"sv));
PO::Option<PO::Toggle> PropAll(PO::Description("Enable all features"sv));

auto Parser = PO::ArgumentParser();
Expand All @@ -73,6 +75,7 @@ int main(int Argc, const char *Argv[]) {
.add_option("disable-bulk-memory"sv, PropBulkMemOps)
.add_option("disable-reference-types"sv, PropRefTypes)
.add_option("disable-simd"sv, PropSIMD)
.add_option("enable-multi-memory"sv, PropMultiMem)
.add_option("enable-all"sv, PropAll)
.parse(Argc, Argv)) {
return EXIT_FAILURE;
Expand Down Expand Up @@ -104,9 +107,12 @@ int main(int Argc, const char *Argv[]) {
if (PropSIMD.value()) {
Conf.removeProposal(WasmEdge::Proposal::SIMD);
}
// Left for the future proposals.
// if (PropAll.value()) {
// }
if (PropMultiMem.value()) {
Conf.addProposal(WasmEdge::Proposal::MultiMemories);
}
if (PropAll.value()) {
Conf.addProposal(WasmEdge::Proposal::MultiMemories);
}

std::filesystem::path InputPath = std::filesystem::absolute(WasmName.value());
std::filesystem::path OutputPath = std::filesystem::absolute(SoName.value());
Expand Down
12 changes: 9 additions & 3 deletions tools/wasmedge/wasmedger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ int main(int Argc, const char *Argv[]) {
PO::Option<PO::Toggle> PropRefTypes(
PO::Description("Disable Reference types proposal"sv));
PO::Option<PO::Toggle> PropSIMD(PO::Description("Disable SIMD proposal"sv));
PO::Option<PO::Toggle> PropMultiMem(
PO::Description("Enable Multiple memories proposal"sv));
PO::Option<PO::Toggle> PropAll(PO::Description("Enable all features"sv));

PO::Option<PO::Toggle> ConfEnableInstructionCounting(PO::Description(
Expand Down Expand Up @@ -105,6 +107,7 @@ int main(int Argc, const char *Argv[]) {
.add_option("disable-bulk-memory"sv, PropBulkMemOps)
.add_option("disable-reference-types"sv, PropRefTypes)
.add_option("disable-simd"sv, PropSIMD)
.add_option("enable-multi-memory"sv, PropMultiMem)
.add_option("enable-all"sv, PropAll)
.add_option("time-limit"sv, TimeLim)
.add_option("gas-limit"sv, GasLim)
Expand Down Expand Up @@ -141,9 +144,12 @@ int main(int Argc, const char *Argv[]) {
if (PropSIMD.value()) {
Conf.removeProposal(WasmEdge::Proposal::SIMD);
}
// Left for the future proposals.
// if (PropAll.value()) {
// }
if (PropMultiMem.value()) {
Conf.addProposal(WasmEdge::Proposal::MultiMemories);
}
if (PropAll.value()) {
Conf.addProposal(WasmEdge::Proposal::MultiMemories);
}

std::optional<std::chrono::system_clock::time_point> Timeout;
if (TimeLim.value() > 0) {
Expand Down

0 comments on commit fb54491

Please sign in to comment.