|
|
|
|
@@ -2,20 +2,17 @@
|
|
|
|
|
source_filename = "main"
|
|
|
|
|
|
|
|
|
|
%"github.com/goplus/llgo/internal/runtime.String" = type { ptr, i64 }
|
|
|
|
|
%"github.com/goplus/llgo/internal/runtime.eface" = type { ptr, ptr }
|
|
|
|
|
%"github.com/goplus/llgo/internal/runtime.Defer" = type { { ptr, ptr }, i64, ptr, i64 }
|
|
|
|
|
|
|
|
|
|
@"main.init$guard" = global ptr null
|
|
|
|
|
@0 = private unnamed_addr constant [6 x i8] c"error\00", align 1
|
|
|
|
|
@_llgo_string = linkonce global ptr null
|
|
|
|
|
@__llgo_argc = global ptr null
|
|
|
|
|
@__llgo_argv = global ptr null
|
|
|
|
|
@__llgo_defer = linkonce global ptr null
|
|
|
|
|
@0 = private unnamed_addr constant [6 x i8] c"hello\00", align 1
|
|
|
|
|
@1 = private unnamed_addr constant [6 x i8] c"hello\00", align 1
|
|
|
|
|
@2 = private unnamed_addr constant [6 x i8] c"hello\00", align 1
|
|
|
|
|
@3 = private unnamed_addr constant [4 x i8] c"bye\00", align 1
|
|
|
|
|
@4 = private unnamed_addr constant [6 x i8] c"world\00", align 1
|
|
|
|
|
@5 = private unnamed_addr constant [3 x i8] c"hi\00", align 1
|
|
|
|
|
@2 = private unnamed_addr constant [4 x i8] c"bye\00", align 1
|
|
|
|
|
@3 = private unnamed_addr constant [6 x i8] c"world\00", align 1
|
|
|
|
|
@4 = private unnamed_addr constant [3 x i8] c"hi\00", align 1
|
|
|
|
|
|
|
|
|
|
define i1 @main.f(%"github.com/goplus/llgo/internal/runtime.String" %0) {
|
|
|
|
|
_llgo_0:
|
|
|
|
|
@@ -24,27 +21,6 @@ _llgo_0:
|
|
|
|
|
ret i1 %2
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
define void @main.fail() {
|
|
|
|
|
_llgo_0:
|
|
|
|
|
%0 = alloca %"github.com/goplus/llgo/internal/runtime.String", align 8
|
|
|
|
|
%1 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %0, i32 0, i32 0
|
|
|
|
|
store ptr @0, ptr %1, align 8
|
|
|
|
|
%2 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %0, i32 0, i32 1
|
|
|
|
|
store i64 5, ptr %2, align 4
|
|
|
|
|
%3 = load %"github.com/goplus/llgo/internal/runtime.String", ptr %0, align 8
|
|
|
|
|
%4 = load ptr, ptr @_llgo_string, align 8
|
|
|
|
|
%5 = call ptr @"github.com/goplus/llgo/internal/runtime.AllocU"(i64 16)
|
|
|
|
|
store %"github.com/goplus/llgo/internal/runtime.String" %3, ptr %5, align 8
|
|
|
|
|
%6 = alloca %"github.com/goplus/llgo/internal/runtime.eface", align 8
|
|
|
|
|
%7 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.eface", ptr %6, i32 0, i32 0
|
|
|
|
|
store ptr %4, ptr %7, align 8
|
|
|
|
|
%8 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.eface", ptr %6, i32 0, i32 1
|
|
|
|
|
store ptr %5, ptr %8, align 8
|
|
|
|
|
%9 = load %"github.com/goplus/llgo/internal/runtime.eface", ptr %6, align 8
|
|
|
|
|
call void @"github.com/goplus/llgo/internal/runtime.TracePanic"(%"github.com/goplus/llgo/internal/runtime.eface" %9)
|
|
|
|
|
unreachable
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
define void @main.init() {
|
|
|
|
|
_llgo_0:
|
|
|
|
|
%0 = load i1, ptr @"main.init$guard", align 1
|
|
|
|
|
@@ -82,12 +58,12 @@ _llgo_0:
|
|
|
|
|
store i64 %12, ptr %9, align 4
|
|
|
|
|
%13 = alloca %"github.com/goplus/llgo/internal/runtime.String", align 8
|
|
|
|
|
%14 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %13, i32 0, i32 0
|
|
|
|
|
store ptr @1, ptr %14, align 8
|
|
|
|
|
store ptr @0, ptr %14, align 8
|
|
|
|
|
%15 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %13, i32 0, i32 1
|
|
|
|
|
store i64 5, ptr %15, align 4
|
|
|
|
|
%16 = load %"github.com/goplus/llgo/internal/runtime.String", ptr %13, align 8
|
|
|
|
|
%17 = call i1 @main.f(%"github.com/goplus/llgo/internal/runtime.String" %16)
|
|
|
|
|
br i1 %17, label %_llgo_2, label %_llgo_4
|
|
|
|
|
br i1 %17, label %_llgo_2, label %_llgo_3
|
|
|
|
|
|
|
|
|
|
_llgo_1: ; No predecessors!
|
|
|
|
|
ret i32 0
|
|
|
|
|
@@ -95,19 +71,16 @@ _llgo_1: ; No predecessors!
|
|
|
|
|
_llgo_2: ; preds = %_llgo_0
|
|
|
|
|
%18 = alloca %"github.com/goplus/llgo/internal/runtime.String", align 8
|
|
|
|
|
%19 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %18, i32 0, i32 0
|
|
|
|
|
store ptr @2, ptr %19, align 8
|
|
|
|
|
store ptr @1, ptr %19, align 8
|
|
|
|
|
%20 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %18, i32 0, i32 1
|
|
|
|
|
store i64 5, ptr %20, align 4
|
|
|
|
|
%21 = load %"github.com/goplus/llgo/internal/runtime.String", ptr %18, align 8
|
|
|
|
|
%22 = load i64, ptr %9, align 4
|
|
|
|
|
%23 = or i64 %22, 2
|
|
|
|
|
store i64 %23, ptr %9, align 4
|
|
|
|
|
br label %_llgo_3
|
|
|
|
|
|
|
|
|
|
_llgo_3: ; preds = %_llgo_4, %_llgo_2
|
|
|
|
|
%24 = alloca %"github.com/goplus/llgo/internal/runtime.String", align 8
|
|
|
|
|
%25 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %24, i32 0, i32 0
|
|
|
|
|
store ptr @3, ptr %25, align 8
|
|
|
|
|
store ptr @2, ptr %25, align 8
|
|
|
|
|
%26 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %24, i32 0, i32 1
|
|
|
|
|
store i64 3, ptr %26, align 4
|
|
|
|
|
%27 = load %"github.com/goplus/llgo/internal/runtime.String", ptr %24, align 8
|
|
|
|
|
@@ -115,36 +88,39 @@ _llgo_3: ; preds = %_llgo_4, %_llgo_2
|
|
|
|
|
%29 = or i64 %28, 4
|
|
|
|
|
store i64 %29, ptr %9, align 4
|
|
|
|
|
store i64 0, ptr %10, align 4
|
|
|
|
|
br label %_llgo_5
|
|
|
|
|
br label %_llgo_4
|
|
|
|
|
|
|
|
|
|
_llgo_4: ; preds = %_llgo_0
|
|
|
|
|
_llgo_3: ; preds = %_llgo_0
|
|
|
|
|
%30 = alloca %"github.com/goplus/llgo/internal/runtime.String", align 8
|
|
|
|
|
%31 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %30, i32 0, i32 0
|
|
|
|
|
store ptr @4, ptr %31, align 8
|
|
|
|
|
store ptr @3, ptr %31, align 8
|
|
|
|
|
%32 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %30, i32 0, i32 1
|
|
|
|
|
store i64 5, ptr %32, align 4
|
|
|
|
|
%33 = load %"github.com/goplus/llgo/internal/runtime.String", ptr %30, align 8
|
|
|
|
|
%34 = load i64, ptr %9, align 4
|
|
|
|
|
%35 = or i64 %34, 8
|
|
|
|
|
store i64 %35, ptr %9, align 4
|
|
|
|
|
call void @main.fail()
|
|
|
|
|
br label %_llgo_3
|
|
|
|
|
store i64 1, ptr %10, align 4
|
|
|
|
|
br label %_llgo_4
|
|
|
|
|
|
|
|
|
|
_llgo_5: ; preds = %_llgo_3
|
|
|
|
|
_llgo_4: ; preds = %_llgo_3, %_llgo_2
|
|
|
|
|
%36 = load i64, ptr %9, align 4
|
|
|
|
|
%37 = and i64 %36, 8
|
|
|
|
|
%38 = icmp ne i64 %37, 0
|
|
|
|
|
br i1 %38, label %_llgo_7, label %_llgo_8
|
|
|
|
|
|
|
|
|
|
_llgo_5: ; preds = %_llgo_14
|
|
|
|
|
ret i32 0
|
|
|
|
|
|
|
|
|
|
_llgo_6: ; preds = %_llgo_14
|
|
|
|
|
ret i32 0
|
|
|
|
|
|
|
|
|
|
_llgo_7: ; preds = %_llgo_5
|
|
|
|
|
_llgo_7: ; preds = %_llgo_4
|
|
|
|
|
call void @"github.com/goplus/llgo/internal/runtime.PrintString"(%"github.com/goplus/llgo/internal/runtime.String" %33)
|
|
|
|
|
call void @"github.com/goplus/llgo/internal/runtime.PrintByte"(i8 10)
|
|
|
|
|
br label %_llgo_8
|
|
|
|
|
|
|
|
|
|
_llgo_8: ; preds = %_llgo_7, %_llgo_5
|
|
|
|
|
_llgo_8: ; preds = %_llgo_7, %_llgo_4
|
|
|
|
|
%39 = and i64 %36, 4
|
|
|
|
|
%40 = icmp ne i64 %39, 0
|
|
|
|
|
br i1 %40, label %_llgo_9, label %_llgo_10
|
|
|
|
|
@@ -178,47 +154,18 @@ _llgo_14: ; preds = %_llgo_13, %_llgo_12
|
|
|
|
|
%46 = extractvalue %"github.com/goplus/llgo/internal/runtime.Defer" %45, 2
|
|
|
|
|
%47 = call i32 @pthread_setspecific(ptr %2, ptr %46)
|
|
|
|
|
%48 = load i64, ptr %10, align 4
|
|
|
|
|
switch i64 %48, label %_llgo_6 [
|
|
|
|
|
switch i64 %48, label %_llgo_5 [
|
|
|
|
|
i64 1, label %_llgo_6
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
define void @"main.init$after"() {
|
|
|
|
|
_llgo_0:
|
|
|
|
|
%0 = load ptr, ptr @_llgo_string, 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/internal/runtime.Basic"(i64 24)
|
|
|
|
|
store ptr %2, ptr @_llgo_string, align 8
|
|
|
|
|
br label %_llgo_2
|
|
|
|
|
|
|
|
|
|
_llgo_2: ; preds = %_llgo_1, %_llgo_0
|
|
|
|
|
%3 = load ptr, ptr @__llgo_defer, align 8
|
|
|
|
|
%4 = icmp eq ptr %3, null
|
|
|
|
|
br i1 %4, label %_llgo_3, label %_llgo_4
|
|
|
|
|
|
|
|
|
|
_llgo_3: ; preds = %_llgo_2
|
|
|
|
|
%5 = call i32 @pthread_key_create(ptr @__llgo_defer, ptr null)
|
|
|
|
|
br label %_llgo_4
|
|
|
|
|
|
|
|
|
|
_llgo_4: ; preds = %_llgo_3, %_llgo_2
|
|
|
|
|
ret void
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
declare ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64)
|
|
|
|
|
|
|
|
|
|
declare ptr @"github.com/goplus/llgo/internal/runtime.AllocU"(i64)
|
|
|
|
|
|
|
|
|
|
declare void @"github.com/goplus/llgo/internal/runtime.TracePanic"(%"github.com/goplus/llgo/internal/runtime.eface")
|
|
|
|
|
|
|
|
|
|
declare void @"github.com/goplus/llgo/internal/runtime.init"()
|
|
|
|
|
|
|
|
|
|
define void @"main.main$1"() {
|
|
|
|
|
_llgo_0:
|
|
|
|
|
%0 = alloca %"github.com/goplus/llgo/internal/runtime.String", align 8
|
|
|
|
|
%1 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %0, i32 0, i32 0
|
|
|
|
|
store ptr @5, ptr %1, align 8
|
|
|
|
|
store ptr @4, ptr %1, align 8
|
|
|
|
|
%2 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %0, i32 0, i32 1
|
|
|
|
|
store i64 2, ptr %2, align 4
|
|
|
|
|
%3 = load %"github.com/goplus/llgo/internal/runtime.String", ptr %0, align 8
|
|
|
|
|
@@ -235,4 +182,18 @@ declare void @"github.com/goplus/llgo/internal/runtime.PrintString"(%"github.com
|
|
|
|
|
|
|
|
|
|
declare void @"github.com/goplus/llgo/internal/runtime.PrintByte"(i8)
|
|
|
|
|
|
|
|
|
|
define void @"main.init$after"() {
|
|
|
|
|
_llgo_0:
|
|
|
|
|
%0 = load ptr, ptr @__llgo_defer, align 8
|
|
|
|
|
%1 = icmp eq ptr %0, null
|
|
|
|
|
br i1 %1, label %_llgo_1, label %_llgo_2
|
|
|
|
|
|
|
|
|
|
_llgo_1: ; preds = %_llgo_0
|
|
|
|
|
%2 = call i32 @pthread_key_create(ptr @__llgo_defer, ptr null)
|
|
|
|
|
br label %_llgo_2
|
|
|
|
|
|
|
|
|
|
_llgo_2: ; preds = %_llgo_1, %_llgo_0
|
|
|
|
|
ret void
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
declare i32 @pthread_key_create(ptr, ptr)
|
|
|
|
|
|