From a802fbe07c270f510c87dfa93577bd4731c075f3 Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Tue, 4 Apr 2023 11:33:15 -0700 Subject: Use Names instead of indices to identify segments (#5618) All top-level Module elements are identified and referred to by Name, but for historical reasons element and data segments were referred to by index instead. Fix this inconsistency by using Names to refer to segments from expressions that use them. Also parse and print segment names like we do for other elements. The C API is partially converted to use names instead of indices, but there are still many functions that refer to data segments by index. Finishing the conversion can be done in the future once it becomes necessary. --- test/lit/array-new-seg-note-count.wast | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'test/lit/array-new-seg-note-count.wast') diff --git a/test/lit/array-new-seg-note-count.wast b/test/lit/array-new-seg-note-count.wast index 43720e731..6f1aaaf2c 100644 --- a/test/lit/array-new-seg-note-count.wast +++ b/test/lit/array-new-seg-note-count.wast @@ -6,12 +6,13 @@ (module ;; CHECK: (type $vec (array i32)) (type $vec (array i32)) + (data "") ;; CHECK: (type $none_=>_ref|$vec| (func (result (ref $vec)))) - ;; CHECK: (data "") - (data "") + ;; CHECK: (data $0 "") + ;; CHECK: (func $test (type $none_=>_ref|$vec|) (result (ref $vec)) - ;; CHECK-NEXT: (array.new_data $vec 0 + ;; CHECK-NEXT: (array.new_data $vec $0 ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) -- cgit v1.2.3