2024-05-27 11:18:43 +08:00
|
|
|
; ModuleID = 'main'
|
|
|
|
|
source_filename = "main"
|
|
|
|
|
|
|
|
|
|
%"github.com/goplus/llgo/internal/runtime.iface" = type { ptr, ptr }
|
|
|
|
|
%"github.com/goplus/llgo/internal/runtime.String" = type { ptr, i64 }
|
|
|
|
|
%main.errorString = type { %"github.com/goplus/llgo/internal/runtime.String" }
|
2024-05-27 14:32:23 +08:00
|
|
|
%"github.com/goplus/llgo/internal/runtime.Slice" = type { ptr, i64, i64 }
|
2024-05-31 08:12:27 +08:00
|
|
|
%"github.com/goplus/llgo/internal/abi.Imethod" = type { %"github.com/goplus/llgo/internal/runtime.String", ptr }
|
2024-05-27 11:18:43 +08:00
|
|
|
|
2024-06-14 09:57:23 +08:00
|
|
|
@"main.init$guard" = global i1 false, align 1
|
|
|
|
|
@"*_llgo_main.errorString" = global ptr null, align 8
|
2024-06-23 06:51:09 +08:00
|
|
|
@"_llgo_iface$Fh8eUJ-Gw4e6TYuajcFIOSCuqSPKAt5nS4ow7xeGXEU" = linkonce global ptr null, align 8
|
|
|
|
|
@"_llgo_func$zNDVRsWTIpUPKouNUS805RGX--IV9qVK8B31IZbg5to" = linkonce global ptr null, align 8
|
2024-06-14 09:57:23 +08:00
|
|
|
@_llgo_string = linkonce global ptr null, align 8
|
2024-06-23 06:51:09 +08:00
|
|
|
@0 = private unnamed_addr constant [5 x i8] c"Error", align 1
|
2024-06-13 09:40:41 +08:00
|
|
|
@1 = private unnamed_addr constant [4 x i8] c"main", align 1
|
2024-06-14 09:57:23 +08:00
|
|
|
@__llgo_argc = global i32 0, align 4
|
|
|
|
|
@__llgo_argv = global ptr null, align 8
|
2024-06-23 06:51:09 +08:00
|
|
|
@2 = private unnamed_addr constant [8 x i8] c"an error", align 1
|
2024-05-27 11:18:43 +08:00
|
|
|
|
|
|
|
|
define %"github.com/goplus/llgo/internal/runtime.iface" @main.New(%"github.com/goplus/llgo/internal/runtime.String" %0) {
|
|
|
|
|
_llgo_0:
|
|
|
|
|
%1 = call ptr @"github.com/goplus/llgo/internal/runtime.AllocZ"(i64 16)
|
|
|
|
|
%2 = getelementptr inbounds %main.errorString, ptr %1, i32 0, i32 0
|
|
|
|
|
store %"github.com/goplus/llgo/internal/runtime.String" %0, ptr %2, align 8
|
2024-05-27 12:00:01 +08:00
|
|
|
%3 = load ptr, ptr @"*_llgo_main.errorString", align 8
|
2024-05-27 11:18:43 +08:00
|
|
|
%4 = load ptr, ptr @"_llgo_iface$Fh8eUJ-Gw4e6TYuajcFIOSCuqSPKAt5nS4ow7xeGXEU", align 8
|
|
|
|
|
%5 = call ptr @"github.com/goplus/llgo/internal/runtime.NewItab"(ptr %4, ptr %3)
|
|
|
|
|
%6 = alloca %"github.com/goplus/llgo/internal/runtime.iface", align 8
|
|
|
|
|
%7 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.iface", ptr %6, i32 0, i32 0
|
|
|
|
|
store ptr %5, ptr %7, align 8
|
|
|
|
|
%8 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.iface", ptr %6, i32 0, i32 1
|
|
|
|
|
store ptr %1, ptr %8, align 8
|
|
|
|
|
%9 = load %"github.com/goplus/llgo/internal/runtime.iface", ptr %6, align 8
|
|
|
|
|
ret %"github.com/goplus/llgo/internal/runtime.iface" %9
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-29 09:36:53 +08:00
|
|
|
define %"github.com/goplus/llgo/internal/runtime.String" @"main.(*errorString).Error"(ptr %0) {
|
2024-05-27 11:18:43 +08:00
|
|
|
_llgo_0:
|
|
|
|
|
%1 = getelementptr inbounds %main.errorString, ptr %0, i32 0, i32 0
|
|
|
|
|
%2 = load %"github.com/goplus/llgo/internal/runtime.String", ptr %1, align 8
|
|
|
|
|
ret %"github.com/goplus/llgo/internal/runtime.String" %2
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
define void @main.init() {
|
|
|
|
|
_llgo_0:
|
|
|
|
|
%0 = load i1, ptr @"main.init$guard", align 1
|
|
|
|
|
br i1 %0, label %_llgo_2, label %_llgo_1
|
|
|
|
|
|
|
|
|
|
_llgo_1: ; preds = %_llgo_0
|
|
|
|
|
store i1 true, ptr @"main.init$guard", align 1
|
2024-06-03 01:06:01 +08:00
|
|
|
call void @"main.init$after"()
|
2024-05-27 11:18:43 +08:00
|
|
|
br label %_llgo_2
|
|
|
|
|
|
|
|
|
|
_llgo_2: ; preds = %_llgo_1, %_llgo_0
|
|
|
|
|
ret void
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
define i32 @main(i32 %0, ptr %1) {
|
|
|
|
|
_llgo_0:
|
|
|
|
|
store i32 %0, ptr @__llgo_argc, align 4
|
|
|
|
|
store ptr %1, ptr @__llgo_argv, align 8
|
|
|
|
|
call void @"github.com/goplus/llgo/internal/runtime.init"()
|
|
|
|
|
call void @main.init()
|
|
|
|
|
%2 = alloca %"github.com/goplus/llgo/internal/runtime.String", align 8
|
|
|
|
|
%3 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %2, i32 0, i32 0
|
2024-06-23 06:51:09 +08:00
|
|
|
store ptr @2, ptr %3, align 8
|
2024-05-27 11:18:43 +08:00
|
|
|
%4 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %2, i32 0, i32 1
|
2024-05-27 15:52:35 +08:00
|
|
|
store i64 8, ptr %4, align 4
|
2024-05-27 11:18:43 +08:00
|
|
|
%5 = load %"github.com/goplus/llgo/internal/runtime.String", ptr %2, align 8
|
2024-05-27 15:52:35 +08:00
|
|
|
%6 = call %"github.com/goplus/llgo/internal/runtime.iface" @main.New(%"github.com/goplus/llgo/internal/runtime.String" %5)
|
|
|
|
|
call void @"github.com/goplus/llgo/internal/runtime.PrintIface"(%"github.com/goplus/llgo/internal/runtime.iface" %6)
|
2024-05-27 14:32:23 +08:00
|
|
|
call void @"github.com/goplus/llgo/internal/runtime.PrintByte"(i8 10)
|
2024-06-03 16:03:05 +08:00
|
|
|
%7 = call ptr @"github.com/goplus/llgo/internal/runtime.IfacePtrData"(%"github.com/goplus/llgo/internal/runtime.iface" %6)
|
|
|
|
|
%8 = extractvalue %"github.com/goplus/llgo/internal/runtime.iface" %6, 0
|
|
|
|
|
%9 = getelementptr ptr, ptr %8, i64 3
|
|
|
|
|
%10 = load ptr, ptr %9, align 8
|
2024-05-27 15:52:35 +08:00
|
|
|
%11 = alloca { ptr, ptr }, align 8
|
|
|
|
|
%12 = getelementptr inbounds { ptr, ptr }, ptr %11, i32 0, i32 0
|
2024-06-03 16:03:05 +08:00
|
|
|
store ptr %10, ptr %12, align 8
|
2024-05-27 15:52:35 +08:00
|
|
|
%13 = getelementptr inbounds { ptr, ptr }, ptr %11, i32 0, i32 1
|
2024-06-03 16:03:05 +08:00
|
|
|
store ptr %7, ptr %13, align 8
|
2024-05-27 15:52:35 +08:00
|
|
|
%14 = load { ptr, ptr }, ptr %11, align 8
|
2024-05-31 08:12:27 +08:00
|
|
|
%15 = extractvalue { ptr, ptr } %14, 1
|
|
|
|
|
%16 = extractvalue { ptr, ptr } %14, 0
|
|
|
|
|
%17 = call %"github.com/goplus/llgo/internal/runtime.String" %16(ptr %15)
|
|
|
|
|
call void @"github.com/goplus/llgo/internal/runtime.PrintString"(%"github.com/goplus/llgo/internal/runtime.String" %17)
|
2024-05-27 11:18:43 +08:00
|
|
|
call void @"github.com/goplus/llgo/internal/runtime.PrintByte"(i8 10)
|
|
|
|
|
ret i32 0
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
declare ptr @"github.com/goplus/llgo/internal/runtime.AllocZ"(i64)
|
|
|
|
|
|
2024-06-03 01:06:01 +08:00
|
|
|
define void @"main.init$after"() {
|
2024-05-27 14:32:23 +08:00
|
|
|
_llgo_0:
|
2024-05-31 08:12:27 +08:00
|
|
|
%0 = call ptr @"github.com/goplus/llgo/internal/runtime.NewNamed"(i64 25, i64 0, i64 1)
|
2024-06-23 06:51:09 +08:00
|
|
|
%1 = call ptr @"github.com/goplus/llgo/internal/runtime.PointerTo"(ptr %0)
|
|
|
|
|
store ptr %1, ptr @"*_llgo_main.errorString", align 8
|
|
|
|
|
%2 = load ptr, ptr @_llgo_string, align 8
|
|
|
|
|
%3 = icmp eq ptr %2, null
|
|
|
|
|
br i1 %3, label %_llgo_1, label %_llgo_2
|
2024-05-27 14:32:23 +08:00
|
|
|
|
|
|
|
|
_llgo_1: ; preds = %_llgo_0
|
2024-06-23 06:51:09 +08:00
|
|
|
%4 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 24)
|
|
|
|
|
store ptr %4, ptr @_llgo_string, align 8
|
2024-05-27 14:32:23 +08:00
|
|
|
br label %_llgo_2
|
|
|
|
|
|
|
|
|
|
_llgo_2: ; preds = %_llgo_1, %_llgo_0
|
2024-06-23 06:51:09 +08:00
|
|
|
%5 = load ptr, ptr @_llgo_string, align 8
|
|
|
|
|
%6 = load ptr, ptr @"_llgo_func$zNDVRsWTIpUPKouNUS805RGX--IV9qVK8B31IZbg5to", align 8
|
|
|
|
|
%7 = icmp eq ptr %6, null
|
|
|
|
|
br i1 %7, label %_llgo_3, label %_llgo_4
|
2024-05-31 08:12:27 +08:00
|
|
|
|
|
|
|
|
_llgo_3: ; preds = %_llgo_2
|
2024-06-23 06:51:09 +08:00
|
|
|
%8 = call ptr @"github.com/goplus/llgo/internal/runtime.AllocU"(i64 0)
|
|
|
|
|
%9 = alloca %"github.com/goplus/llgo/internal/runtime.Slice", align 8
|
|
|
|
|
%10 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.Slice", ptr %9, i32 0, i32 0
|
|
|
|
|
store ptr %8, ptr %10, align 8
|
|
|
|
|
%11 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.Slice", ptr %9, i32 0, i32 1
|
|
|
|
|
store i64 0, ptr %11, align 4
|
|
|
|
|
%12 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.Slice", ptr %9, i32 0, i32 2
|
|
|
|
|
store i64 0, ptr %12, align 4
|
|
|
|
|
%13 = load %"github.com/goplus/llgo/internal/runtime.Slice", ptr %9, align 8
|
|
|
|
|
%14 = call ptr @"github.com/goplus/llgo/internal/runtime.AllocU"(i64 8)
|
|
|
|
|
%15 = getelementptr ptr, ptr %14, i64 0
|
|
|
|
|
store ptr %5, ptr %15, align 8
|
|
|
|
|
%16 = alloca %"github.com/goplus/llgo/internal/runtime.Slice", align 8
|
|
|
|
|
%17 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.Slice", ptr %16, i32 0, i32 0
|
|
|
|
|
store ptr %14, ptr %17, align 8
|
|
|
|
|
%18 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.Slice", ptr %16, i32 0, i32 1
|
|
|
|
|
store i64 1, ptr %18, align 4
|
|
|
|
|
%19 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.Slice", ptr %16, i32 0, i32 2
|
|
|
|
|
store i64 1, ptr %19, align 4
|
|
|
|
|
%20 = load %"github.com/goplus/llgo/internal/runtime.Slice", ptr %16, align 8
|
|
|
|
|
%21 = call ptr @"github.com/goplus/llgo/internal/runtime.Func"(%"github.com/goplus/llgo/internal/runtime.Slice" %13, %"github.com/goplus/llgo/internal/runtime.Slice" %20, i1 false)
|
|
|
|
|
store ptr %21, ptr @"_llgo_func$zNDVRsWTIpUPKouNUS805RGX--IV9qVK8B31IZbg5to", align 8
|
2024-05-31 08:12:27 +08:00
|
|
|
br label %_llgo_4
|
|
|
|
|
|
|
|
|
|
_llgo_4: ; preds = %_llgo_3, %_llgo_2
|
2024-06-23 06:51:09 +08:00
|
|
|
%22 = load ptr, ptr @"_llgo_func$zNDVRsWTIpUPKouNUS805RGX--IV9qVK8B31IZbg5to", align 8
|
|
|
|
|
%23 = load ptr, ptr @"_llgo_iface$Fh8eUJ-Gw4e6TYuajcFIOSCuqSPKAt5nS4ow7xeGXEU", align 8
|
|
|
|
|
%24 = icmp eq ptr %23, null
|
|
|
|
|
br i1 %24, label %_llgo_5, label %_llgo_6
|
2024-05-31 08:12:27 +08:00
|
|
|
|
|
|
|
|
_llgo_5: ; preds = %_llgo_4
|
2024-06-23 06:51:09 +08:00
|
|
|
%25 = alloca %"github.com/goplus/llgo/internal/runtime.String", align 8
|
|
|
|
|
%26 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %25, i32 0, i32 0
|
|
|
|
|
store ptr @0, ptr %26, align 8
|
|
|
|
|
%27 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %25, i32 0, i32 1
|
|
|
|
|
store i64 5, ptr %27, align 4
|
|
|
|
|
%28 = load %"github.com/goplus/llgo/internal/runtime.String", ptr %25, align 8
|
|
|
|
|
%29 = alloca %"github.com/goplus/llgo/internal/abi.Imethod", align 8
|
|
|
|
|
%30 = getelementptr inbounds %"github.com/goplus/llgo/internal/abi.Imethod", ptr %29, i32 0, i32 0
|
|
|
|
|
store %"github.com/goplus/llgo/internal/runtime.String" %28, ptr %30, align 8
|
|
|
|
|
%31 = getelementptr inbounds %"github.com/goplus/llgo/internal/abi.Imethod", ptr %29, i32 0, i32 1
|
|
|
|
|
store ptr %22, ptr %31, align 8
|
|
|
|
|
%32 = load %"github.com/goplus/llgo/internal/abi.Imethod", ptr %29, align 8
|
|
|
|
|
%33 = call ptr @"github.com/goplus/llgo/internal/runtime.AllocU"(i64 24)
|
|
|
|
|
%34 = getelementptr %"github.com/goplus/llgo/internal/abi.Imethod", ptr %33, i64 0
|
|
|
|
|
store %"github.com/goplus/llgo/internal/abi.Imethod" %32, ptr %34, align 8
|
|
|
|
|
%35 = alloca %"github.com/goplus/llgo/internal/runtime.Slice", align 8
|
|
|
|
|
%36 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.Slice", ptr %35, i32 0, i32 0
|
|
|
|
|
store ptr %33, ptr %36, align 8
|
|
|
|
|
%37 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.Slice", ptr %35, i32 0, i32 1
|
|
|
|
|
store i64 1, ptr %37, align 4
|
|
|
|
|
%38 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.Slice", ptr %35, i32 0, i32 2
|
|
|
|
|
store i64 1, ptr %38, align 4
|
|
|
|
|
%39 = load %"github.com/goplus/llgo/internal/runtime.Slice", ptr %35, align 8
|
|
|
|
|
%40 = alloca %"github.com/goplus/llgo/internal/runtime.String", align 8
|
|
|
|
|
%41 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %40, i32 0, i32 0
|
|
|
|
|
store ptr @1, ptr %41, align 8
|
|
|
|
|
%42 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %40, i32 0, i32 1
|
|
|
|
|
store i64 4, ptr %42, align 4
|
|
|
|
|
%43 = load %"github.com/goplus/llgo/internal/runtime.String", ptr %40, align 8
|
|
|
|
|
%44 = alloca %"github.com/goplus/llgo/internal/runtime.String", align 8
|
|
|
|
|
%45 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %44, i32 0, i32 0
|
|
|
|
|
store ptr null, ptr %45, align 8
|
|
|
|
|
%46 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %44, i32 0, i32 1
|
|
|
|
|
store i64 0, ptr %46, align 4
|
|
|
|
|
%47 = load %"github.com/goplus/llgo/internal/runtime.String", ptr %44, align 8
|
|
|
|
|
%48 = call ptr @"github.com/goplus/llgo/internal/runtime.Interface"(%"github.com/goplus/llgo/internal/runtime.String" %43, %"github.com/goplus/llgo/internal/runtime.String" %47, %"github.com/goplus/llgo/internal/runtime.Slice" %39)
|
|
|
|
|
store ptr %48, ptr @"_llgo_iface$Fh8eUJ-Gw4e6TYuajcFIOSCuqSPKAt5nS4ow7xeGXEU", align 8
|
2024-05-31 08:12:27 +08:00
|
|
|
br label %_llgo_6
|
|
|
|
|
|
|
|
|
|
_llgo_6: ; preds = %_llgo_5, %_llgo_4
|
2024-05-27 14:32:23 +08:00
|
|
|
ret void
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-23 06:51:09 +08:00
|
|
|
declare ptr @"github.com/goplus/llgo/internal/runtime.PointerTo"(ptr)
|
|
|
|
|
|
2024-05-31 08:12:27 +08:00
|
|
|
declare ptr @"github.com/goplus/llgo/internal/runtime.NewNamed"(i64, i64, i64)
|
2024-05-27 14:32:23 +08:00
|
|
|
|
2024-05-31 08:12:27 +08:00
|
|
|
declare ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64)
|
2024-05-27 14:32:23 +08:00
|
|
|
|
|
|
|
|
declare ptr @"github.com/goplus/llgo/internal/runtime.Func"(%"github.com/goplus/llgo/internal/runtime.Slice", %"github.com/goplus/llgo/internal/runtime.Slice", i1)
|
|
|
|
|
|
2024-06-23 06:51:09 +08:00
|
|
|
declare ptr @"github.com/goplus/llgo/internal/runtime.AllocU"(i64)
|
2024-05-27 14:32:23 +08:00
|
|
|
|
2024-05-31 08:12:27 +08:00
|
|
|
declare ptr @"github.com/goplus/llgo/internal/runtime.Interface"(%"github.com/goplus/llgo/internal/runtime.String", %"github.com/goplus/llgo/internal/runtime.String", %"github.com/goplus/llgo/internal/runtime.Slice")
|
2024-05-27 11:18:43 +08:00
|
|
|
|
2024-05-31 08:12:27 +08:00
|
|
|
declare ptr @"github.com/goplus/llgo/internal/runtime.NewItab"(ptr, ptr)
|
2024-05-27 11:18:43 +08:00
|
|
|
|
2024-05-31 08:12:27 +08:00
|
|
|
declare void @"github.com/goplus/llgo/internal/runtime.init"()
|
2024-05-27 11:18:43 +08:00
|
|
|
|
2024-05-31 08:12:27 +08:00
|
|
|
declare void @"github.com/goplus/llgo/internal/runtime.PrintIface"(%"github.com/goplus/llgo/internal/runtime.iface")
|
2024-05-27 11:18:43 +08:00
|
|
|
|
2024-05-31 08:12:27 +08:00
|
|
|
declare void @"github.com/goplus/llgo/internal/runtime.PrintByte"(i8)
|
|
|
|
|
|
2024-06-03 16:03:05 +08:00
|
|
|
declare ptr @"github.com/goplus/llgo/internal/runtime.IfacePtrData"(%"github.com/goplus/llgo/internal/runtime.iface")
|
2024-06-02 19:56:37 +08:00
|
|
|
|
2024-05-31 08:12:27 +08:00
|
|
|
declare void @"github.com/goplus/llgo/internal/runtime.PrintString"(%"github.com/goplus/llgo/internal/runtime.String")
|