Skip to content

Commit

Permalink
[NFC] Use the new wat parser in RemoveNonJSOps (#6554)
Browse files Browse the repository at this point in the history
  • Loading branch information
tlively authored Apr 29, 2024
1 parent e257cec commit 9b65160
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/passes/RemoveNonJSOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include "ir/literal-utils.h"
#include "ir/memory-utils.h"
#include "ir/module-utils.h"
#include "parser/wat-parser.h"
#include "passes/intrinsics-module.h"
#include "support/insert_ordered.h"
#include "wasm-builder.h"
Expand Down Expand Up @@ -79,11 +80,9 @@ struct RemoveNonJSOpsPass : public WalkerPass<PostWalker<RemoveNonJSOpsPass>> {
//
// TODO: only do this once per invocation of wasm2asm
Module intrinsicsModule;
std::string input(IntrinsicsModuleWast);
SExpressionParser parser(const_cast<char*>(input.c_str()));
Element& root = *parser.root;
SExpressionWasmBuilder builder(
intrinsicsModule, *root[0], IRProfile::Normal);
[[maybe_unused]] auto parsed =
WATParser::parseModule(intrinsicsModule, IntrinsicsModuleWast);
assert(!parsed.getErr());

std::set<Name> neededFunctions;

Expand Down

0 comments on commit 9b65160

Please sign in to comment.