Skip to content

Commit 9b65160

Browse files
authored
[NFC] Use the new wat parser in RemoveNonJSOps (#6554)
1 parent e257cec commit 9b65160

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/passes/RemoveNonJSOps.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
#include "ir/literal-utils.h"
4343
#include "ir/memory-utils.h"
4444
#include "ir/module-utils.h"
45+
#include "parser/wat-parser.h"
4546
#include "passes/intrinsics-module.h"
4647
#include "support/insert_ordered.h"
4748
#include "wasm-builder.h"
@@ -79,11 +80,9 @@ struct RemoveNonJSOpsPass : public WalkerPass<PostWalker<RemoveNonJSOpsPass>> {
7980
//
8081
// TODO: only do this once per invocation of wasm2asm
8182
Module intrinsicsModule;
82-
std::string input(IntrinsicsModuleWast);
83-
SExpressionParser parser(const_cast<char*>(input.c_str()));
84-
Element& root = *parser.root;
85-
SExpressionWasmBuilder builder(
86-
intrinsicsModule, *root[0], IRProfile::Normal);
83+
[[maybe_unused]] auto parsed =
84+
WATParser::parseModule(intrinsicsModule, IntrinsicsModuleWast);
85+
assert(!parsed.getErr());
8786

8887
std::set<Name> neededFunctions;
8988

0 commit comments

Comments
 (0)