diff --git a/core/rexcode/wasm/decoder.odin b/core/rexcode/wasm/decoder.odin index 30a4abebb..cd22997a0 100644 --- a/core/rexcode/wasm/decoder.odin +++ b/core/rexcode/wasm/decoder.odin @@ -66,6 +66,7 @@ decode :: proc( } +@(require_results) decode_one :: proc( data: []u8, relocs: []Relocation, @@ -230,7 +231,7 @@ decode_one :: proc( // Which index space the IDX immediate in operand slot `which` addresses, by // mnemonic. Mirrors how the builders in instructions.odin tag each operand. -@(private="file") +@(private="file", require_results) idx_kind_for :: #force_inline proc "contextless" (m: Mnemonic, which: int) -> Index_Kind { #partial switch m { case .BR, .BR_IF: return .LABEL @@ -247,7 +248,7 @@ idx_kind_for :: #force_inline proc "contextless" (m: Mnemonic, which: int) -> In return .NONE } -@(private="file") +@(private="file", require_results) reloc_label_at :: #force_inline proc "contextless" (relocs: []Relocation, offset: u32) -> (label_id: u32, found: bool) { for r in relocs { if r.offset == offset { diff --git a/core/rexcode/wasm/encoding_types.odin b/core/rexcode/wasm/encoding_types.odin index e8f677b08..2a2c6fdce 100644 --- a/core/rexcode/wasm/encoding_types.odin +++ b/core/rexcode/wasm/encoding_types.odin @@ -132,6 +132,7 @@ write_uleb_padded5 :: #force_inline proc "contextless" (code: []u8, offset: ^u32 } } +@(require_results) uleb_size :: #force_inline proc "contextless" (value: u64) -> u32 { v := value n: u32 = 1 @@ -141,6 +142,7 @@ uleb_size :: #force_inline proc "contextless" (value: u64) -> u32 { return n } +@(require_results) sleb_size :: #force_inline proc "contextless" (value: i64) -> u32 { v := value n: u32 = 0 diff --git a/core/rexcode/wasm/printer.odin b/core/rexcode/wasm/printer.odin index 6c7b3a381..4c002800f 100644 --- a/core/rexcode/wasm/printer.odin +++ b/core/rexcode/wasm/printer.odin @@ -41,6 +41,7 @@ Print_Options :: isa.Print_Options Print_Result :: isa.Print_Result DEFAULT_PRINT_OPTIONS :: isa.DEFAULT_PRINT_OPTIONS +@(require_results) mnemonic_to_string :: proc(m: Mnemonic, lowercase: bool = true, allocator := context.temp_allocator) -> string { sb := strings.builder_make(allocator) write_mnemonic(&sb, m, !lowercase)