152 lines
8.9 KiB
LLVM
152 lines
8.9 KiB
LLVM
; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testdata/foo'
|
|
source_filename = "github.com/goplus/llgo/compiler/cl/_testdata/foo"
|
|
|
|
%"github.com/goplus/llgo/runtime/internal/runtime.eface" = type { ptr, ptr }
|
|
%"github.com/goplus/llgo/compiler/cl/_testdata/foo.Foo" = type { ptr, float }
|
|
%"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 }
|
|
%"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 }
|
|
%"github.com/goplus/llgo/runtime/internal/runtime.Slice" = type { ptr, i64, i64 }
|
|
|
|
@"github.com/goplus/llgo/compiler/cl/_testdata/foo.init$guard" = global i1 false, align 1
|
|
@_llgo_int = linkonce global ptr null, align 8
|
|
@"_llgo_struct$K-dZ9QotZfVPz2a0YdRa9vmZUuDXPTqZOlMShKEDJtk" = linkonce global ptr null, align 8
|
|
@0 = private unnamed_addr constant [1 x i8] c"V", align 1
|
|
@1 = private unnamed_addr constant [48 x i8] c"github.com/goplus/llgo/compiler/cl/_testdata/foo", align 1
|
|
@"github.com/goplus/llgo/compiler/cl/_testdata/foo.struct$MYpsoM99ZwFY087IpUOkIw1zjBA_sgFXVodmn1m-G88" = linkonce global ptr null, align 8
|
|
@2 = private unnamed_addr constant [1 x i8] c"v", align 1
|
|
@3 = private unnamed_addr constant [4 x i8] c"load", align 1
|
|
|
|
define %"github.com/goplus/llgo/runtime/internal/runtime.eface" @"github.com/goplus/llgo/compiler/cl/_testdata/foo.Bar"() {
|
|
_llgo_0:
|
|
%0 = alloca { i64 }, align 8
|
|
call void @llvm.memset(ptr %0, i8 0, i64 8, i1 false)
|
|
%1 = getelementptr inbounds { i64 }, ptr %0, i32 0, i32 0
|
|
store i64 1, ptr %1, align 4
|
|
%2 = load { i64 }, ptr %0, align 4
|
|
%3 = load ptr, ptr @_llgo_int, align 8
|
|
%4 = load ptr, ptr @"_llgo_struct$K-dZ9QotZfVPz2a0YdRa9vmZUuDXPTqZOlMShKEDJtk", align 8
|
|
%5 = extractvalue { i64 } %2, 0
|
|
%6 = inttoptr i64 %5 to ptr
|
|
%7 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %4, 0
|
|
%8 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %7, ptr %6, 1
|
|
ret %"github.com/goplus/llgo/runtime/internal/runtime.eface" %8
|
|
}
|
|
|
|
define %"github.com/goplus/llgo/runtime/internal/runtime.eface" @"github.com/goplus/llgo/compiler/cl/_testdata/foo.F"() {
|
|
_llgo_0:
|
|
%0 = alloca { i64 }, align 8
|
|
call void @llvm.memset(ptr %0, i8 0, i64 8, i1 false)
|
|
%1 = getelementptr inbounds { i64 }, ptr %0, i32 0, i32 0
|
|
store i64 1, ptr %1, align 4
|
|
%2 = load { i64 }, ptr %0, align 4
|
|
%3 = load ptr, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/foo.struct$MYpsoM99ZwFY087IpUOkIw1zjBA_sgFXVodmn1m-G88", align 8
|
|
%4 = extractvalue { i64 } %2, 0
|
|
%5 = inttoptr i64 %4 to ptr
|
|
%6 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %3, 0
|
|
%7 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %6, ptr %5, 1
|
|
ret %"github.com/goplus/llgo/runtime/internal/runtime.eface" %7
|
|
}
|
|
|
|
define ptr @"github.com/goplus/llgo/compiler/cl/_testdata/foo.Foo.Pb"(%"github.com/goplus/llgo/compiler/cl/_testdata/foo.Foo" %0) {
|
|
_llgo_0:
|
|
%1 = alloca %"github.com/goplus/llgo/compiler/cl/_testdata/foo.Foo", align 8
|
|
call void @llvm.memset(ptr %1, i8 0, i64 16, i1 false)
|
|
store %"github.com/goplus/llgo/compiler/cl/_testdata/foo.Foo" %0, ptr %1, align 8
|
|
%2 = getelementptr inbounds %"github.com/goplus/llgo/compiler/cl/_testdata/foo.Foo", ptr %1, i32 0, i32 0
|
|
%3 = load ptr, ptr %2, align 8
|
|
ret ptr %3
|
|
}
|
|
|
|
define ptr @"github.com/goplus/llgo/compiler/cl/_testdata/foo.(*Foo).Pb"(ptr %0) {
|
|
_llgo_0:
|
|
%1 = load %"github.com/goplus/llgo/compiler/cl/_testdata/foo.Foo", ptr %0, align 8
|
|
%2 = call ptr @"github.com/goplus/llgo/compiler/cl/_testdata/foo.Foo.Pb"(%"github.com/goplus/llgo/compiler/cl/_testdata/foo.Foo" %1)
|
|
ret ptr %2
|
|
}
|
|
|
|
define void @"github.com/goplus/llgo/compiler/cl/_testdata/foo.(*Game).Load"(ptr %0) {
|
|
_llgo_0:
|
|
call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 4 })
|
|
call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10)
|
|
ret void
|
|
}
|
|
|
|
define void @"github.com/goplus/llgo/compiler/cl/_testdata/foo.(*Game).initGame"(ptr %0) {
|
|
_llgo_0:
|
|
ret void
|
|
}
|
|
|
|
define void @"github.com/goplus/llgo/compiler/cl/_testdata/foo.init"() {
|
|
_llgo_0:
|
|
%0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/foo.init$guard", align 1
|
|
br i1 %0, label %_llgo_2, label %_llgo_1
|
|
|
|
_llgo_1: ; preds = %_llgo_0
|
|
store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/foo.init$guard", align 1
|
|
call void @"github.com/goplus/llgo/compiler/cl/_testdata/foo.init$after"()
|
|
br label %_llgo_2
|
|
|
|
_llgo_2: ; preds = %_llgo_1, %_llgo_0
|
|
ret void
|
|
}
|
|
|
|
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
|
|
declare void @llvm.memset(ptr nocapture writeonly, i8, i64, i1 immarg) #0
|
|
|
|
define void @"github.com/goplus/llgo/compiler/cl/_testdata/foo.init$after"() {
|
|
_llgo_0:
|
|
%0 = load ptr, ptr @_llgo_int, align 8
|
|
%1 = icmp eq ptr %0, null
|
|
br i1 %1, label %_llgo_1, label %_llgo_2
|
|
|
|
_llgo_1: ; preds = %_llgo_0
|
|
%2 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i64 34)
|
|
store ptr %2, ptr @_llgo_int, align 8
|
|
br label %_llgo_2
|
|
|
|
_llgo_2: ; preds = %_llgo_1, %_llgo_0
|
|
%3 = load ptr, ptr @"_llgo_struct$K-dZ9QotZfVPz2a0YdRa9vmZUuDXPTqZOlMShKEDJtk", align 8
|
|
%4 = icmp eq ptr %3, null
|
|
br i1 %4, label %_llgo_3, label %_llgo_4
|
|
|
|
_llgo_3: ; preds = %_llgo_2
|
|
%5 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i64 34)
|
|
%6 = 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 %5, i64 0, %"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, i1 false)
|
|
%7 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 56)
|
|
%8 = getelementptr %"github.com/goplus/llgo/runtime/abi.StructField", ptr %7, i64 0
|
|
store %"github.com/goplus/llgo/runtime/abi.StructField" %6, ptr %8, align 8
|
|
%9 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %7, 0
|
|
%10 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %9, i64 1, 1
|
|
%11 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %10, i64 1, 2
|
|
%12 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 48 }, i64 8, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %11)
|
|
store ptr %12, ptr @"_llgo_struct$K-dZ9QotZfVPz2a0YdRa9vmZUuDXPTqZOlMShKEDJtk", align 8
|
|
br label %_llgo_4
|
|
|
|
_llgo_4: ; preds = %_llgo_3, %_llgo_2
|
|
%13 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i64 34)
|
|
%14 = 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 %13, i64 0, %"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, i1 false)
|
|
%15 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 56)
|
|
%16 = getelementptr %"github.com/goplus/llgo/runtime/abi.StructField", ptr %15, i64 0
|
|
store %"github.com/goplus/llgo/runtime/abi.StructField" %14, ptr %16, align 8
|
|
%17 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %15, 0
|
|
%18 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %17, i64 1, 1
|
|
%19 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %18, i64 1, 2
|
|
%20 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 48 }, i64 8, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %19)
|
|
store ptr %20, ptr @"github.com/goplus/llgo/compiler/cl/_testdata/foo.struct$MYpsoM99ZwFY087IpUOkIw1zjBA_sgFXVodmn1m-G88", align 8
|
|
ret void
|
|
}
|
|
|
|
declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i64)
|
|
|
|
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")
|
|
|
|
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)
|
|
|
|
declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64)
|
|
|
|
declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String")
|
|
|
|
declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8)
|
|
|
|
attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) }
|