aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/WasmObjectWriter.cpp
diff options
context:
space:
mode:
authorDerek Schuff <dschuff@chromium.org>2024-01-17 11:29:19 -0800
committerGitHub <noreply@github.com>2024-01-17 11:29:19 -0800
commit103fa3250c46b0c4cf04573c5e075185ca574016 (patch)
treeba51e90188f44cb15b40047543c31f161aab3c75 /llvm/lib/MC/WasmObjectWriter.cpp
parentbc90b91885263eb2128315ff636b7f2d200eab48 (diff)
downloadllvm-103fa3250c46b0c4cf04573c5e075185ca574016.zip
llvm-103fa3250c46b0c4cf04573c5e075185ca574016.tar.gz
llvm-103fa3250c46b0c4cf04573c5e075185ca574016.tar.bz2
[WebAssembly] Use ValType instead of integer types to model wasm tables (#78012)
LLVM models some features found in the binary format with raw integers and others with nested or enumerated types. This PR switches modeling of tables and segments to use wasm::ValType rather than uint32_t. This NFC change is in preparation for modeling more reference types, but IMO is also cleaner and closer to the spec.
Diffstat (limited to 'llvm/lib/MC/WasmObjectWriter.cpp')
-rw-r--r--llvm/lib/MC/WasmObjectWriter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/MC/WasmObjectWriter.cpp b/llvm/lib/MC/WasmObjectWriter.cpp
index e43f111..ead4f9e 100644
--- a/llvm/lib/MC/WasmObjectWriter.cpp
+++ b/llvm/lib/MC/WasmObjectWriter.cpp
@@ -972,7 +972,7 @@ void WasmObjectWriter::writeTableSection(ArrayRef<wasm::WasmTable> Tables) {
encodeULEB128(Tables.size(), W->OS);
for (const wasm::WasmTable &Table : Tables) {
- encodeULEB128(Table.Type.ElemType, W->OS);
+ encodeULEB128((uint32_t)Table.Type.ElemType, W->OS);
encodeULEB128(Table.Type.Limits.Flags, W->OS);
encodeULEB128(Table.Type.Limits.Minimum, W->OS);
if (Table.Type.Limits.Flags & wasm::WASM_LIMITS_FLAG_HAS_MAX)