diff options
author | Ayke van Laethem <[email protected]> | 2023-03-16 20:16:25 +0100 |
---|---|---|
committer | Damian Gryski <[email protected]> | 2023-03-16 13:46:03 -0700 |
commit | 6c40ee93fe2deb89ed4624b3b3c7e3f1a2df2b6c (patch) | |
tree | f23fc3b7997f4a78f69d74967d5a7140a449650b /transform | |
parent | 4acb1a58453832cf2aef87bb282173f879a85dde (diff) | |
download | tinygo-6c40ee93fe2deb89ed4624b3b3c7e3f1a2df2b6c.tar.gz tinygo-6c40ee93fe2deb89ed4624b3b3c7e3f1a2df2b6c.zip |
transform: update wasm-abi to use opaque pointers
Diffstat (limited to 'transform')
-rw-r--r-- | transform/testdata/wasm-abi.ll | 10 | ||||
-rw-r--r-- | transform/testdata/wasm-abi.out.ll | 24 |
2 files changed, 17 insertions, 17 deletions
diff --git a/transform/testdata/wasm-abi.ll b/transform/testdata/wasm-abi.ll index 79e253473..ade4b5af5 100644 --- a/transform/testdata/wasm-abi.ll +++ b/transform/testdata/wasm-abi.ll @@ -1,19 +1,19 @@ target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128" target triple = "wasm32-unknown-unknown-wasm" -declare i64 @externalCall(i8*, i32, i64) +declare i64 @externalCall(ptr, i32, i64) -define internal i64 @testCall(i8* %ptr, i32 %len, i64 %foo) { - %val = call i64 @externalCall(i8* %ptr, i32 %len, i64 %foo) +define internal i64 @testCall(ptr %ptr, i32 %len, i64 %foo) { + %val = call i64 @externalCall(ptr %ptr, i32 %len, i64 %foo) ret i64 %val } -define internal i64 @testCallNonEntry(i8* %ptr, i32 %len) { +define internal i64 @testCallNonEntry(ptr %ptr, i32 %len) { entry: br label %bb1 bb1: - %val = call i64 @externalCall(i8* %ptr, i32 %len, i64 3) + %val = call i64 @externalCall(ptr %ptr, i32 %len, i64 3) ret i64 %val } diff --git a/transform/testdata/wasm-abi.out.ll b/transform/testdata/wasm-abi.out.ll index cf63c3d79..a1fc7d6a9 100644 --- a/transform/testdata/wasm-abi.out.ll +++ b/transform/testdata/wasm-abi.out.ll @@ -1,27 +1,27 @@ target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128" target triple = "wasm32-unknown-unknown-wasm" -declare i64 @"externalCall$i64wrap"(i8*, i32, i64) +declare i64 @"externalCall$i64wrap"(ptr, i32, i64) -define internal i64 @testCall(i8* %ptr, i32 %len, i64 %foo) { +define internal i64 @testCall(ptr %ptr, i32 %len, i64 %foo) { %i64asptr = alloca i64, align 8 %i64asptr1 = alloca i64, align 8 - store i64 %foo, i64* %i64asptr1, align 8 - call void @externalCall(i64* %i64asptr, i8* %ptr, i32 %len, i64* %i64asptr1) - %retval = load i64, i64* %i64asptr, align 8 + store i64 %foo, ptr %i64asptr1, align 8 + call void @externalCall(ptr %i64asptr, ptr %ptr, i32 %len, ptr %i64asptr1) + %retval = load i64, ptr %i64asptr, align 8 ret i64 %retval } -define internal i64 @testCallNonEntry(i8* %ptr, i32 %len) { +define internal i64 @testCallNonEntry(ptr %ptr, i32 %len) { entry: %i64asptr = alloca i64, align 8 %i64asptr1 = alloca i64, align 8 br label %bb1 bb1: ; preds = %entry - store i64 3, i64* %i64asptr1, align 8 - call void @externalCall(i64* %i64asptr, i8* %ptr, i32 %len, i64* %i64asptr1) - %retval = load i64, i64* %i64asptr, align 8 + store i64 3, ptr %i64asptr1, align 8 + call void @externalCall(ptr %i64asptr, ptr %ptr, i32 %len, ptr %i64asptr1) + %retval = load i64, ptr %i64asptr, align 8 ret i64 %retval } @@ -35,11 +35,11 @@ define internal void @callExportedFunction(i64 %foo) { ret void } -declare void @externalCall(i64*, i8*, i32, i64*) +declare void @externalCall(ptr, ptr, i32, ptr) -define void @exportedFunction(i64* %0) { +define void @exportedFunction(ptr %0) { entry: - %i64 = load i64, i64* %0, align 8 + %i64 = load i64, ptr %0, align 8 call void @"exportedFunction$i64wrap"(i64 %i64) ret void } |