From 03950810d1aa5c71ccb2f88ca311309e61d6cdb0 Mon Sep 17 00:00:00 2001 From: Heejin Ahn Date: Tue, 30 Jun 2026 11:12:55 +0000 Subject: [PATCH] [wasm-split] Use escapes names for manifest files This changes the wasm-split's manifest file format from unescaped function names to escaped ones. This allows us to specify all characters including newlines within function names. --- CHANGELOG.md | 2 ++ src/tools/wasm-split/wasm-split.cpp | 2 +- test/lit/wasm-split/multi-split-escape-names.wast.manifest | 6 +++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ddfc2ecd70..9d09083ed65 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,8 @@ Current Trunk - Add acqrel ordering support for atomic fences (#8845). Breaks the C API; `BinaryenAtomicFence` now takes a memory order param. Use `BinaryenMemoryOrderSeqCst()` to preserve the original behavior. +- wasm-split's --manifest option now takes a manifest file with escaped function + names instead of unescaped ones, e.g., `foo\20bar` instead of `foo bar`. v130 ---- diff --git a/src/tools/wasm-split/wasm-split.cpp b/src/tools/wasm-split/wasm-split.cpp index d740aabbe26..e32a8311282 100644 --- a/src/tools/wasm-split/wasm-split.cpp +++ b/src/tools/wasm-split/wasm-split.cpp @@ -431,7 +431,7 @@ void multiSplitModule(const WasmSplitOptions& options) { } continue; } - Name name = Names::escape(line); + Name name(line); if (newSection) { if (name.endsWith(":")) { name = name.substr(0, name.size() - 1); diff --git a/test/lit/wasm-split/multi-split-escape-names.wast.manifest b/test/lit/wasm-split/multi-split-escape-names.wast.manifest index 8ff81f419c8..e05e974378e 100644 --- a/test/lit/wasm-split/multi-split-escape-names.wast.manifest +++ b/test/lit/wasm-split/multi-split-escape-names.wast.manifest @@ -1,8 +1,8 @@ 1: -wasm::Type::getFeatures() const +wasm::Type::getFeatures\28\29\20const 2: -wasm::Literal::Literal(std::__2::array const&) +wasm::Literal::Literal\28std::__2::array\20const&\29 3: -std::operator<<(std::__2::basic_ostream>&, wasm::Module&) +std::operator<<\28std::__2::basic_ostream>&\2c\20wasm::Module&\29