abi.TypeName
This commit is contained in:
@@ -9,7 +9,7 @@ source_filename = "main"
|
|||||||
%"github.com/goplus/llgo/internal/abi.Imethod" = type { %"github.com/goplus/llgo/internal/runtime.String", ptr }
|
%"github.com/goplus/llgo/internal/abi.Imethod" = type { %"github.com/goplus/llgo/internal/runtime.String", ptr }
|
||||||
|
|
||||||
@"main.init$guard" = global ptr null
|
@"main.init$guard" = global ptr null
|
||||||
@"*main.errorString" = global ptr null
|
@"*_llgo_main.errorString" = global ptr null
|
||||||
@"_llgo_iface$Fh8eUJ-Gw4e6TYuajcFIOSCuqSPKAt5nS4ow7xeGXEU" = linkonce global ptr null
|
@"_llgo_iface$Fh8eUJ-Gw4e6TYuajcFIOSCuqSPKAt5nS4ow7xeGXEU" = linkonce global ptr null
|
||||||
@__llgo_argc = global ptr null
|
@__llgo_argc = global ptr null
|
||||||
@__llgo_argv = global ptr null
|
@__llgo_argv = global ptr null
|
||||||
@@ -28,7 +28,7 @@ _llgo_0:
|
|||||||
%1 = call ptr @"github.com/goplus/llgo/internal/runtime.AllocZ"(i64 16)
|
%1 = call ptr @"github.com/goplus/llgo/internal/runtime.AllocZ"(i64 16)
|
||||||
%2 = getelementptr inbounds %main.errorString, ptr %1, i32 0, i32 0
|
%2 = getelementptr inbounds %main.errorString, ptr %1, i32 0, i32 0
|
||||||
store %"github.com/goplus/llgo/internal/runtime.String" %0, ptr %2, align 8
|
store %"github.com/goplus/llgo/internal/runtime.String" %0, ptr %2, align 8
|
||||||
%3 = load ptr, ptr @"*main.errorString", align 8
|
%3 = load ptr, ptr @"*_llgo_main.errorString", align 8
|
||||||
%4 = load ptr, ptr @"_llgo_iface$Fh8eUJ-Gw4e6TYuajcFIOSCuqSPKAt5nS4ow7xeGXEU", align 8
|
%4 = load ptr, ptr @"_llgo_iface$Fh8eUJ-Gw4e6TYuajcFIOSCuqSPKAt5nS4ow7xeGXEU", align 8
|
||||||
%5 = call ptr @"github.com/goplus/llgo/internal/runtime.NewItab"(ptr %4, ptr %3)
|
%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
|
%6 = alloca %"github.com/goplus/llgo/internal/runtime.iface", align 8
|
||||||
@@ -154,7 +154,7 @@ _llgo_0:
|
|||||||
%29 = load %"github.com/goplus/llgo/internal/runtime.String", ptr %26, align 8
|
%29 = load %"github.com/goplus/llgo/internal/runtime.String", ptr %26, align 8
|
||||||
%30 = call ptr @"github.com/goplus/llgo/internal/runtime.Named"(%"github.com/goplus/llgo/internal/runtime.String" %25, %"github.com/goplus/llgo/internal/runtime.String" %29, ptr %21, { ptr, i64, i64 } zeroinitializer)
|
%30 = call ptr @"github.com/goplus/llgo/internal/runtime.Named"(%"github.com/goplus/llgo/internal/runtime.String" %25, %"github.com/goplus/llgo/internal/runtime.String" %29, ptr %21, { ptr, i64, i64 } zeroinitializer)
|
||||||
%31 = call ptr @"github.com/goplus/llgo/internal/runtime.PointerTo"(ptr %30)
|
%31 = call ptr @"github.com/goplus/llgo/internal/runtime.PointerTo"(ptr %30)
|
||||||
store ptr %31, ptr @"*main.errorString", align 8
|
store ptr %31, ptr @"*_llgo_main.errorString", align 8
|
||||||
%32 = load ptr, ptr @"_llgo_iface$Fh8eUJ-Gw4e6TYuajcFIOSCuqSPKAt5nS4ow7xeGXEU", align 8
|
%32 = load ptr, ptr @"_llgo_iface$Fh8eUJ-Gw4e6TYuajcFIOSCuqSPKAt5nS4ow7xeGXEU", align 8
|
||||||
%33 = icmp eq ptr %32, null
|
%33 = icmp eq ptr %32, null
|
||||||
br i1 %33, label %_llgo_1, label %_llgo_2
|
br i1 %33, label %_llgo_1, label %_llgo_2
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ source_filename = "main"
|
|||||||
%"github.com/goplus/llgo/internal/runtime.Slice" = type { ptr, i64, i64 }
|
%"github.com/goplus/llgo/internal/runtime.Slice" = type { ptr, i64, i64 }
|
||||||
|
|
||||||
@"main.init$guard" = global ptr null
|
@"main.init$guard" = global ptr null
|
||||||
@"github.com/goplus/llgo/cl/internal/foo.Foo" = linkonce global ptr null
|
@"_llgo_github.com/goplus/llgo/cl/internal/foo.Foo" = linkonce global ptr null
|
||||||
@main.bar = global ptr null
|
@_llgo_main.bar = global ptr null
|
||||||
@__llgo_argc = global ptr null
|
@__llgo_argc = global ptr null
|
||||||
@__llgo_argv = global ptr null
|
@__llgo_argv = global ptr null
|
||||||
@0 = private unnamed_addr constant [7 x i8] c"notOk:\00", align 1
|
@0 = private unnamed_addr constant [7 x i8] c"notOk:\00", align 1
|
||||||
@@ -33,7 +33,7 @@ source_filename = "main"
|
|||||||
define { %"github.com/goplus/llgo/cl/internal/foo.Foo", i1 } @main.Bar(%"github.com/goplus/llgo/internal/runtime.eface" %0) {
|
define { %"github.com/goplus/llgo/cl/internal/foo.Foo", i1 } @main.Bar(%"github.com/goplus/llgo/internal/runtime.eface" %0) {
|
||||||
_llgo_0:
|
_llgo_0:
|
||||||
%1 = extractvalue %"github.com/goplus/llgo/internal/runtime.eface" %0, 0
|
%1 = extractvalue %"github.com/goplus/llgo/internal/runtime.eface" %0, 0
|
||||||
%2 = load ptr, ptr @"github.com/goplus/llgo/cl/internal/foo.Foo", align 8
|
%2 = load ptr, ptr @"_llgo_github.com/goplus/llgo/cl/internal/foo.Foo", align 8
|
||||||
%3 = icmp eq ptr %1, %2
|
%3 = icmp eq ptr %1, %2
|
||||||
br i1 %3, label %_llgo_1, label %_llgo_2
|
br i1 %3, label %_llgo_1, label %_llgo_2
|
||||||
|
|
||||||
@@ -69,7 +69,7 @@ _llgo_3: ; preds = %_llgo_2, %_llgo_1
|
|||||||
define { %main.bar, i1 } @main.Foo(%"github.com/goplus/llgo/internal/runtime.eface" %0) {
|
define { %main.bar, i1 } @main.Foo(%"github.com/goplus/llgo/internal/runtime.eface" %0) {
|
||||||
_llgo_0:
|
_llgo_0:
|
||||||
%1 = extractvalue %"github.com/goplus/llgo/internal/runtime.eface" %0, 0
|
%1 = extractvalue %"github.com/goplus/llgo/internal/runtime.eface" %0, 0
|
||||||
%2 = load ptr, ptr @main.bar, align 8
|
%2 = load ptr, ptr @_llgo_main.bar, align 8
|
||||||
%3 = icmp eq ptr %1, %2
|
%3 = icmp eq ptr %1, %2
|
||||||
br i1 %3, label %_llgo_1, label %_llgo_2
|
br i1 %3, label %_llgo_1, label %_llgo_2
|
||||||
|
|
||||||
@@ -151,7 +151,7 @@ _llgo_0:
|
|||||||
call void @"github.com/goplus/llgo/internal/runtime.PrintByte"(i8 10)
|
call void @"github.com/goplus/llgo/internal/runtime.PrintByte"(i8 10)
|
||||||
%17 = alloca %"github.com/goplus/llgo/cl/internal/foo.Foo", align 8
|
%17 = alloca %"github.com/goplus/llgo/cl/internal/foo.Foo", align 8
|
||||||
%18 = call ptr @"github.com/goplus/llgo/internal/runtime.Zeroinit"(ptr %17, i64 16)
|
%18 = call ptr @"github.com/goplus/llgo/internal/runtime.Zeroinit"(ptr %17, i64 16)
|
||||||
%19 = load ptr, ptr @"github.com/goplus/llgo/cl/internal/foo.Foo", align 8
|
%19 = load ptr, ptr @"_llgo_github.com/goplus/llgo/cl/internal/foo.Foo", align 8
|
||||||
%20 = call ptr @"github.com/goplus/llgo/internal/runtime.AllocU"(i64 16)
|
%20 = call ptr @"github.com/goplus/llgo/internal/runtime.AllocU"(i64 16)
|
||||||
store %"github.com/goplus/llgo/cl/internal/foo.Foo" zeroinitializer, ptr %20, align 8
|
store %"github.com/goplus/llgo/cl/internal/foo.Foo" zeroinitializer, ptr %20, align 8
|
||||||
%21 = alloca %"github.com/goplus/llgo/internal/runtime.eface", align 8
|
%21 = alloca %"github.com/goplus/llgo/internal/runtime.eface", align 8
|
||||||
@@ -200,7 +200,7 @@ declare ptr @"(github.com/goplus/llgo/cl/internal/foo.Foo).Pb"(%"github.com/gopl
|
|||||||
|
|
||||||
define void @"main.init$abi"() {
|
define void @"main.init$abi"() {
|
||||||
_llgo_0:
|
_llgo_0:
|
||||||
%0 = load ptr, ptr @"github.com/goplus/llgo/cl/internal/foo.Foo", align 8
|
%0 = load ptr, ptr @"_llgo_github.com/goplus/llgo/cl/internal/foo.Foo", align 8
|
||||||
%1 = icmp eq ptr %0, null
|
%1 = icmp eq ptr %0, null
|
||||||
br i1 %1, label %_llgo_1, label %_llgo_2
|
br i1 %1, label %_llgo_1, label %_llgo_2
|
||||||
|
|
||||||
@@ -266,7 +266,7 @@ _llgo_1: ; preds = %_llgo_0
|
|||||||
store i64 42, ptr %41, align 4
|
store i64 42, ptr %41, align 4
|
||||||
%42 = load %"github.com/goplus/llgo/internal/runtime.String", ptr %39, align 8
|
%42 = load %"github.com/goplus/llgo/internal/runtime.String", ptr %39, align 8
|
||||||
%43 = call ptr @"github.com/goplus/llgo/internal/runtime.Named"(%"github.com/goplus/llgo/internal/runtime.String" %38, %"github.com/goplus/llgo/internal/runtime.String" %42, ptr %34, { ptr, i64, i64 } zeroinitializer)
|
%43 = call ptr @"github.com/goplus/llgo/internal/runtime.Named"(%"github.com/goplus/llgo/internal/runtime.String" %38, %"github.com/goplus/llgo/internal/runtime.String" %42, ptr %34, { ptr, i64, i64 } zeroinitializer)
|
||||||
store ptr %43, ptr @"github.com/goplus/llgo/cl/internal/foo.Foo", align 8
|
store ptr %43, ptr @"_llgo_github.com/goplus/llgo/cl/internal/foo.Foo", align 8
|
||||||
br label %_llgo_2
|
br label %_llgo_2
|
||||||
|
|
||||||
_llgo_2: ; preds = %_llgo_1, %_llgo_0
|
_llgo_2: ; preds = %_llgo_1, %_llgo_0
|
||||||
@@ -331,7 +331,7 @@ _llgo_2: ; preds = %_llgo_1, %_llgo_0
|
|||||||
store i64 8, ptr %83, align 4
|
store i64 8, ptr %83, align 4
|
||||||
%84 = load %"github.com/goplus/llgo/internal/runtime.String", ptr %81, align 8
|
%84 = load %"github.com/goplus/llgo/internal/runtime.String", ptr %81, align 8
|
||||||
%85 = call ptr @"github.com/goplus/llgo/internal/runtime.Named"(%"github.com/goplus/llgo/internal/runtime.String" %80, %"github.com/goplus/llgo/internal/runtime.String" %84, ptr %76, { ptr, i64, i64 } zeroinitializer)
|
%85 = call ptr @"github.com/goplus/llgo/internal/runtime.Named"(%"github.com/goplus/llgo/internal/runtime.String" %80, %"github.com/goplus/llgo/internal/runtime.String" %84, ptr %76, { ptr, i64, i64 } zeroinitializer)
|
||||||
store ptr %85, ptr @main.bar, align 8
|
store ptr %85, ptr @_llgo_main.bar, align 8
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ func (b *Builder) TypeName(t types.Type) (ret string, pub bool) {
|
|||||||
return b.FuncName(t), true
|
return b.FuncName(t), true
|
||||||
case *types.Named:
|
case *types.Named:
|
||||||
o := t.Obj()
|
o := t.Obj()
|
||||||
return TypeName(o), o.Exported()
|
return "_llgo_" + TypeName(o), o.Exported()
|
||||||
case *types.Interface:
|
case *types.Interface:
|
||||||
if t.Empty() {
|
if t.Empty() {
|
||||||
return "_llgo_any", true
|
return "_llgo_any", true
|
||||||
|
|||||||
Reference in New Issue
Block a user