Skip to content

Commit 3ab6e80

Browse files
authored
[wasm-split] Don't always minimizee export names in multi-split (#7779)
For non-multi-split, we decide whether to minimize the export names based on the debug info flag: https://github.com/WebAssembly/binaryen/blob/96362ebe5f3eedc9d9a53694a16e375670cd53b1/src/tools/wasm-split/wasm-split.cpp#L333 But in multi-split we always minimize them. This makes it also dependent on the debug flag as in the case of the two-way split.
1 parent 96362eb commit 3ab6e80

File tree

2 files changed

+26
-26
lines changed

2 files changed

+26
-26
lines changed

src/tools/wasm-split/wasm-split.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ void multiSplitModule(const WasmSplitOptions& options) {
417417
ModuleSplitting::Config config;
418418
config.usePlaceholders = false;
419419
config.importNamespace = options.importNamespace;
420-
config.minimizeNewExportNames = true;
420+
config.minimizeNewExportNames = !options.passOptions.debugInfo;
421421
for (auto& [mod, funcs] : moduleFuncs) {
422422
if (options.verbose) {
423423
std::cerr << "Splitting module " << mod << '\n';

test/lit/wasm-split/multi-split.wast

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@
2626

2727
;; CHECK-A: (type $2 (func (result i32)))
2828

29-
;; CHECK-A: (import "" "c" (table $timport$0 1 funcref))
29+
;; CHECK-A: (import "" "table" (table $timport$0 1 funcref))
3030

31-
;; CHECK-A: (import "" "a" (func $B (result i64)))
31+
;; CHECK-A: (import "" "B" (func $B (result i64)))
3232

33-
;; CHECK-A: (import "" "b" (func $C (result f32)))
33+
;; CHECK-A: (import "" "C" (func $C (result f32)))
3434

3535
;; CHECK-A: (elem $0 (i32.const 0) $A)
3636

@@ -58,11 +58,11 @@
5858

5959
;; CHECK-A-NS: (type $2 (func (result i32)))
6060

61-
;; CHECK-A-NS: (import "custom_env" "c" (table $timport$0 1 funcref))
61+
;; CHECK-A-NS: (import "custom_env" "table" (table $timport$0 1 funcref))
6262

63-
;; CHECK-A-NS: (import "custom_env" "a" (func $B (result i64)))
63+
;; CHECK-A-NS: (import "custom_env" "B" (func $B (result i64)))
6464

65-
;; CHECK-A-NS: (import "custom_env" "b" (func $C (result f32)))
65+
;; CHECK-A-NS: (import "custom_env" "C" (func $C (result f32)))
6666

6767
;; CHECK-A-NS: (elem $0 (i32.const 0) $A)
6868

@@ -108,11 +108,11 @@
108108

109109
;; CHECK-B: (type $2 (func (result i64)))
110110

111-
;; CHECK-B: (import "" "e" (table $timport$0 1 funcref))
111+
;; CHECK-B: (import "" "table_4" (table $timport$0 1 funcref))
112112

113-
;; CHECK-B: (import "" "b" (func $C (result f32)))
113+
;; CHECK-B: (import "" "C" (func $C (result f32)))
114114

115-
;; CHECK-B: (import "" "d" (func $fimport$1 (result i32)))
115+
;; CHECK-B: (import "" "trampoline_A" (func $fimport$1 (result i32)))
116116

117117
;; CHECK-B: (elem $0 (i32.const 0) $B)
118118

@@ -140,11 +140,11 @@
140140

141141
;; CHECK-B-NS: (type $2 (func (result i64)))
142142

143-
;; CHECK-B-NS: (import "custom_env" "e" (table $timport$0 1 funcref))
143+
;; CHECK-B-NS: (import "custom_env" "table_4" (table $timport$0 1 funcref))
144144

145-
;; CHECK-B-NS: (import "custom_env" "b" (func $C (result f32)))
145+
;; CHECK-B-NS: (import "custom_env" "C" (func $C (result f32)))
146146

147-
;; CHECK-B-NS: (import "custom_env" "d" (func $fimport$1 (result i32)))
147+
;; CHECK-B-NS: (import "custom_env" "trampoline_A" (func $fimport$1 (result i32)))
148148

149149
;; CHECK-B-NS: (elem $0 (i32.const 0) $B)
150150

@@ -190,11 +190,11 @@
190190

191191
;; CHECK-C: (type $2 (func (result f32)))
192192

193-
;; CHECK-C: (import "" "g" (table $timport$0 1 funcref))
193+
;; CHECK-C: (import "" "table_6" (table $timport$0 1 funcref))
194194

195-
;; CHECK-C: (import "" "d" (func $fimport$0 (result i32)))
195+
;; CHECK-C: (import "" "trampoline_A" (func $fimport$0 (result i32)))
196196

197-
;; CHECK-C: (import "" "f" (func $fimport$1 (result i64)))
197+
;; CHECK-C: (import "" "trampoline_B" (func $fimport$1 (result i64)))
198198

199199
;; CHECK-C: (elem $0 (i32.const 0) $C)
200200

@@ -222,11 +222,11 @@
222222

223223
;; CHECK-C-NS: (type $2 (func (result f32)))
224224

225-
;; CHECK-C-NS: (import "custom_env" "g" (table $timport$0 1 funcref))
225+
;; CHECK-C-NS: (import "custom_env" "table_6" (table $timport$0 1 funcref))
226226

227-
;; CHECK-C-NS: (import "custom_env" "d" (func $fimport$0 (result i32)))
227+
;; CHECK-C-NS: (import "custom_env" "trampoline_A" (func $fimport$0 (result i32)))
228228

229-
;; CHECK-C-NS: (import "custom_env" "f" (func $fimport$1 (result i64)))
229+
;; CHECK-C-NS: (import "custom_env" "trampoline_B" (func $fimport$1 (result i64)))
230230

231231
;; CHECK-C-NS: (elem $0 (i32.const 0) $C)
232232

@@ -279,19 +279,19 @@
279279

280280
;; PRIMARY: (elem $2 (table $2) (i32.const 0) funcref (item (ref.null nofunc)))
281281

282-
;; PRIMARY: (export "a" (func $1))
282+
;; PRIMARY: (export "B" (func $1))
283283

284-
;; PRIMARY: (export "b" (func $3))
284+
;; PRIMARY: (export "C" (func $3))
285285

286-
;; PRIMARY: (export "c" (table $0))
286+
;; PRIMARY: (export "table" (table $0))
287287

288-
;; PRIMARY: (export "d" (func $0))
288+
;; PRIMARY: (export "trampoline_A" (func $0))
289289

290-
;; PRIMARY: (export "e" (table $1))
290+
;; PRIMARY: (export "table_4" (table $1))
291291

292-
;; PRIMARY: (export "f" (func $2))
292+
;; PRIMARY: (export "trampoline_B" (func $2))
293293

294-
;; PRIMARY: (export "g" (table $2))
294+
;; PRIMARY: (export "table_6" (table $2))
295295

296296
;; PRIMARY: (func $0 (result i32)
297297
;; PRIMARY-NEXT: (call_indirect (type $ret-i32)

0 commit comments

Comments
 (0)