diff options
author | Alon Zakai <azakai@google.com> | 2021-03-12 06:46:14 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-12 06:46:14 -0800 |
commit | b98dce24827e006e9527ec50642ba77dfada662a (patch) | |
tree | 9f546c1e6b35e4d85c27c2cdb2fead9a5acefb09 /src/wasm-type.h | |
parent | 32be343d217781045572da274eb4d63f4ead86c5 (diff) | |
download | binaryen-b98dce24827e006e9527ec50642ba77dfada662a.tar.gz binaryen-b98dce24827e006e9527ec50642ba77dfada662a.tar.bz2 binaryen-b98dce24827e006e9527ec50642ba77dfada662a.zip |
[Wasm GC] Optimize struct stores like stores to memory, ignore unneeded bits (#3680)
When storing to an i8, we can ignore any higher bits, etc.
Adds a getByteSize utility to Field to make this convenient.
Diffstat (limited to 'src/wasm-type.h')
-rw-r--r-- | src/wasm-type.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/wasm-type.h b/src/wasm-type.h index 7f037d5e7..bb499c7c1 100644 --- a/src/wasm-type.h +++ b/src/wasm-type.h @@ -440,6 +440,8 @@ struct Field { } bool operator!=(const Field& other) const { return !(*this == other); } std::string toString() const; + + unsigned getByteSize() const; }; typedef std::vector<Field> FieldList; |