ssa: closure use specific struct field name { $f ftype, $data unsafe.pointer }
This commit is contained in:
@@ -59,9 +59,9 @@ source_filename = "main"
|
||||
@_llgo_main.T6 = linkonce global ptr null, align 8
|
||||
@19 = private unnamed_addr constant [2 x i8] c"T6", align 1
|
||||
@_llgo_Pointer = linkonce global ptr null, align 8
|
||||
@"main.struct$ShRx0rnZQIkym8zpNxljLHWZbDzaCdzDkVBTe78YZMw" = linkonce global ptr null, align 8
|
||||
@20 = private unnamed_addr constant [1 x i8] c"f", align 1
|
||||
@21 = private unnamed_addr constant [4 x i8] c"data", align 1
|
||||
@"main.struct$TWlEC03isGYe2Nyy2HYnOBsOYR1lIx43oIUpIyqvm4s" = linkonce global ptr null, align 8
|
||||
@20 = private unnamed_addr constant [2 x i8] c"$f", align 1
|
||||
@21 = private unnamed_addr constant [5 x i8] c"$data", align 1
|
||||
@"*_llgo_main.T6" = linkonce global ptr null, align 8
|
||||
@"_llgo_iface$jwmSdgh1zvY_TDIgLzCkvkbiyrdwl9N806DH0JGcyMI" = linkonce global ptr null, align 8
|
||||
@22 = private unnamed_addr constant [5 x i8] c"world", align 1
|
||||
@@ -337,7 +337,6 @@ _llgo_0:
|
||||
call void @main.invoke(%"github.com/goplus/llgo/internal/runtime.iface" %81)
|
||||
%82 = load %main.T6, ptr %11, align 8
|
||||
%83 = load ptr, ptr @_llgo_main.T6, align 8
|
||||
call void @"github.com/goplus/llgo/internal/runtime.SetClosure"(ptr %83)
|
||||
%84 = call ptr @"github.com/goplus/llgo/internal/runtime.AllocU"(i64 16)
|
||||
store %main.T6 %82, ptr %84, align 8
|
||||
%85 = load ptr, ptr @"_llgo_iface$uRUteI7wmSy7y7ODhGzk0FdDaxGKMhVSSu6HZEv9aa0", align 8
|
||||
@@ -935,9 +934,9 @@ _llgo_56: ; preds = %_llgo_55, %_llgo_54
|
||||
%231 = insertvalue %"github.com/goplus/llgo/internal/runtime.Slice" %230, i64 1, 1
|
||||
%232 = insertvalue %"github.com/goplus/llgo/internal/runtime.Slice" %231, i64 1, 2
|
||||
%233 = call ptr @"github.com/goplus/llgo/internal/runtime.Func"(%"github.com/goplus/llgo/internal/runtime.Slice" %227, %"github.com/goplus/llgo/internal/runtime.Slice" %232, i1 false)
|
||||
%234 = call %"github.com/goplus/llgo/internal/abi.StructField" @"github.com/goplus/llgo/internal/runtime.StructField"(%"github.com/goplus/llgo/internal/runtime.String" { ptr @20, i64 1 }, ptr %233, i64 0, %"github.com/goplus/llgo/internal/runtime.String" zeroinitializer, i1 false)
|
||||
%234 = call %"github.com/goplus/llgo/internal/abi.StructField" @"github.com/goplus/llgo/internal/runtime.StructField"(%"github.com/goplus/llgo/internal/runtime.String" { ptr @20, i64 2 }, ptr %233, i64 0, %"github.com/goplus/llgo/internal/runtime.String" zeroinitializer, i1 false)
|
||||
%235 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 58)
|
||||
%236 = call %"github.com/goplus/llgo/internal/abi.StructField" @"github.com/goplus/llgo/internal/runtime.StructField"(%"github.com/goplus/llgo/internal/runtime.String" { ptr @21, i64 4 }, ptr %235, i64 8, %"github.com/goplus/llgo/internal/runtime.String" zeroinitializer, i1 false)
|
||||
%236 = call %"github.com/goplus/llgo/internal/abi.StructField" @"github.com/goplus/llgo/internal/runtime.StructField"(%"github.com/goplus/llgo/internal/runtime.String" { ptr @21, i64 5 }, ptr %235, i64 8, %"github.com/goplus/llgo/internal/runtime.String" zeroinitializer, i1 false)
|
||||
%237 = call ptr @"github.com/goplus/llgo/internal/runtime.AllocU"(i64 112)
|
||||
%238 = getelementptr %"github.com/goplus/llgo/internal/abi.StructField", ptr %237, i64 0
|
||||
store %"github.com/goplus/llgo/internal/abi.StructField" %234, ptr %238, align 8
|
||||
@@ -947,8 +946,8 @@ _llgo_56: ; preds = %_llgo_55, %_llgo_54
|
||||
%241 = insertvalue %"github.com/goplus/llgo/internal/runtime.Slice" %240, i64 2, 1
|
||||
%242 = insertvalue %"github.com/goplus/llgo/internal/runtime.Slice" %241, i64 2, 2
|
||||
%243 = call ptr @"github.com/goplus/llgo/internal/runtime.Struct"(%"github.com/goplus/llgo/internal/runtime.String" { ptr @8, i64 4 }, i64 16, %"github.com/goplus/llgo/internal/runtime.Slice" %242)
|
||||
store ptr %243, ptr @"main.struct$ShRx0rnZQIkym8zpNxljLHWZbDzaCdzDkVBTe78YZMw", align 8
|
||||
%244 = load ptr, ptr @"main.struct$ShRx0rnZQIkym8zpNxljLHWZbDzaCdzDkVBTe78YZMw", align 8
|
||||
store ptr %243, ptr @"main.struct$TWlEC03isGYe2Nyy2HYnOBsOYR1lIx43oIUpIyqvm4s", align 8
|
||||
%244 = load ptr, ptr @"main.struct$TWlEC03isGYe2Nyy2HYnOBsOYR1lIx43oIUpIyqvm4s", align 8
|
||||
br i1 %217, label %_llgo_57, label %_llgo_58
|
||||
|
||||
_llgo_57: ; preds = %_llgo_56
|
||||
@@ -1075,8 +1074,6 @@ declare ptr @"github.com/goplus/llgo/internal/runtime.PointerTo"(ptr)
|
||||
|
||||
declare ptr @"github.com/goplus/llgo/internal/runtime.ArrayOf"(i64, ptr)
|
||||
|
||||
declare void @"github.com/goplus/llgo/internal/runtime.SetClosure"(ptr)
|
||||
|
||||
declare ptr @"github.com/goplus/llgo/internal/runtime.IfaceType"(%"github.com/goplus/llgo/internal/runtime.iface")
|
||||
|
||||
declare void @"github.com/goplus/llgo/internal/runtime.PrintIface"(%"github.com/goplus/llgo/internal/runtime.iface")
|
||||
|
||||
@@ -93,12 +93,11 @@ func callMethod() {
|
||||
println("method", fn.Kind(), fn.Type().String())
|
||||
r := fn.Call([]reflect.Value{reflect.ValueOf(100)})
|
||||
println(r[0].Int())
|
||||
//TODO type assert
|
||||
// ifn, ok := fn.Interface().(func(int) int)
|
||||
// if !ok {
|
||||
// panic("error")
|
||||
// }
|
||||
// ifn(1)
|
||||
ifn, ok := fn.Interface().(func(int) int)
|
||||
if !ok {
|
||||
panic("error")
|
||||
}
|
||||
ifn(1)
|
||||
v2 := reflect.ValueOf(fn.Interface())
|
||||
r2 := v2.Call([]reflect.Value{reflect.ValueOf(100)})
|
||||
println(r2[0].Int())
|
||||
@@ -111,12 +110,11 @@ func callIMethod() {
|
||||
println("imethod", fn.Kind(), fn.Type().String())
|
||||
r := fn.Call([]reflect.Value{reflect.ValueOf(100)})
|
||||
println(r[0].Int())
|
||||
//TODO type assert
|
||||
// ifn, ok := fn.Interface().(func(int) int)
|
||||
// if !ok {
|
||||
// panic("error")
|
||||
// }
|
||||
// ifn(1)
|
||||
ifn, ok := fn.Interface().(func(int) int)
|
||||
if !ok {
|
||||
panic("error")
|
||||
}
|
||||
ifn(1)
|
||||
v2 := reflect.ValueOf(fn.Interface())
|
||||
r2 := v2.Call([]reflect.Value{reflect.ValueOf(100)})
|
||||
println(r2[0].Int())
|
||||
|
||||
@@ -16,9 +16,9 @@ source_filename = "main"
|
||||
@_llgo_int = linkonce global ptr null, align 8
|
||||
@"_llgo_func$ekGNsrYBSzltfAjxbl6T8H6Yq8j16wzqS3nDj2xxGMU" = linkonce global ptr null, align 8
|
||||
@_llgo_Pointer = linkonce global ptr null, align 8
|
||||
@"main.struct$0F5MIVpixVnQ6IoIDrJI9hTk70oCWg1odzb2q0E2rJ0" = linkonce global ptr null, align 8
|
||||
@1 = private unnamed_addr constant [1 x i8] c"f", align 1
|
||||
@2 = private unnamed_addr constant [4 x i8] c"data", align 1
|
||||
@"main.struct$QIHBTaw1IFobr8yvWpq-2AJFm3xBNhdW_aNBicqUBGk" = linkonce global ptr null, align 8
|
||||
@1 = private unnamed_addr constant [2 x i8] c"$f", align 1
|
||||
@2 = private unnamed_addr constant [5 x i8] c"$data", align 1
|
||||
@3 = private unnamed_addr constant [4 x i8] c"main", align 1
|
||||
@4 = private unnamed_addr constant [7 x i8] c"closure", align 1
|
||||
@5 = private unnamed_addr constant [5 x i8] c"error", align 1
|
||||
@@ -38,7 +38,7 @@ source_filename = "main"
|
||||
@_llgo_any = linkonce global ptr null, align 8
|
||||
@"[]_llgo_any" = linkonce global ptr null, align 8
|
||||
@"_llgo_func$KK0iU4Wpi3BdRqssvycXqtgNe2Dq1riBlM61Rds1QsU" = linkonce global ptr null, align 8
|
||||
@"main.struct$zCLFE3aa581X7nuJztqlq4JjJDbHkfoMY0CexWOzH8A" = linkonce global ptr null, align 8
|
||||
@"main.struct$FjMjjQr3-2iTiWyZP1IIQFOz0hUCa0OS6pEm5uVV6Pk" = linkonce global ptr null, align 8
|
||||
@14 = private unnamed_addr constant [10 x i8] c"call.slice", align 1
|
||||
@15 = private unnamed_addr constant [21 x i8] c"type assertion failed", align 1
|
||||
@__llgo_argc = global i32 0, align 4
|
||||
@@ -80,8 +80,7 @@ _llgo_0:
|
||||
%4 = load ptr, ptr @_llgo_int, align 8
|
||||
%5 = load ptr, ptr @"_llgo_func$ekGNsrYBSzltfAjxbl6T8H6Yq8j16wzqS3nDj2xxGMU", align 8
|
||||
%6 = load ptr, ptr @_llgo_Pointer, align 8
|
||||
%7 = load ptr, ptr @"main.struct$0F5MIVpixVnQ6IoIDrJI9hTk70oCWg1odzb2q0E2rJ0", align 8
|
||||
call void @"github.com/goplus/llgo/internal/runtime.SetClosure"(ptr %7)
|
||||
%7 = load ptr, ptr @"main.struct$QIHBTaw1IFobr8yvWpq-2AJFm3xBNhdW_aNBicqUBGk", align 8
|
||||
%8 = call ptr @"github.com/goplus/llgo/internal/runtime.AllocU"(i64 16)
|
||||
store { ptr, ptr } %3, ptr %8, align 8
|
||||
%9 = insertvalue %"github.com/goplus/llgo/internal/runtime.eface" undef, ptr %7, 0
|
||||
@@ -126,7 +125,7 @@ _llgo_0:
|
||||
call void @"github.com/goplus/llgo/internal/runtime.PrintByte"(i8 10)
|
||||
%39 = call %"github.com/goplus/llgo/internal/runtime.eface" @reflect.Value.Interface(%reflect.Value %11)
|
||||
%40 = extractvalue %"github.com/goplus/llgo/internal/runtime.eface" %39, 0
|
||||
%41 = load ptr, ptr @"main.struct$0F5MIVpixVnQ6IoIDrJI9hTk70oCWg1odzb2q0E2rJ0", align 8
|
||||
%41 = load ptr, ptr @"main.struct$QIHBTaw1IFobr8yvWpq-2AJFm3xBNhdW_aNBicqUBGk", align 8
|
||||
%42 = icmp eq ptr %40, %41
|
||||
br i1 %42, label %_llgo_3, label %_llgo_4
|
||||
|
||||
@@ -176,8 +175,7 @@ _llgo_0:
|
||||
|
||||
define void @main.callFunc() {
|
||||
_llgo_0:
|
||||
%0 = load ptr, ptr @"main.struct$0F5MIVpixVnQ6IoIDrJI9hTk70oCWg1odzb2q0E2rJ0", align 8
|
||||
call void @"github.com/goplus/llgo/internal/runtime.SetClosure"(ptr %0)
|
||||
%0 = load ptr, ptr @"main.struct$QIHBTaw1IFobr8yvWpq-2AJFm3xBNhdW_aNBicqUBGk", align 8
|
||||
%1 = call ptr @"github.com/goplus/llgo/internal/runtime.AllocU"(i64 16)
|
||||
store { ptr, ptr } { ptr @"__llgo_stub.main.callFunc$1", ptr null }, ptr %1, align 8
|
||||
%2 = insertvalue %"github.com/goplus/llgo/internal/runtime.eface" undef, ptr %0, 0
|
||||
@@ -222,7 +220,7 @@ _llgo_0:
|
||||
call void @"github.com/goplus/llgo/internal/runtime.PrintByte"(i8 10)
|
||||
%32 = call %"github.com/goplus/llgo/internal/runtime.eface" @reflect.Value.Interface(%reflect.Value %4)
|
||||
%33 = extractvalue %"github.com/goplus/llgo/internal/runtime.eface" %32, 0
|
||||
%34 = load ptr, ptr @"main.struct$0F5MIVpixVnQ6IoIDrJI9hTk70oCWg1odzb2q0E2rJ0", align 8
|
||||
%34 = load ptr, ptr @"main.struct$QIHBTaw1IFobr8yvWpq-2AJFm3xBNhdW_aNBicqUBGk", align 8
|
||||
%35 = icmp eq ptr %33, %34
|
||||
br i1 %35, label %_llgo_3, label %_llgo_4
|
||||
|
||||
@@ -322,28 +320,63 @@ _llgo_0:
|
||||
call void @"github.com/goplus/llgo/internal/runtime.PrintInt"(i64 %41)
|
||||
call void @"github.com/goplus/llgo/internal/runtime.PrintByte"(i8 10)
|
||||
%42 = call %"github.com/goplus/llgo/internal/runtime.eface" @reflect.Value.Interface(%reflect.Value %14)
|
||||
%43 = call %reflect.Value @reflect.ValueOf(%"github.com/goplus/llgo/internal/runtime.eface" %42)
|
||||
%44 = call ptr @"github.com/goplus/llgo/internal/runtime.AllocZ"(i64 24)
|
||||
%45 = getelementptr inbounds %reflect.Value, ptr %44, i64 0
|
||||
%46 = load ptr, ptr @_llgo_int, align 8
|
||||
%47 = insertvalue %"github.com/goplus/llgo/internal/runtime.eface" undef, ptr %46, 0
|
||||
%48 = insertvalue %"github.com/goplus/llgo/internal/runtime.eface" %47, ptr inttoptr (i64 100 to ptr), 1
|
||||
%49 = call %reflect.Value @reflect.ValueOf(%"github.com/goplus/llgo/internal/runtime.eface" %48)
|
||||
store %reflect.Value %49, ptr %45, align 8
|
||||
%50 = insertvalue %"github.com/goplus/llgo/internal/runtime.Slice" undef, ptr %44, 0
|
||||
%51 = insertvalue %"github.com/goplus/llgo/internal/runtime.Slice" %50, i64 1, 1
|
||||
%52 = insertvalue %"github.com/goplus/llgo/internal/runtime.Slice" %51, i64 1, 2
|
||||
%53 = call %"github.com/goplus/llgo/internal/runtime.Slice" @reflect.Value.Call(%reflect.Value %43, %"github.com/goplus/llgo/internal/runtime.Slice" %52)
|
||||
%54 = extractvalue %"github.com/goplus/llgo/internal/runtime.Slice" %53, 0
|
||||
%55 = extractvalue %"github.com/goplus/llgo/internal/runtime.Slice" %53, 1
|
||||
%56 = icmp sge i64 0, %55
|
||||
call void @"github.com/goplus/llgo/internal/runtime.AssertIndexRange"(i1 %56)
|
||||
%57 = getelementptr inbounds %reflect.Value, ptr %54, i64 0
|
||||
%58 = load %reflect.Value, ptr %57, align 8
|
||||
%59 = call i64 @reflect.Value.Int(%reflect.Value %58)
|
||||
call void @"github.com/goplus/llgo/internal/runtime.PrintInt"(i64 %59)
|
||||
%43 = extractvalue %"github.com/goplus/llgo/internal/runtime.eface" %42, 0
|
||||
%44 = load ptr, ptr @"main.struct$QIHBTaw1IFobr8yvWpq-2AJFm3xBNhdW_aNBicqUBGk", align 8
|
||||
%45 = icmp eq ptr %43, %44
|
||||
br i1 %45, label %_llgo_3, label %_llgo_4
|
||||
|
||||
_llgo_1: ; preds = %_llgo_5
|
||||
%46 = load ptr, ptr @_llgo_string, align 8
|
||||
%47 = call ptr @"github.com/goplus/llgo/internal/runtime.AllocU"(i64 16)
|
||||
store %"github.com/goplus/llgo/internal/runtime.String" { ptr @5, i64 5 }, ptr %47, align 8
|
||||
%48 = insertvalue %"github.com/goplus/llgo/internal/runtime.eface" undef, ptr %46, 0
|
||||
%49 = insertvalue %"github.com/goplus/llgo/internal/runtime.eface" %48, ptr %47, 1
|
||||
call void @"github.com/goplus/llgo/internal/runtime.Panic"(%"github.com/goplus/llgo/internal/runtime.eface" %49)
|
||||
unreachable
|
||||
|
||||
_llgo_2: ; preds = %_llgo_5
|
||||
%50 = extractvalue { ptr, ptr } %76, 1
|
||||
%51 = extractvalue { ptr, ptr } %76, 0
|
||||
%52 = call i64 %51(ptr %50, i64 1)
|
||||
%53 = call %"github.com/goplus/llgo/internal/runtime.eface" @reflect.Value.Interface(%reflect.Value %14)
|
||||
%54 = call %reflect.Value @reflect.ValueOf(%"github.com/goplus/llgo/internal/runtime.eface" %53)
|
||||
%55 = call ptr @"github.com/goplus/llgo/internal/runtime.AllocZ"(i64 24)
|
||||
%56 = getelementptr inbounds %reflect.Value, ptr %55, i64 0
|
||||
%57 = load ptr, ptr @_llgo_int, align 8
|
||||
%58 = insertvalue %"github.com/goplus/llgo/internal/runtime.eface" undef, ptr %57, 0
|
||||
%59 = insertvalue %"github.com/goplus/llgo/internal/runtime.eface" %58, ptr inttoptr (i64 100 to ptr), 1
|
||||
%60 = call %reflect.Value @reflect.ValueOf(%"github.com/goplus/llgo/internal/runtime.eface" %59)
|
||||
store %reflect.Value %60, ptr %56, align 8
|
||||
%61 = insertvalue %"github.com/goplus/llgo/internal/runtime.Slice" undef, ptr %55, 0
|
||||
%62 = insertvalue %"github.com/goplus/llgo/internal/runtime.Slice" %61, i64 1, 1
|
||||
%63 = insertvalue %"github.com/goplus/llgo/internal/runtime.Slice" %62, i64 1, 2
|
||||
%64 = call %"github.com/goplus/llgo/internal/runtime.Slice" @reflect.Value.Call(%reflect.Value %54, %"github.com/goplus/llgo/internal/runtime.Slice" %63)
|
||||
%65 = extractvalue %"github.com/goplus/llgo/internal/runtime.Slice" %64, 0
|
||||
%66 = extractvalue %"github.com/goplus/llgo/internal/runtime.Slice" %64, 1
|
||||
%67 = icmp sge i64 0, %66
|
||||
call void @"github.com/goplus/llgo/internal/runtime.AssertIndexRange"(i1 %67)
|
||||
%68 = getelementptr inbounds %reflect.Value, ptr %65, i64 0
|
||||
%69 = load %reflect.Value, ptr %68, align 8
|
||||
%70 = call i64 @reflect.Value.Int(%reflect.Value %69)
|
||||
call void @"github.com/goplus/llgo/internal/runtime.PrintInt"(i64 %70)
|
||||
call void @"github.com/goplus/llgo/internal/runtime.PrintByte"(i8 10)
|
||||
ret void
|
||||
|
||||
_llgo_3: ; preds = %_llgo_0
|
||||
%71 = extractvalue %"github.com/goplus/llgo/internal/runtime.eface" %42, 1
|
||||
%72 = load { ptr, ptr }, ptr %71, align 8
|
||||
%73 = insertvalue { { ptr, ptr }, i1 } undef, { ptr, ptr } %72, 0
|
||||
%74 = insertvalue { { ptr, ptr }, i1 } %73, i1 true, 1
|
||||
br label %_llgo_5
|
||||
|
||||
_llgo_4: ; preds = %_llgo_0
|
||||
br label %_llgo_5
|
||||
|
||||
_llgo_5: ; preds = %_llgo_4, %_llgo_3
|
||||
%75 = phi { { ptr, ptr }, i1 } [ %74, %_llgo_3 ], [ zeroinitializer, %_llgo_4 ]
|
||||
%76 = extractvalue { { ptr, ptr }, i1 } %75, 0
|
||||
%77 = extractvalue { { ptr, ptr }, i1 } %75, 1
|
||||
br i1 %77, label %_llgo_2, label %_llgo_1
|
||||
}
|
||||
|
||||
define void @main.callMethod() {
|
||||
@@ -394,28 +427,63 @@ _llgo_0:
|
||||
call void @"github.com/goplus/llgo/internal/runtime.PrintInt"(i64 %33)
|
||||
call void @"github.com/goplus/llgo/internal/runtime.PrintByte"(i8 10)
|
||||
%34 = call %"github.com/goplus/llgo/internal/runtime.eface" @reflect.Value.Interface(%reflect.Value %6)
|
||||
%35 = call %reflect.Value @reflect.ValueOf(%"github.com/goplus/llgo/internal/runtime.eface" %34)
|
||||
%36 = call ptr @"github.com/goplus/llgo/internal/runtime.AllocZ"(i64 24)
|
||||
%37 = getelementptr inbounds %reflect.Value, ptr %36, i64 0
|
||||
%38 = load ptr, ptr @_llgo_int, align 8
|
||||
%39 = insertvalue %"github.com/goplus/llgo/internal/runtime.eface" undef, ptr %38, 0
|
||||
%40 = insertvalue %"github.com/goplus/llgo/internal/runtime.eface" %39, ptr inttoptr (i64 100 to ptr), 1
|
||||
%41 = call %reflect.Value @reflect.ValueOf(%"github.com/goplus/llgo/internal/runtime.eface" %40)
|
||||
store %reflect.Value %41, ptr %37, align 8
|
||||
%42 = insertvalue %"github.com/goplus/llgo/internal/runtime.Slice" undef, ptr %36, 0
|
||||
%43 = insertvalue %"github.com/goplus/llgo/internal/runtime.Slice" %42, i64 1, 1
|
||||
%44 = insertvalue %"github.com/goplus/llgo/internal/runtime.Slice" %43, i64 1, 2
|
||||
%45 = call %"github.com/goplus/llgo/internal/runtime.Slice" @reflect.Value.Call(%reflect.Value %35, %"github.com/goplus/llgo/internal/runtime.Slice" %44)
|
||||
%46 = extractvalue %"github.com/goplus/llgo/internal/runtime.Slice" %45, 0
|
||||
%47 = extractvalue %"github.com/goplus/llgo/internal/runtime.Slice" %45, 1
|
||||
%48 = icmp sge i64 0, %47
|
||||
call void @"github.com/goplus/llgo/internal/runtime.AssertIndexRange"(i1 %48)
|
||||
%49 = getelementptr inbounds %reflect.Value, ptr %46, i64 0
|
||||
%50 = load %reflect.Value, ptr %49, align 8
|
||||
%51 = call i64 @reflect.Value.Int(%reflect.Value %50)
|
||||
call void @"github.com/goplus/llgo/internal/runtime.PrintInt"(i64 %51)
|
||||
%35 = extractvalue %"github.com/goplus/llgo/internal/runtime.eface" %34, 0
|
||||
%36 = load ptr, ptr @"main.struct$QIHBTaw1IFobr8yvWpq-2AJFm3xBNhdW_aNBicqUBGk", align 8
|
||||
%37 = icmp eq ptr %35, %36
|
||||
br i1 %37, label %_llgo_3, label %_llgo_4
|
||||
|
||||
_llgo_1: ; preds = %_llgo_5
|
||||
%38 = load ptr, ptr @_llgo_string, align 8
|
||||
%39 = call ptr @"github.com/goplus/llgo/internal/runtime.AllocU"(i64 16)
|
||||
store %"github.com/goplus/llgo/internal/runtime.String" { ptr @5, i64 5 }, ptr %39, align 8
|
||||
%40 = insertvalue %"github.com/goplus/llgo/internal/runtime.eface" undef, ptr %38, 0
|
||||
%41 = insertvalue %"github.com/goplus/llgo/internal/runtime.eface" %40, ptr %39, 1
|
||||
call void @"github.com/goplus/llgo/internal/runtime.Panic"(%"github.com/goplus/llgo/internal/runtime.eface" %41)
|
||||
unreachable
|
||||
|
||||
_llgo_2: ; preds = %_llgo_5
|
||||
%42 = extractvalue { ptr, ptr } %68, 1
|
||||
%43 = extractvalue { ptr, ptr } %68, 0
|
||||
%44 = call i64 %43(ptr %42, i64 1)
|
||||
%45 = call %"github.com/goplus/llgo/internal/runtime.eface" @reflect.Value.Interface(%reflect.Value %6)
|
||||
%46 = call %reflect.Value @reflect.ValueOf(%"github.com/goplus/llgo/internal/runtime.eface" %45)
|
||||
%47 = call ptr @"github.com/goplus/llgo/internal/runtime.AllocZ"(i64 24)
|
||||
%48 = getelementptr inbounds %reflect.Value, ptr %47, i64 0
|
||||
%49 = load ptr, ptr @_llgo_int, align 8
|
||||
%50 = insertvalue %"github.com/goplus/llgo/internal/runtime.eface" undef, ptr %49, 0
|
||||
%51 = insertvalue %"github.com/goplus/llgo/internal/runtime.eface" %50, ptr inttoptr (i64 100 to ptr), 1
|
||||
%52 = call %reflect.Value @reflect.ValueOf(%"github.com/goplus/llgo/internal/runtime.eface" %51)
|
||||
store %reflect.Value %52, ptr %48, align 8
|
||||
%53 = insertvalue %"github.com/goplus/llgo/internal/runtime.Slice" undef, ptr %47, 0
|
||||
%54 = insertvalue %"github.com/goplus/llgo/internal/runtime.Slice" %53, i64 1, 1
|
||||
%55 = insertvalue %"github.com/goplus/llgo/internal/runtime.Slice" %54, i64 1, 2
|
||||
%56 = call %"github.com/goplus/llgo/internal/runtime.Slice" @reflect.Value.Call(%reflect.Value %46, %"github.com/goplus/llgo/internal/runtime.Slice" %55)
|
||||
%57 = extractvalue %"github.com/goplus/llgo/internal/runtime.Slice" %56, 0
|
||||
%58 = extractvalue %"github.com/goplus/llgo/internal/runtime.Slice" %56, 1
|
||||
%59 = icmp sge i64 0, %58
|
||||
call void @"github.com/goplus/llgo/internal/runtime.AssertIndexRange"(i1 %59)
|
||||
%60 = getelementptr inbounds %reflect.Value, ptr %57, i64 0
|
||||
%61 = load %reflect.Value, ptr %60, align 8
|
||||
%62 = call i64 @reflect.Value.Int(%reflect.Value %61)
|
||||
call void @"github.com/goplus/llgo/internal/runtime.PrintInt"(i64 %62)
|
||||
call void @"github.com/goplus/llgo/internal/runtime.PrintByte"(i8 10)
|
||||
ret void
|
||||
|
||||
_llgo_3: ; preds = %_llgo_0
|
||||
%63 = extractvalue %"github.com/goplus/llgo/internal/runtime.eface" %34, 1
|
||||
%64 = load { ptr, ptr }, ptr %63, align 8
|
||||
%65 = insertvalue { { ptr, ptr }, i1 } undef, { ptr, ptr } %64, 0
|
||||
%66 = insertvalue { { ptr, ptr }, i1 } %65, i1 true, 1
|
||||
br label %_llgo_5
|
||||
|
||||
_llgo_4: ; preds = %_llgo_0
|
||||
br label %_llgo_5
|
||||
|
||||
_llgo_5: ; preds = %_llgo_4, %_llgo_3
|
||||
%67 = phi { { ptr, ptr }, i1 } [ %66, %_llgo_3 ], [ zeroinitializer, %_llgo_4 ]
|
||||
%68 = extractvalue { { ptr, ptr }, i1 } %67, 0
|
||||
%69 = extractvalue { { ptr, ptr }, i1 } %67, 1
|
||||
br i1 %69, label %_llgo_2, label %_llgo_1
|
||||
}
|
||||
|
||||
define void @main.callSlice() {
|
||||
@@ -423,8 +491,7 @@ _llgo_0:
|
||||
%0 = load ptr, ptr @_llgo_any, align 8
|
||||
%1 = load ptr, ptr @"[]_llgo_any", align 8
|
||||
%2 = load ptr, ptr @"_llgo_func$KK0iU4Wpi3BdRqssvycXqtgNe2Dq1riBlM61Rds1QsU", align 8
|
||||
%3 = load ptr, ptr @"main.struct$zCLFE3aa581X7nuJztqlq4JjJDbHkfoMY0CexWOzH8A", align 8
|
||||
call void @"github.com/goplus/llgo/internal/runtime.SetClosure"(ptr %3)
|
||||
%3 = load ptr, ptr @"main.struct$FjMjjQr3-2iTiWyZP1IIQFOz0hUCa0OS6pEm5uVV6Pk", align 8
|
||||
%4 = call ptr @"github.com/goplus/llgo/internal/runtime.AllocU"(i64 16)
|
||||
store { ptr, ptr } { ptr @__llgo_stub.main.demo, ptr null }, ptr %4, align 8
|
||||
%5 = insertvalue %"github.com/goplus/llgo/internal/runtime.eface" undef, ptr %3, 0
|
||||
@@ -1073,9 +1140,9 @@ _llgo_6: ; preds = %_llgo_5, %_llgo_4
|
||||
%31 = insertvalue %"github.com/goplus/llgo/internal/runtime.Slice" %30, i64 1, 1
|
||||
%32 = insertvalue %"github.com/goplus/llgo/internal/runtime.Slice" %31, i64 1, 2
|
||||
%33 = call ptr @"github.com/goplus/llgo/internal/runtime.Func"(%"github.com/goplus/llgo/internal/runtime.Slice" %27, %"github.com/goplus/llgo/internal/runtime.Slice" %32, i1 false)
|
||||
%34 = call %"github.com/goplus/llgo/internal/abi.StructField" @"github.com/goplus/llgo/internal/runtime.StructField"(%"github.com/goplus/llgo/internal/runtime.String" { ptr @1, i64 1 }, ptr %33, i64 0, %"github.com/goplus/llgo/internal/runtime.String" zeroinitializer, i1 false)
|
||||
%34 = call %"github.com/goplus/llgo/internal/abi.StructField" @"github.com/goplus/llgo/internal/runtime.StructField"(%"github.com/goplus/llgo/internal/runtime.String" { ptr @1, i64 2 }, ptr %33, i64 0, %"github.com/goplus/llgo/internal/runtime.String" zeroinitializer, i1 false)
|
||||
%35 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 58)
|
||||
%36 = call %"github.com/goplus/llgo/internal/abi.StructField" @"github.com/goplus/llgo/internal/runtime.StructField"(%"github.com/goplus/llgo/internal/runtime.String" { ptr @2, i64 4 }, ptr %35, i64 8, %"github.com/goplus/llgo/internal/runtime.String" zeroinitializer, i1 false)
|
||||
%36 = call %"github.com/goplus/llgo/internal/abi.StructField" @"github.com/goplus/llgo/internal/runtime.StructField"(%"github.com/goplus/llgo/internal/runtime.String" { ptr @2, i64 5 }, ptr %35, i64 8, %"github.com/goplus/llgo/internal/runtime.String" zeroinitializer, i1 false)
|
||||
%37 = call ptr @"github.com/goplus/llgo/internal/runtime.AllocU"(i64 112)
|
||||
%38 = getelementptr %"github.com/goplus/llgo/internal/abi.StructField", ptr %37, i64 0
|
||||
store %"github.com/goplus/llgo/internal/abi.StructField" %34, ptr %38, align 8
|
||||
@@ -1085,7 +1152,7 @@ _llgo_6: ; preds = %_llgo_5, %_llgo_4
|
||||
%41 = insertvalue %"github.com/goplus/llgo/internal/runtime.Slice" %40, i64 2, 1
|
||||
%42 = insertvalue %"github.com/goplus/llgo/internal/runtime.Slice" %41, i64 2, 2
|
||||
%43 = call ptr @"github.com/goplus/llgo/internal/runtime.Struct"(%"github.com/goplus/llgo/internal/runtime.String" { ptr @3, i64 4 }, i64 16, %"github.com/goplus/llgo/internal/runtime.Slice" %42)
|
||||
store ptr %43, ptr @"main.struct$0F5MIVpixVnQ6IoIDrJI9hTk70oCWg1odzb2q0E2rJ0", align 8
|
||||
store ptr %43, ptr @"main.struct$QIHBTaw1IFobr8yvWpq-2AJFm3xBNhdW_aNBicqUBGk", align 8
|
||||
%44 = load ptr, ptr @_llgo_string, align 8
|
||||
%45 = icmp eq ptr %44, null
|
||||
br i1 %45, label %_llgo_7, label %_llgo_8
|
||||
@@ -1293,9 +1360,9 @@ _llgo_22: ; preds = %_llgo_21, %_llgo_20
|
||||
%162 = insertvalue %"github.com/goplus/llgo/internal/runtime.Slice" %161, i64 2, 1
|
||||
%163 = insertvalue %"github.com/goplus/llgo/internal/runtime.Slice" %162, i64 2, 2
|
||||
%164 = call ptr @"github.com/goplus/llgo/internal/runtime.Func"(%"github.com/goplus/llgo/internal/runtime.Slice" %157, %"github.com/goplus/llgo/internal/runtime.Slice" %163, i1 true)
|
||||
%165 = call %"github.com/goplus/llgo/internal/abi.StructField" @"github.com/goplus/llgo/internal/runtime.StructField"(%"github.com/goplus/llgo/internal/runtime.String" { ptr @1, i64 1 }, ptr %164, i64 0, %"github.com/goplus/llgo/internal/runtime.String" zeroinitializer, i1 false)
|
||||
%165 = call %"github.com/goplus/llgo/internal/abi.StructField" @"github.com/goplus/llgo/internal/runtime.StructField"(%"github.com/goplus/llgo/internal/runtime.String" { ptr @1, i64 2 }, ptr %164, i64 0, %"github.com/goplus/llgo/internal/runtime.String" zeroinitializer, i1 false)
|
||||
%166 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 58)
|
||||
%167 = call %"github.com/goplus/llgo/internal/abi.StructField" @"github.com/goplus/llgo/internal/runtime.StructField"(%"github.com/goplus/llgo/internal/runtime.String" { ptr @2, i64 4 }, ptr %166, i64 8, %"github.com/goplus/llgo/internal/runtime.String" zeroinitializer, i1 false)
|
||||
%167 = call %"github.com/goplus/llgo/internal/abi.StructField" @"github.com/goplus/llgo/internal/runtime.StructField"(%"github.com/goplus/llgo/internal/runtime.String" { ptr @2, i64 5 }, ptr %166, i64 8, %"github.com/goplus/llgo/internal/runtime.String" zeroinitializer, i1 false)
|
||||
%168 = call ptr @"github.com/goplus/llgo/internal/runtime.AllocU"(i64 112)
|
||||
%169 = getelementptr %"github.com/goplus/llgo/internal/abi.StructField", ptr %168, i64 0
|
||||
store %"github.com/goplus/llgo/internal/abi.StructField" %165, ptr %169, align 8
|
||||
@@ -1305,7 +1372,7 @@ _llgo_22: ; preds = %_llgo_21, %_llgo_20
|
||||
%172 = insertvalue %"github.com/goplus/llgo/internal/runtime.Slice" %171, i64 2, 1
|
||||
%173 = insertvalue %"github.com/goplus/llgo/internal/runtime.Slice" %172, i64 2, 2
|
||||
%174 = call ptr @"github.com/goplus/llgo/internal/runtime.Struct"(%"github.com/goplus/llgo/internal/runtime.String" { ptr @3, i64 4 }, i64 16, %"github.com/goplus/llgo/internal/runtime.Slice" %173)
|
||||
store ptr %174, ptr @"main.struct$zCLFE3aa581X7nuJztqlq4JjJDbHkfoMY0CexWOzH8A", align 8
|
||||
store ptr %174, ptr @"main.struct$FjMjjQr3-2iTiWyZP1IIQFOz0hUCa0OS6pEm5uVV6Pk", align 8
|
||||
%175 = load ptr, ptr @"map[_llgo_int]_llgo_string", align 8
|
||||
%176 = icmp eq ptr %175, null
|
||||
br i1 %176, label %_llgo_23, label %_llgo_24
|
||||
@@ -1356,8 +1423,6 @@ declare ptr @"github.com/goplus/llgo/internal/runtime.Struct"(%"github.com/goplu
|
||||
|
||||
declare %"github.com/goplus/llgo/internal/abi.StructField" @"github.com/goplus/llgo/internal/runtime.StructField"(%"github.com/goplus/llgo/internal/runtime.String", ptr, i64, %"github.com/goplus/llgo/internal/runtime.String", i1)
|
||||
|
||||
declare void @"github.com/goplus/llgo/internal/runtime.SetClosure"(ptr)
|
||||
|
||||
declare i64 @reflect.Value.Kind(%reflect.Value)
|
||||
|
||||
declare %"github.com/goplus/llgo/internal/runtime.iface" @reflect.Value.Type(%reflect.Value)
|
||||
|
||||
Reference in New Issue
Block a user