-
Notifications
You must be signed in to change notification settings - Fork 251
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wasmprinter: prints field names declared in the names section (#1512)
* wasmprinter: prints field names declared in the names section * fixes for testsuite * bit of type juggling * missed this one * names field names in the types section for --name-unnamed * emits names for fields when encoding with wast * adds an extra test case for field names and updates snapshots --------- Co-authored-by: Christoph Hegemann <christoph@deepchannel.com>
- Loading branch information
1 parent
cbd87b7
commit 97cad53
Showing
16 changed files
with
197 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
;; --enable-gc | ||
|
||
(module | ||
(type $named (struct (field $x i32) (field $y i32))) | ||
(type $partially_named (struct (field $x i32) (field i32))) | ||
(type $unnamed (struct (field i32) (field i32))) | ||
|
||
(func (param (ref $named) (ref $partially_named) (ref $unnamed)) | ||
i32.const 1 | ||
i32.const 2 | ||
struct.new $named | ||
local.tee 0 | ||
struct.get $named 0 | ||
local.get 0 | ||
struct.get $named 1 | ||
drop | ||
drop | ||
|
||
i32.const 1 | ||
i32.const 2 | ||
struct.new $partially_named | ||
local.tee 1 | ||
struct.get $partially_named 0 | ||
local.get 1 | ||
struct.get $partially_named 1 | ||
drop | ||
drop | ||
|
||
i32.const 1 | ||
i32.const 2 | ||
struct.new $unnamed | ||
local.tee 2 | ||
struct.get $unnamed 0 | ||
local.get 2 | ||
struct.get $unnamed 1 | ||
drop | ||
drop | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
(module | ||
(type $named (;0;) (struct (field $x i32) (field $y i32))) | ||
(type $partially_named (;1;) (struct (field $x i32) (field i32))) | ||
(type $unnamed (;2;) (struct (field i32) (field i32))) | ||
(type (;3;) (func (param (ref $named) (ref $partially_named) (ref $unnamed)))) | ||
(func (;0;) (type 3) (param (ref $named) (ref $partially_named) (ref $unnamed)) | ||
i32.const 1 | ||
i32.const 2 | ||
struct.new $named | ||
local.tee 0 | ||
struct.get $named $x | ||
local.get 0 | ||
struct.get $named $y | ||
drop | ||
drop | ||
i32.const 1 | ||
i32.const 2 | ||
struct.new $partially_named | ||
local.tee 1 | ||
struct.get $partially_named $x | ||
local.get 1 | ||
struct.get $partially_named 1 | ||
drop | ||
drop | ||
i32.const 1 | ||
i32.const 2 | ||
struct.new $unnamed | ||
local.tee 2 | ||
struct.get $unnamed 0 | ||
local.get 2 | ||
struct.get $unnamed 1 | ||
drop | ||
drop | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.