[WebAssembly] Explicitly specify function/global index space in YAML
These indexes are useful because they are not always zero based and
functions and globals are referenced elsewhere by their index.
This matches what we already do for the type index space.
Differential Revision: https://reviews.llvm.org/D41877
llvm-svn: 322121
diff --git a/llvm/test/ObjectYAML/wasm/code_section.yaml b/llvm/test/ObjectYAML/wasm/code_section.yaml
index 5359d2a..4f7da67 100644
--- a/llvm/test/ObjectYAML/wasm/code_section.yaml
+++ b/llvm/test/ObjectYAML/wasm/code_section.yaml
@@ -5,10 +5,12 @@
Sections:
- Type: TYPE
Signatures:
- - ReturnType: F32
+ - Index: 0
+ ReturnType: F32
ParamTypes:
- I32
- - ReturnType: NORESULT
+ - Index: 1
+ ReturnType: NORESULT
ParamTypes:
- I32
- I64
@@ -25,11 +27,13 @@
Index: 1
Offset: 0x00000025
Functions:
- - Locals:
+ - Index: 0
+ Locals:
- Type: I32
Count: 3
Body: 418080808000210020002101200111808080800000210220020F0B
- - Locals:
+ - Index: 1
+ Locals:
- Type: I32
Count: 1
Body: 108180808000210020000F0B
@@ -58,11 +62,13 @@
# CHECK: Index: 1
# CHECK: Offset: 0x00000025
# CHECK: Functions:
-# CHECK: - Locals:
+# CHECK: - Index: 0
+# CHECK: Locals:
# CHECK: - Type: I32
# CHECK: Count: 3
# CHECK: Body: 418080808000210020002101200111808080800000210220020F0B
-# CHECK: - Locals:
+# CHECK: - Index: 1
+# CHECK: Locals:
# CHECK: - Type: I32
# CHECK: Count: 1
# CHECK: Body: 108180808000210020000F0B