Skip to content

Commit

Permalink
internal/runtime: named(ptr) type preset for method type
Browse files Browse the repository at this point in the history
  • Loading branch information
visualfc committed Dec 20, 2024
1 parent 05334de commit d251232
Show file tree
Hide file tree
Showing 20 changed files with 943 additions and 969 deletions.
17 changes: 8 additions & 9 deletions cl/_testgo/cgocfiles/out.ll
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ source_filename = "main"
@__llgo_argc = global i32 0, align 4
@__llgo_argv = global ptr null, align 8
@_llgo_main._Ctype_int = linkonce global ptr null, align 8
@0 = private unnamed_addr constant [15 x i8] c"main._Ctype_int", align 1
@0 = private unnamed_addr constant [4 x i8] c"main", align 1
@1 = private unnamed_addr constant [10 x i8] c"_Ctype_int", align 1
@_llgo_int32 = linkonce global ptr null, align 8
@1 = private unnamed_addr constant [4 x i8] c"main", align 1
@2 = private unnamed_addr constant [10 x i8] c"_Ctype_int", align 1
@3 = private unnamed_addr constant [19 x i8] c"test_structs failed", align 1
@2 = private unnamed_addr constant [19 x i8] c"test_structs failed", align 1
@_llgo_string = linkonce global ptr null, align 8

define i32 @main._Cfunc_test_structs(ptr %0, ptr %1, ptr %2, ptr %3, ptr %4) {
Expand Down Expand Up @@ -120,7 +119,7 @@ _llgo_0:
_llgo_1: ; preds = %_llgo_0
%35 = load ptr, ptr @_llgo_string, align 8
%36 = call ptr @"github.com/goplus/llgo/internal/runtime.AllocU"(i64 16)
store %"github.com/goplus/llgo/internal/runtime.String" { ptr @3, i64 19 }, ptr %36, align 8
store %"github.com/goplus/llgo/internal/runtime.String" { ptr @2, i64 19 }, ptr %36, align 8
%37 = insertvalue %"github.com/goplus/llgo/internal/runtime.eface" undef, ptr %35, 0
%38 = insertvalue %"github.com/goplus/llgo/internal/runtime.eface" %37, ptr %36, 1
call void @"github.com/goplus/llgo/internal/runtime.Panic"(%"github.com/goplus/llgo/internal/runtime.eface" %38)
Expand All @@ -140,7 +139,7 @@ declare void @"github.com/goplus/llgo/internal/runtime.init"()

define void @"main.init$after"() {
_llgo_0:
%0 = call ptr @"github.com/goplus/llgo/internal/runtime.NewNamed"(%"github.com/goplus/llgo/internal/runtime.String" { ptr @0, i64 15 }, i64 5, i64 4, i64 0, i64 0)
%0 = call ptr @"github.com/goplus/llgo/internal/runtime.NewNamed"(%"github.com/goplus/llgo/internal/runtime.String" { ptr @0, i64 4 }, %"github.com/goplus/llgo/internal/runtime.String" { ptr @1, i64 10 }, i64 5, i64 4, i64 0, i64 0)
store ptr %0, ptr @_llgo_main._Ctype_int, align 8
%1 = load ptr, ptr @_llgo_int32, align 8
%2 = icmp eq ptr %1, null
Expand All @@ -153,7 +152,7 @@ _llgo_1: ; preds = %_llgo_0

_llgo_2: ; preds = %_llgo_1, %_llgo_0
%4 = load ptr, ptr @_llgo_int32, align 8
call void @"github.com/goplus/llgo/internal/runtime.InitNamed"(ptr %0, %"github.com/goplus/llgo/internal/runtime.String" { ptr @1, i64 4 }, %"github.com/goplus/llgo/internal/runtime.String" { ptr @2, i64 10 }, ptr %4, { ptr, i64, i64 } zeroinitializer, { ptr, i64, i64 } zeroinitializer)
call void @"github.com/goplus/llgo/internal/runtime.InitNamed"(ptr %0, ptr %4, { ptr, i64, i64 } zeroinitializer, { ptr, i64, i64 } zeroinitializer)
%5 = load ptr, ptr @_llgo_string, align 8
%6 = icmp eq ptr %5, null
br i1 %6, label %_llgo_3, label %_llgo_4
Expand All @@ -167,11 +166,11 @@ _llgo_4: ; preds = %_llgo_3, %_llgo_2
ret void
}

declare ptr @"github.com/goplus/llgo/internal/runtime.NewNamed"(%"github.com/goplus/llgo/internal/runtime.String", i64, i64, i64, i64)
declare ptr @"github.com/goplus/llgo/internal/runtime.NewNamed"(%"github.com/goplus/llgo/internal/runtime.String", %"github.com/goplus/llgo/internal/runtime.String", i64, i64, i64, i64)

declare ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64)

declare void @"github.com/goplus/llgo/internal/runtime.InitNamed"(ptr, %"github.com/goplus/llgo/internal/runtime.String", %"github.com/goplus/llgo/internal/runtime.String", ptr, %"github.com/goplus/llgo/internal/runtime.Slice", %"github.com/goplus/llgo/internal/runtime.Slice")
declare void @"github.com/goplus/llgo/internal/runtime.InitNamed"(ptr, ptr, %"github.com/goplus/llgo/internal/runtime.Slice", %"github.com/goplus/llgo/internal/runtime.Slice")

declare { i64, %"github.com/goplus/llgo/internal/runtime.iface" } @fmt.Println(%"github.com/goplus/llgo/internal/runtime.Slice")

Expand Down
34 changes: 16 additions & 18 deletions cl/_testgo/equal/out.ll
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,20 @@ source_filename = "main"
@"_llgo_struct$n1H8J_3prDN3firMwPxBLVTkE5hJ9Di-AqNvaC9jczw" = linkonce global ptr null, align 8
@3 = private unnamed_addr constant [4 x i8] c"main", align 1
@_llgo_main.T = linkonce global ptr null, align 8
@4 = private unnamed_addr constant [6 x i8] c"main.T", align 1
@4 = private unnamed_addr constant [1 x i8] c"T", align 1
@_llgo_any = linkonce global ptr null, align 8
@"_llgo_struct$5D_KhR3tDEp-wpx9caTiVZca43wS-XW6slE9Bsr8rsk" = linkonce global ptr null, align 8
@5 = private unnamed_addr constant [1 x i8] c"X", align 1
@6 = private unnamed_addr constant [1 x i8] c"Y", align 1
@7 = private unnamed_addr constant [1 x i8] c"Z", align 1
@8 = private unnamed_addr constant [1 x i8] c"V", align 1
@9 = private unnamed_addr constant [1 x i8] c"T", align 1
@_llgo_main.N = linkonce global ptr null, align 8
@10 = private unnamed_addr constant [6 x i8] c"main.N", align 1
@11 = private unnamed_addr constant [1 x i8] c"N", align 1
@9 = private unnamed_addr constant [1 x i8] c"N", align 1
@"map[_llgo_int]_llgo_string" = linkonce global ptr null, align 8
@12 = private unnamed_addr constant [7 x i8] c"topbits", align 1
@13 = private unnamed_addr constant [4 x i8] c"keys", align 1
@14 = private unnamed_addr constant [5 x i8] c"elems", align 1
@15 = private unnamed_addr constant [8 x i8] c"overflow", align 1
@10 = private unnamed_addr constant [7 x i8] c"topbits", align 1
@11 = private unnamed_addr constant [4 x i8] c"keys", align 1
@12 = private unnamed_addr constant [5 x i8] c"elems", align 1
@13 = private unnamed_addr constant [8 x i8] c"overflow", align 1
@__llgo_argc = global i32 0, align 4
@__llgo_argv = global ptr null, align 8

Expand Down Expand Up @@ -480,7 +478,7 @@ _llgo_5: ; preds = %_llgo_4
br label %_llgo_6

_llgo_6: ; preds = %_llgo_5, %_llgo_4
%13 = call ptr @"github.com/goplus/llgo/internal/runtime.NewNamed"(%"github.com/goplus/llgo/internal/runtime.String" { ptr @4, i64 6 }, i64 25, i64 48, i64 0, i64 0)
%13 = call ptr @"github.com/goplus/llgo/internal/runtime.NewNamed"(%"github.com/goplus/llgo/internal/runtime.String" { ptr @3, i64 4 }, %"github.com/goplus/llgo/internal/runtime.String" { ptr @4, i64 1 }, i64 25, i64 48, i64 0, i64 0)
%14 = load ptr, ptr @_llgo_main.T, align 8
%15 = icmp eq ptr %14, null
br i1 %15, label %_llgo_7, label %_llgo_8
Expand Down Expand Up @@ -543,11 +541,11 @@ _llgo_12: ; preds = %_llgo_11, %_llgo_10
br i1 %15, label %_llgo_13, label %_llgo_14

_llgo_13: ; preds = %_llgo_12
call void @"github.com/goplus/llgo/internal/runtime.InitNamed"(ptr %13, %"github.com/goplus/llgo/internal/runtime.String" { ptr @3, i64 4 }, %"github.com/goplus/llgo/internal/runtime.String" { ptr @9, i64 1 }, ptr %47, { ptr, i64, i64 } zeroinitializer, { ptr, i64, i64 } zeroinitializer)
call void @"github.com/goplus/llgo/internal/runtime.InitNamed"(ptr %13, ptr %47, { ptr, i64, i64 } zeroinitializer, { ptr, i64, i64 } zeroinitializer)
br label %_llgo_14

_llgo_14: ; preds = %_llgo_13, %_llgo_12
%48 = call ptr @"github.com/goplus/llgo/internal/runtime.NewNamed"(%"github.com/goplus/llgo/internal/runtime.String" { ptr @10, i64 6 }, i64 25, i64 0, i64 0, i64 0)
%48 = call ptr @"github.com/goplus/llgo/internal/runtime.NewNamed"(%"github.com/goplus/llgo/internal/runtime.String" { ptr @3, i64 4 }, %"github.com/goplus/llgo/internal/runtime.String" { ptr @9, i64 1 }, i64 25, i64 0, i64 0, i64 0)
%49 = load ptr, ptr @_llgo_main.N, align 8
%50 = icmp eq ptr %49, null
br i1 %50, label %_llgo_15, label %_llgo_16
Expand All @@ -561,7 +559,7 @@ _llgo_16: ; preds = %_llgo_15, %_llgo_14
br i1 %50, label %_llgo_17, label %_llgo_18

_llgo_17: ; preds = %_llgo_16
call void @"github.com/goplus/llgo/internal/runtime.InitNamed"(ptr %48, %"github.com/goplus/llgo/internal/runtime.String" { ptr @3, i64 4 }, %"github.com/goplus/llgo/internal/runtime.String" { ptr @11, i64 1 }, ptr %51, { ptr, i64, i64 } zeroinitializer, { ptr, i64, i64 } zeroinitializer)
call void @"github.com/goplus/llgo/internal/runtime.InitNamed"(ptr %48, ptr %51, { ptr, i64, i64 } zeroinitializer, { ptr, i64, i64 } zeroinitializer)
br label %_llgo_18

_llgo_18: ; preds = %_llgo_17, %_llgo_16
Expand All @@ -574,15 +572,15 @@ _llgo_19: ; preds = %_llgo_18
%55 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 24)
%56 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 40)
%57 = call ptr @"github.com/goplus/llgo/internal/runtime.ArrayOf"(i64 8, ptr %56)
%58 = call %"github.com/goplus/llgo/internal/abi.StructField" @"github.com/goplus/llgo/internal/runtime.StructField"(%"github.com/goplus/llgo/internal/runtime.String" { ptr @12, i64 7 }, ptr %57, i64 0, %"github.com/goplus/llgo/internal/runtime.String" zeroinitializer, i1 false)
%58 = call %"github.com/goplus/llgo/internal/abi.StructField" @"github.com/goplus/llgo/internal/runtime.StructField"(%"github.com/goplus/llgo/internal/runtime.String" { ptr @10, i64 7 }, ptr %57, i64 0, %"github.com/goplus/llgo/internal/runtime.String" zeroinitializer, i1 false)
%59 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 34)
%60 = call ptr @"github.com/goplus/llgo/internal/runtime.ArrayOf"(i64 8, ptr %59)
%61 = call %"github.com/goplus/llgo/internal/abi.StructField" @"github.com/goplus/llgo/internal/runtime.StructField"(%"github.com/goplus/llgo/internal/runtime.String" { ptr @13, i64 4 }, ptr %60, i64 8, %"github.com/goplus/llgo/internal/runtime.String" zeroinitializer, i1 false)
%61 = call %"github.com/goplus/llgo/internal/abi.StructField" @"github.com/goplus/llgo/internal/runtime.StructField"(%"github.com/goplus/llgo/internal/runtime.String" { ptr @11, i64 4 }, ptr %60, i64 8, %"github.com/goplus/llgo/internal/runtime.String" zeroinitializer, i1 false)
%62 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 24)
%63 = call ptr @"github.com/goplus/llgo/internal/runtime.ArrayOf"(i64 8, ptr %62)
%64 = call %"github.com/goplus/llgo/internal/abi.StructField" @"github.com/goplus/llgo/internal/runtime.StructField"(%"github.com/goplus/llgo/internal/runtime.String" { ptr @14, i64 5 }, ptr %63, i64 72, %"github.com/goplus/llgo/internal/runtime.String" zeroinitializer, i1 false)
%64 = call %"github.com/goplus/llgo/internal/abi.StructField" @"github.com/goplus/llgo/internal/runtime.StructField"(%"github.com/goplus/llgo/internal/runtime.String" { ptr @12, i64 5 }, ptr %63, i64 72, %"github.com/goplus/llgo/internal/runtime.String" zeroinitializer, i1 false)
%65 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 58)
%66 = call %"github.com/goplus/llgo/internal/abi.StructField" @"github.com/goplus/llgo/internal/runtime.StructField"(%"github.com/goplus/llgo/internal/runtime.String" { ptr @15, i64 8 }, ptr %65, i64 200, %"github.com/goplus/llgo/internal/runtime.String" zeroinitializer, i1 false)
%66 = call %"github.com/goplus/llgo/internal/abi.StructField" @"github.com/goplus/llgo/internal/runtime.StructField"(%"github.com/goplus/llgo/internal/runtime.String" { ptr @13, i64 8 }, ptr %65, i64 200, %"github.com/goplus/llgo/internal/runtime.String" zeroinitializer, i1 false)
%67 = call ptr @"github.com/goplus/llgo/internal/runtime.AllocU"(i64 224)
%68 = getelementptr %"github.com/goplus/llgo/internal/abi.StructField", ptr %67, i64 0
store %"github.com/goplus/llgo/internal/abi.StructField" %58, ptr %68, align 8
Expand Down Expand Up @@ -630,11 +628,11 @@ 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 ptr @"github.com/goplus/llgo/internal/runtime.NewNamed"(%"github.com/goplus/llgo/internal/runtime.String", i64, i64, i64, i64)
declare ptr @"github.com/goplus/llgo/internal/runtime.NewNamed"(%"github.com/goplus/llgo/internal/runtime.String", %"github.com/goplus/llgo/internal/runtime.String", i64, i64, i64, i64)

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")

declare void @"github.com/goplus/llgo/internal/runtime.InitNamed"(ptr, %"github.com/goplus/llgo/internal/runtime.String", %"github.com/goplus/llgo/internal/runtime.String", ptr, %"github.com/goplus/llgo/internal/runtime.Slice", %"github.com/goplus/llgo/internal/runtime.Slice")
declare void @"github.com/goplus/llgo/internal/runtime.InitNamed"(ptr, ptr, %"github.com/goplus/llgo/internal/runtime.Slice", %"github.com/goplus/llgo/internal/runtime.Slice")

declare ptr @"github.com/goplus/llgo/internal/runtime.NewChan"(i64, i64)

Expand Down
Loading

0 comments on commit d251232

Please sign in to comment.