Skip to content

Commit c844c73

Browse files
authored
Merge pull request #1450 from visualfc/abicode
ssa: abi type global constant data
2 parents 52a5c15 + 1f1597f commit c844c73

File tree

69 files changed

+10915
-15124
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+10915
-15124
lines changed

_demo/go/abimethod/main.go

Lines changed: 205 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
1+
package main
2+
3+
import (
4+
"bytes"
5+
"fmt"
6+
"sync/atomic"
7+
"unsafe"
8+
)
9+
10+
func main() {
11+
testGeneric()
12+
testNamed1()
13+
testNamed2()
14+
testNamed3()
15+
testAnonymous1()
16+
testAnonymous2()
17+
testAnonymous3()
18+
testAnonymous4()
19+
testAnonymous5()
20+
testAnonymous6()
21+
testAnonymous7()
22+
testAnonymous8()
23+
testAnonymousBuffer()
24+
}
25+
26+
func testNamed1() {
27+
var a I = &T{100}
28+
if a.Demo1() != 100 {
29+
panic("testNamed1 error")
30+
}
31+
}
32+
33+
func testNamed2() {
34+
var a I = T{100}
35+
if a.Demo1() != 100 {
36+
panic("testNamed2 error")
37+
}
38+
}
39+
40+
func testNamed3() {
41+
var a I2 = &T{100}
42+
if a.Demo2() != 100 {
43+
panic("testNamed4 error")
44+
}
45+
}
46+
47+
type Pointer[T any] struct {
48+
// Mention *T in a field to disallow conversion between Pointer types.
49+
// See go.dev/issue/56603 for more details.
50+
// Use *T, not T, to avoid spurious recursive type definition errors.
51+
_ [0]*T
52+
v unsafe.Pointer
53+
}
54+
55+
// Load atomically loads and returns the value stored in x.
56+
func (x *Pointer[T]) Load() *T { return (*T)(atomic.LoadPointer(&x.v)) }
57+
58+
// Store atomically stores val into x.
59+
func (x *Pointer[T]) Store(val *T) { atomic.StorePointer(&x.v, unsafe.Pointer(val)) }
60+
61+
type IP interface {
62+
Store(*any)
63+
Load() *any
64+
}
65+
66+
func testGeneric() {
67+
var p IP = &Pointer[any]{}
68+
p.Store(func() *any {
69+
var a any = 100
70+
return &a
71+
}())
72+
if (*p.Load()).(int) != 100 {
73+
panic("testGeneric error")
74+
}
75+
}
76+
77+
func testAnonymous1() {
78+
var s I = &struct {
79+
m int
80+
*T
81+
}{10, &T{100}}
82+
if s.Demo1() != 100 {
83+
panic("testAnonymous1 error")
84+
}
85+
}
86+
87+
func testAnonymous2() {
88+
var s I = struct {
89+
m int
90+
*T
91+
}{10, &T{100}}
92+
if s.Demo1() != 100 {
93+
panic("testAnonymous2 error")
94+
}
95+
}
96+
97+
func testAnonymous3() {
98+
var s I = struct {
99+
m int
100+
T
101+
}{10, T{100}}
102+
if s.Demo1() != 100 {
103+
panic("testAnonymous3 error")
104+
}
105+
}
106+
107+
func testAnonymous4() {
108+
var s I = &struct {
109+
m int
110+
T
111+
}{10, T{100}}
112+
if s.Demo1() != 100 {
113+
panic("testAnonymous4 error")
114+
}
115+
}
116+
117+
func testAnonymous5() {
118+
var s I2 = &struct {
119+
m int
120+
T
121+
}{10, T{100}}
122+
if s.Demo2() != 100 {
123+
panic("testAnonymous5 error")
124+
}
125+
}
126+
127+
func testAnonymous6() {
128+
var s I2 = struct {
129+
m int
130+
*T
131+
}{10, &T{100}}
132+
if s.Demo2() != 100 {
133+
panic("testAnonymous6 error")
134+
}
135+
}
136+
137+
func testAnonymous7() {
138+
var s interface {
139+
Demo1() int
140+
Demo2() int
141+
} = struct {
142+
m int
143+
*T
144+
}{10, &T{100}}
145+
if s.Demo1() != 100 {
146+
panic("testAnonymous7 error")
147+
}
148+
if s.Demo2() != 100 {
149+
panic("testAnonymous7 error")
150+
}
151+
}
152+
153+
func testAnonymous8() {
154+
var s interface {
155+
Demo1() int
156+
Demo2() int
157+
demo3() int
158+
} = struct {
159+
m int
160+
*T
161+
}{10, &T{100}}
162+
if s.Demo1() != 100 {
163+
panic("testAnonymous8 error")
164+
}
165+
if s.Demo2() != 100 {
166+
panic("testAnonymous8 error")
167+
}
168+
if s.demo3() != 100 {
169+
panic("testAnonymous8 error")
170+
}
171+
}
172+
173+
func testAnonymousBuffer() {
174+
var s fmt.Stringer = &struct {
175+
m int
176+
*bytes.Buffer
177+
}{10, bytes.NewBufferString("hello")}
178+
if s.String() != "hello" {
179+
panic("testAnonymousBuffer error")
180+
}
181+
}
182+
183+
type T struct {
184+
n int
185+
}
186+
187+
func (t T) Demo1() int {
188+
return t.n
189+
}
190+
191+
func (t *T) Demo2() int {
192+
return t.n
193+
}
194+
195+
func (t *T) demo3() int {
196+
return t.n
197+
}
198+
199+
type I interface {
200+
Demo1() int
201+
}
202+
203+
type I2 interface {
204+
Demo2() int
205+
}

_demo/go/reflectmake/main.go

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package main
2+
3+
import (
4+
"reflect"
5+
"strings"
6+
)
7+
8+
func main() {
9+
typ := reflect.FuncOf([]reflect.Type{reflect.TypeOf(""), reflect.TypeOf(0)}, []reflect.Type{reflect.TypeOf("")}, false)
10+
fn := reflect.MakeFunc(typ, func(args []reflect.Value) []reflect.Value {
11+
r := strings.Repeat(args[0].String(), int(args[1].Int()))
12+
return []reflect.Value{reflect.ValueOf(r)}
13+
})
14+
r := fn.Interface().(func(string, int) string)("abc", 2)
15+
if r != "abcabc" {
16+
panic("reflect.FuncOf error")
17+
}
18+
_, ok := reflect.New(reflect.SliceOf(reflect.TypeOf(t{}))).Elem().Interface().([]t)
19+
if !ok {
20+
panic("reflect.SliceOf error")
21+
}
22+
}
23+
24+
type t struct {
25+
n int
26+
}

cl/_testdata/foo/out.ll

Lines changed: 41 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,31 @@
11
; ModuleID = 'github.com/goplus/llgo/cl/_testdata/foo'
22
source_filename = "github.com/goplus/llgo/cl/_testdata/foo"
33

4-
%"github.com/goplus/llgo/runtime/internal/runtime.eface" = type { ptr, ptr }
5-
%"github.com/goplus/llgo/cl/_testdata/foo.Foo" = type { ptr, float }
4+
%"github.com/goplus/llgo/runtime/abi.StructType" = type { %"github.com/goplus/llgo/runtime/abi.Type", %"github.com/goplus/llgo/runtime/internal/runtime.String", %"github.com/goplus/llgo/runtime/internal/runtime.Slice" }
5+
%"github.com/goplus/llgo/runtime/abi.Type" = type { i64, i64, i32, i8, i8, i8, i8, { ptr, ptr }, ptr, %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr }
66
%"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 }
7-
%"github.com/goplus/llgo/runtime/abi.StructField" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr, i64, %"github.com/goplus/llgo/runtime/internal/runtime.String", i1 }
87
%"github.com/goplus/llgo/runtime/internal/runtime.Slice" = type { ptr, i64, i64 }
8+
%"github.com/goplus/llgo/runtime/abi.PtrType" = type { %"github.com/goplus/llgo/runtime/abi.Type", ptr }
9+
%"github.com/goplus/llgo/runtime/abi.StructField" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr, i64, %"github.com/goplus/llgo/runtime/internal/runtime.String", i1 }
10+
%"github.com/goplus/llgo/runtime/internal/runtime.eface" = type { ptr, ptr }
11+
%"github.com/goplus/llgo/cl/_testdata/foo.Foo" = type { ptr, float }
912

1013
@"github.com/goplus/llgo/cl/_testdata/foo.init$guard" = global i1 false, align 1
11-
@_llgo_int = linkonce global ptr null, align 8
12-
@"_llgo_struct$K-dZ9QotZfVPz2a0YdRa9vmZUuDXPTqZOlMShKEDJtk" = linkonce global ptr null, align 8
13-
@0 = private unnamed_addr constant [1 x i8] c"V", align 1
14+
@"_llgo_struct$K-dZ9QotZfVPz2a0YdRa9vmZUuDXPTqZOlMShKEDJtk" = weak_odr constant %"github.com/goplus/llgo/runtime/abi.StructType" { %"github.com/goplus/llgo/runtime/abi.Type" { i64 8, i64 0, i32 588020711, i8 8, i8 8, i8 8, i8 57, { ptr, ptr } { ptr @"github.com/goplus/llgo/runtime/internal/runtime.structequal", ptr @"_llgo_struct$K-dZ9QotZfVPz2a0YdRa9vmZUuDXPTqZOlMShKEDJtk" }, ptr null, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 16 }, ptr @"*_llgo_struct$K-dZ9QotZfVPz2a0YdRa9vmZUuDXPTqZOlMShKEDJtk" }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 39 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" { ptr @"_llgo_struct$K-dZ9QotZfVPz2a0YdRa9vmZUuDXPTqZOlMShKEDJtk$fields", i64 1, i64 1 } }, align 8
15+
@0 = private unnamed_addr constant [16 x i8] c"struct { V int }", align 1
16+
@"*_llgo_struct$K-dZ9QotZfVPz2a0YdRa9vmZUuDXPTqZOlMShKEDJtk" = weak_odr constant %"github.com/goplus/llgo/runtime/abi.PtrType" { %"github.com/goplus/llgo/runtime/abi.Type" { i64 8, i64 8, i32 2112228924, i8 10, i8 8, i8 8, i8 54, { ptr, ptr } { ptr @"__llgo_stub.github.com/goplus/llgo/runtime/internal/runtime.memequalptr", ptr null }, ptr null, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 16 }, ptr null }, ptr @"_llgo_struct$K-dZ9QotZfVPz2a0YdRa9vmZUuDXPTqZOlMShKEDJtk" }, align 8
1417
@1 = private unnamed_addr constant [39 x i8] c"github.com/goplus/llgo/cl/_testdata/foo", align 1
15-
@"github.com/goplus/llgo/cl/_testdata/foo.struct$MYpsoM99ZwFY087IpUOkIw1zjBA_sgFXVodmn1m-G88" = linkonce global ptr null, align 8
16-
@2 = private unnamed_addr constant [1 x i8] c"v", align 1
17-
@3 = private unnamed_addr constant [4 x i8] c"load", align 1
18+
@2 = private unnamed_addr constant [1 x i8] c"V", align 1
19+
@_llgo_int = weak_odr constant %"github.com/goplus/llgo/runtime/abi.Type" { i64 8, i64 0, i32 -25294021, i8 12, i8 8, i8 8, i8 34, { ptr, ptr } { ptr @"__llgo_stub.github.com/goplus/llgo/runtime/internal/runtime.memequal64", ptr null }, ptr null, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 3 }, ptr @"*_llgo_int" }, align 8
20+
@3 = private unnamed_addr constant [3 x i8] c"int", align 1
21+
@"*_llgo_int" = weak_odr constant %"github.com/goplus/llgo/runtime/abi.PtrType" { %"github.com/goplus/llgo/runtime/abi.Type" { i64 8, i64 8, i32 -939606833, i8 10, i8 8, i8 8, i8 54, { ptr, ptr } { ptr @"__llgo_stub.github.com/goplus/llgo/runtime/internal/runtime.memequalptr", ptr null }, ptr null, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 3 }, ptr null }, ptr @_llgo_int }, align 8
22+
@"_llgo_struct$K-dZ9QotZfVPz2a0YdRa9vmZUuDXPTqZOlMShKEDJtk$fields" = weak_odr constant [1 x %"github.com/goplus/llgo/runtime/abi.StructField"] [%"github.com/goplus/llgo/runtime/abi.StructField" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 1 }, ptr @_llgo_int, i64 0, %"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, i1 false }], align 8
23+
@"github.com/goplus/llgo/cl/_testdata/foo.struct$MYpsoM99ZwFY087IpUOkIw1zjBA_sgFXVodmn1m-G88" = weak_odr constant %"github.com/goplus/llgo/runtime/abi.StructType" { %"github.com/goplus/llgo/runtime/abi.Type" { i64 8, i64 0, i32 835978208, i8 8, i8 8, i8 8, i8 57, { ptr, ptr } { ptr @"github.com/goplus/llgo/runtime/internal/runtime.structequal", ptr @"github.com/goplus/llgo/cl/_testdata/foo.struct$MYpsoM99ZwFY087IpUOkIw1zjBA_sgFXVodmn1m-G88" }, ptr null, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 16 }, ptr @"*github.com/goplus/llgo/cl/_testdata/foo.struct$MYpsoM99ZwFY087IpUOkIw1zjBA_sgFXVodmn1m-G88" }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 39 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" { ptr @"github.com/goplus/llgo/cl/_testdata/foo.struct$MYpsoM99ZwFY087IpUOkIw1zjBA_sgFXVodmn1m-G88$fields", i64 1, i64 1 } }, align 8
24+
@4 = private unnamed_addr constant [16 x i8] c"struct { v int }", align 1
25+
@"*github.com/goplus/llgo/cl/_testdata/foo.struct$MYpsoM99ZwFY087IpUOkIw1zjBA_sgFXVodmn1m-G88" = weak_odr constant %"github.com/goplus/llgo/runtime/abi.PtrType" { %"github.com/goplus/llgo/runtime/abi.Type" { i64 8, i64 8, i32 -837270651, i8 10, i8 8, i8 8, i8 54, { ptr, ptr } { ptr @"__llgo_stub.github.com/goplus/llgo/runtime/internal/runtime.memequalptr", ptr null }, ptr null, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 16 }, ptr null }, ptr @"github.com/goplus/llgo/cl/_testdata/foo.struct$MYpsoM99ZwFY087IpUOkIw1zjBA_sgFXVodmn1m-G88" }, align 8
26+
@5 = private unnamed_addr constant [1 x i8] c"v", align 1
27+
@"github.com/goplus/llgo/cl/_testdata/foo.struct$MYpsoM99ZwFY087IpUOkIw1zjBA_sgFXVodmn1m-G88$fields" = weak_odr constant [1 x %"github.com/goplus/llgo/runtime/abi.StructField"] [%"github.com/goplus/llgo/runtime/abi.StructField" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 1 }, ptr @_llgo_int, i64 0, %"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, i1 false }], align 8
28+
@6 = private unnamed_addr constant [4 x i8] c"load", align 1
1829

1930
define %"github.com/goplus/llgo/runtime/internal/runtime.eface" @"github.com/goplus/llgo/cl/_testdata/foo.Bar"() {
2031
_llgo_0:
@@ -23,13 +34,10 @@ _llgo_0:
2334
%1 = getelementptr inbounds { i64 }, ptr %0, i32 0, i32 0
2435
store i64 1, ptr %1, align 4
2536
%2 = load { i64 }, ptr %0, align 4
26-
%3 = load ptr, ptr @_llgo_int, align 8
27-
%4 = load ptr, ptr @"_llgo_struct$K-dZ9QotZfVPz2a0YdRa9vmZUuDXPTqZOlMShKEDJtk", align 8
28-
%5 = extractvalue { i64 } %2, 0
29-
%6 = inttoptr i64 %5 to ptr
30-
%7 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %4, 0
31-
%8 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %7, ptr %6, 1
32-
ret %"github.com/goplus/llgo/runtime/internal/runtime.eface" %8
37+
%3 = extractvalue { i64 } %2, 0
38+
%4 = inttoptr i64 %3 to ptr
39+
%5 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" { ptr @"_llgo_struct$K-dZ9QotZfVPz2a0YdRa9vmZUuDXPTqZOlMShKEDJtk", ptr undef }, ptr %4, 1
40+
ret %"github.com/goplus/llgo/runtime/internal/runtime.eface" %5
3341
}
3442

3543
define %"github.com/goplus/llgo/runtime/internal/runtime.eface" @"github.com/goplus/llgo/cl/_testdata/foo.F"() {
@@ -39,12 +47,10 @@ _llgo_0:
3947
%1 = getelementptr inbounds { i64 }, ptr %0, i32 0, i32 0
4048
store i64 1, ptr %1, align 4
4149
%2 = load { i64 }, ptr %0, align 4
42-
%3 = load ptr, ptr @"github.com/goplus/llgo/cl/_testdata/foo.struct$MYpsoM99ZwFY087IpUOkIw1zjBA_sgFXVodmn1m-G88", align 8
43-
%4 = extractvalue { i64 } %2, 0
44-
%5 = inttoptr i64 %4 to ptr
45-
%6 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %3, 0
46-
%7 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %6, ptr %5, 1
47-
ret %"github.com/goplus/llgo/runtime/internal/runtime.eface" %7
50+
%3 = extractvalue { i64 } %2, 0
51+
%4 = inttoptr i64 %3 to ptr
52+
%5 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" { ptr @"github.com/goplus/llgo/cl/_testdata/foo.struct$MYpsoM99ZwFY087IpUOkIw1zjBA_sgFXVodmn1m-G88", ptr undef }, ptr %4, 1
53+
ret %"github.com/goplus/llgo/runtime/internal/runtime.eface" %5
4854
}
4955

5056
define ptr @"github.com/goplus/llgo/cl/_testdata/foo.Foo.Pb"(%"github.com/goplus/llgo/cl/_testdata/foo.Foo" %0) {
@@ -66,7 +72,7 @@ _llgo_0:
6672

6773
define void @"github.com/goplus/llgo/cl/_testdata/foo.(*Game).Load"(ptr %0) {
6874
_llgo_0:
69-
call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 4 })
75+
call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @6, i64 4 })
7076
call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10)
7177
ret void
7278
}
@@ -83,7 +89,6 @@ _llgo_0:
8389

8490
_llgo_1: ; preds = %_llgo_0
8591
store i1 true, ptr @"github.com/goplus/llgo/cl/_testdata/foo.init$guard", align 1
86-
call void @"github.com/goplus/llgo/cl/_testdata/foo.init$after"()
8792
br label %_llgo_2
8893

8994
_llgo_2: ; preds = %_llgo_1, %_llgo_0
@@ -93,48 +98,23 @@ _llgo_2: ; preds = %_llgo_1, %_llgo_0
9398
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
9499
declare void @llvm.memset(ptr nocapture writeonly, i8, i64, i1 immarg) #0
95100

96-
define void @"github.com/goplus/llgo/cl/_testdata/foo.init$after"() {
97-
_llgo_0:
98-
%0 = load ptr, ptr @_llgo_int, align 8
99-
%1 = icmp eq ptr %0, null
100-
br i1 %1, label %_llgo_1, label %_llgo_2
101+
declare i1 @"github.com/goplus/llgo/runtime/internal/runtime.structequal"(ptr, ptr, ptr)
101102

102-
_llgo_1: ; preds = %_llgo_0
103-
%2 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i64 34)
104-
store ptr %2, ptr @_llgo_int, align 8
105-
br label %_llgo_2
103+
declare i1 @"github.com/goplus/llgo/runtime/internal/runtime.memequalptr"(ptr, ptr)
106104

107-
_llgo_2: ; preds = %_llgo_1, %_llgo_0
108-
%3 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i64 34)
109-
%4 = call %"github.com/goplus/llgo/runtime/abi.StructField" @"github.com/goplus/llgo/runtime/internal/runtime.StructField"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 1 }, ptr %3, i64 0, %"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, i1 false)
110-
%5 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 56)
111-
%6 = getelementptr %"github.com/goplus/llgo/runtime/abi.StructField", ptr %5, i64 0
112-
store %"github.com/goplus/llgo/runtime/abi.StructField" %4, ptr %6, align 8
113-
%7 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %5, 0
114-
%8 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %7, i64 1, 1
115-
%9 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %8, i64 1, 2
116-
%10 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 39 }, i64 8, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %9)
117-
store ptr %10, ptr @"_llgo_struct$K-dZ9QotZfVPz2a0YdRa9vmZUuDXPTqZOlMShKEDJtk", align 8
118-
%11 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i64 34)
119-
%12 = call %"github.com/goplus/llgo/runtime/abi.StructField" @"github.com/goplus/llgo/runtime/internal/runtime.StructField"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 1 }, ptr %11, i64 0, %"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, i1 false)
120-
%13 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 56)
121-
%14 = getelementptr %"github.com/goplus/llgo/runtime/abi.StructField", ptr %13, i64 0
122-
store %"github.com/goplus/llgo/runtime/abi.StructField" %12, ptr %14, align 8
123-
%15 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %13, 0
124-
%16 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %15, i64 1, 1
125-
%17 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %16, i64 1, 2
126-
%18 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 39 }, i64 8, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %17)
127-
store ptr %18, ptr @"github.com/goplus/llgo/cl/_testdata/foo.struct$MYpsoM99ZwFY087IpUOkIw1zjBA_sgFXVodmn1m-G88", align 8
128-
ret void
105+
define linkonce i1 @"__llgo_stub.github.com/goplus/llgo/runtime/internal/runtime.memequalptr"(ptr %0, ptr %1, ptr %2) {
106+
_llgo_0:
107+
%3 = tail call i1 @"github.com/goplus/llgo/runtime/internal/runtime.memequalptr"(ptr %1, ptr %2)
108+
ret i1 %3
129109
}
130110

131-
declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i64)
111+
declare i1 @"github.com/goplus/llgo/runtime/internal/runtime.memequal64"(ptr, ptr)
132112

133-
declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String", i64, %"github.com/goplus/llgo/runtime/internal/runtime.Slice")
134-
135-
declare %"github.com/goplus/llgo/runtime/abi.StructField" @"github.com/goplus/llgo/runtime/internal/runtime.StructField"(%"github.com/goplus/llgo/runtime/internal/runtime.String", ptr, i64, %"github.com/goplus/llgo/runtime/internal/runtime.String", i1)
136-
137-
declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64)
113+
define linkonce i1 @"__llgo_stub.github.com/goplus/llgo/runtime/internal/runtime.memequal64"(ptr %0, ptr %1, ptr %2) {
114+
_llgo_0:
115+
%3 = tail call i1 @"github.com/goplus/llgo/runtime/internal/runtime.memequal64"(ptr %1, ptr %2)
116+
ret i1 %3
117+
}
138118

139119
declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String")
140120

0 commit comments

Comments
 (0)