Files
llgo/compiler/cl/_testdata/foo/out.ll

144 lines
8.6 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 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i64 34)
%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)
%5 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 56)
%6 = getelementptr %"github.com/goplus/llgo/runtime/abi.StructField", ptr %5, i64 0
store %"github.com/goplus/llgo/runtime/abi.StructField" %4, ptr %6, align 8
%7 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %5, 0
%8 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %7, i64 1, 1
%9 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %8, i64 1, 2
%10 = 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" %9)
store ptr %10, ptr @"_llgo_struct$K-dZ9QotZfVPz2a0YdRa9vmZUuDXPTqZOlMShKEDJtk", align 8
%11 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i64 34)
%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)
%13 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 56)
%14 = getelementptr %"github.com/goplus/llgo/runtime/abi.StructField", ptr %13, i64 0
store %"github.com/goplus/llgo/runtime/abi.StructField" %12, ptr %14, align 8
%15 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %13, 0
%16 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %15, i64 1, 1
%17 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %16, i64 1, 2
%18 = 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" %17)
store ptr %18, 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) }