Index: mark unreachable
This commit is contained in:
@@ -19,7 +19,7 @@ func Bar(v any) (ret foo.Foo, ok bool) {
|
||||
|
||||
func main() {
|
||||
ret, ok := Foo(nil)
|
||||
println(ret.pb, ret.f, ok)
|
||||
println(ret.pb, ret.f, "notOk:", !ok)
|
||||
ret2, ok2 := Bar(foo.Foo{})
|
||||
println(ret2.Pb(), ret2.F, ok2)
|
||||
}
|
||||
|
||||
@@ -14,19 +14,20 @@ source_filename = "main"
|
||||
@main.bar = global ptr null
|
||||
@__llgo_argc = global ptr null
|
||||
@__llgo_argv = global ptr null
|
||||
@0 = private unnamed_addr constant [3 x i8] c"pb\00", align 1
|
||||
@0 = private unnamed_addr constant [7 x i8] c"notOk:\00", align 1
|
||||
@1 = private unnamed_addr constant [3 x i8] c"pb\00", align 1
|
||||
@"*_llgo_byte" = linkonce global ptr null
|
||||
@1 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1
|
||||
@2 = private unnamed_addr constant [2 x i8] c"F\00", align 1
|
||||
@3 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1
|
||||
@4 = private unnamed_addr constant [5 x i8] c"main\00", align 1
|
||||
@5 = private unnamed_addr constant [43 x i8] c"github.com/goplus/llgo/cl/internal/foo.Foo\00", align 1
|
||||
@6 = private unnamed_addr constant [3 x i8] c"pb\00", align 1
|
||||
@7 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1
|
||||
@8 = private unnamed_addr constant [2 x i8] c"f\00", align 1
|
||||
@9 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1
|
||||
@10 = private unnamed_addr constant [5 x i8] c"main\00", align 1
|
||||
@11 = private unnamed_addr constant [9 x i8] c"main.bar\00", align 1
|
||||
@2 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1
|
||||
@3 = private unnamed_addr constant [2 x i8] c"F\00", align 1
|
||||
@4 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1
|
||||
@5 = private unnamed_addr constant [5 x i8] c"main\00", align 1
|
||||
@6 = private unnamed_addr constant [43 x i8] c"github.com/goplus/llgo/cl/internal/foo.Foo\00", align 1
|
||||
@7 = private unnamed_addr constant [3 x i8] c"pb\00", align 1
|
||||
@8 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1
|
||||
@9 = private unnamed_addr constant [2 x i8] c"f\00", align 1
|
||||
@10 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1
|
||||
@11 = private unnamed_addr constant [5 x i8] c"main\00", align 1
|
||||
@12 = private unnamed_addr constant [9 x i8] c"main.bar\00", align 1
|
||||
|
||||
define { %"github.com/goplus/llgo/cl/internal/foo.Foo", i1 } @main.Bar(%"github.com/goplus/llgo/internal/runtime.eface" %0) {
|
||||
_llgo_0:
|
||||
@@ -131,38 +132,47 @@ _llgo_0:
|
||||
%8 = load ptr, ptr %7, align 8
|
||||
%9 = getelementptr inbounds %main.bar, ptr %3, i32 0, i32 1
|
||||
%10 = load float, ptr %9, align 4
|
||||
%11 = xor i1 %6, true
|
||||
%12 = alloca %"github.com/goplus/llgo/internal/runtime.String", align 8
|
||||
%13 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %12, i32 0, i32 0
|
||||
store ptr @0, ptr %13, align 8
|
||||
%14 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %12, i32 0, i32 1
|
||||
store i64 6, ptr %14, align 4
|
||||
%15 = load %"github.com/goplus/llgo/internal/runtime.String", ptr %12, align 8
|
||||
call void @"github.com/goplus/llgo/internal/runtime.PrintPointer"(ptr %8)
|
||||
call void @"github.com/goplus/llgo/internal/runtime.PrintByte"(i8 32)
|
||||
%11 = fpext float %10 to double
|
||||
call void @"github.com/goplus/llgo/internal/runtime.PrintFloat"(double %11)
|
||||
%16 = fpext float %10 to double
|
||||
call void @"github.com/goplus/llgo/internal/runtime.PrintFloat"(double %16)
|
||||
call void @"github.com/goplus/llgo/internal/runtime.PrintByte"(i8 32)
|
||||
call void @"github.com/goplus/llgo/internal/runtime.PrintBool"(i1 %6)
|
||||
call void @"github.com/goplus/llgo/internal/runtime.PrintString"(%"github.com/goplus/llgo/internal/runtime.String" %15)
|
||||
call void @"github.com/goplus/llgo/internal/runtime.PrintByte"(i8 32)
|
||||
call void @"github.com/goplus/llgo/internal/runtime.PrintBool"(i1 %11)
|
||||
call void @"github.com/goplus/llgo/internal/runtime.PrintByte"(i8 10)
|
||||
%12 = alloca %"github.com/goplus/llgo/cl/internal/foo.Foo", align 8
|
||||
%13 = call ptr @"github.com/goplus/llgo/internal/runtime.Zeroinit"(ptr %12, i64 16)
|
||||
%14 = load ptr, ptr @"github.com/goplus/llgo/cl/internal/foo.Foo", align 8
|
||||
%15 = call ptr @"github.com/goplus/llgo/internal/runtime.AllocU"(i64 16)
|
||||
store %"github.com/goplus/llgo/cl/internal/foo.Foo" zeroinitializer, ptr %15, align 8
|
||||
%16 = alloca %"github.com/goplus/llgo/internal/runtime.eface", align 8
|
||||
%17 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.eface", ptr %16, i32 0, i32 0
|
||||
store ptr %14, ptr %17, align 8
|
||||
%18 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.eface", ptr %16, i32 0, i32 1
|
||||
store ptr %15, ptr %18, align 8
|
||||
%19 = load %"github.com/goplus/llgo/internal/runtime.eface", ptr %16, align 8
|
||||
%20 = call { %"github.com/goplus/llgo/cl/internal/foo.Foo", i1 } @main.Bar(%"github.com/goplus/llgo/internal/runtime.eface" %19)
|
||||
%21 = extractvalue { %"github.com/goplus/llgo/cl/internal/foo.Foo", i1 } %20, 0
|
||||
store %"github.com/goplus/llgo/cl/internal/foo.Foo" %21, ptr %13, align 8
|
||||
%22 = extractvalue { %"github.com/goplus/llgo/cl/internal/foo.Foo", i1 } %20, 1
|
||||
%23 = load %"github.com/goplus/llgo/cl/internal/foo.Foo", ptr %13, align 8
|
||||
%24 = call ptr @"(github.com/goplus/llgo/cl/internal/foo.Foo).Pb"(%"github.com/goplus/llgo/cl/internal/foo.Foo" %23)
|
||||
%25 = getelementptr inbounds %"github.com/goplus/llgo/cl/internal/foo.Foo", ptr %13, i32 0, i32 1
|
||||
%26 = load float, ptr %25, align 4
|
||||
call void @"github.com/goplus/llgo/internal/runtime.PrintPointer"(ptr %24)
|
||||
%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)
|
||||
%19 = load ptr, ptr @"github.com/goplus/llgo/cl/internal/foo.Foo", align 8
|
||||
%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
|
||||
%21 = alloca %"github.com/goplus/llgo/internal/runtime.eface", align 8
|
||||
%22 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.eface", ptr %21, i32 0, i32 0
|
||||
store ptr %19, ptr %22, align 8
|
||||
%23 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.eface", ptr %21, i32 0, i32 1
|
||||
store ptr %20, ptr %23, align 8
|
||||
%24 = load %"github.com/goplus/llgo/internal/runtime.eface", ptr %21, align 8
|
||||
%25 = call { %"github.com/goplus/llgo/cl/internal/foo.Foo", i1 } @main.Bar(%"github.com/goplus/llgo/internal/runtime.eface" %24)
|
||||
%26 = extractvalue { %"github.com/goplus/llgo/cl/internal/foo.Foo", i1 } %25, 0
|
||||
store %"github.com/goplus/llgo/cl/internal/foo.Foo" %26, ptr %18, align 8
|
||||
%27 = extractvalue { %"github.com/goplus/llgo/cl/internal/foo.Foo", i1 } %25, 1
|
||||
%28 = load %"github.com/goplus/llgo/cl/internal/foo.Foo", ptr %18, align 8
|
||||
%29 = call ptr @"(github.com/goplus/llgo/cl/internal/foo.Foo).Pb"(%"github.com/goplus/llgo/cl/internal/foo.Foo" %28)
|
||||
%30 = getelementptr inbounds %"github.com/goplus/llgo/cl/internal/foo.Foo", ptr %18, i32 0, i32 1
|
||||
%31 = load float, ptr %30, align 4
|
||||
call void @"github.com/goplus/llgo/internal/runtime.PrintPointer"(ptr %29)
|
||||
call void @"github.com/goplus/llgo/internal/runtime.PrintByte"(i8 32)
|
||||
%27 = fpext float %26 to double
|
||||
call void @"github.com/goplus/llgo/internal/runtime.PrintFloat"(double %27)
|
||||
%32 = fpext float %31 to double
|
||||
call void @"github.com/goplus/llgo/internal/runtime.PrintFloat"(double %32)
|
||||
call void @"github.com/goplus/llgo/internal/runtime.PrintByte"(i8 32)
|
||||
call void @"github.com/goplus/llgo/internal/runtime.PrintBool"(i1 %22)
|
||||
call void @"github.com/goplus/llgo/internal/runtime.PrintBool"(i1 %27)
|
||||
call void @"github.com/goplus/llgo/internal/runtime.PrintByte"(i8 10)
|
||||
ret i32 0
|
||||
}
|
||||
@@ -179,6 +189,8 @@ declare void @"github.com/goplus/llgo/internal/runtime.PrintByte"(i8)
|
||||
|
||||
declare void @"github.com/goplus/llgo/internal/runtime.PrintFloat"(double)
|
||||
|
||||
declare void @"github.com/goplus/llgo/internal/runtime.PrintString"(%"github.com/goplus/llgo/internal/runtime.String")
|
||||
|
||||
declare void @"github.com/goplus/llgo/internal/runtime.PrintBool"(i1)
|
||||
|
||||
declare ptr @"github.com/goplus/llgo/internal/runtime.AllocU"(i64)
|
||||
@@ -194,35 +206,35 @@ _llgo_0:
|
||||
_llgo_1: ; preds = %_llgo_0
|
||||
%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
|
||||
store ptr @0, ptr %3, align 8
|
||||
store ptr @1, ptr %3, align 8
|
||||
%4 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %2, i32 0, i32 1
|
||||
store i64 2, ptr %4, align 4
|
||||
%5 = load %"github.com/goplus/llgo/internal/runtime.String", ptr %2, align 8
|
||||
%6 = load ptr, ptr @"*_llgo_byte", align 8
|
||||
%7 = alloca %"github.com/goplus/llgo/internal/runtime.String", align 8
|
||||
%8 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %7, i32 0, i32 0
|
||||
store ptr @1, ptr %8, align 8
|
||||
store ptr @2, ptr %8, align 8
|
||||
%9 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %7, i32 0, i32 1
|
||||
store i64 0, ptr %9, align 4
|
||||
%10 = load %"github.com/goplus/llgo/internal/runtime.String", ptr %7, align 8
|
||||
%11 = call %"github.com/goplus/llgo/internal/abi.StructField" @"github.com/goplus/llgo/internal/runtime.StructField"(%"github.com/goplus/llgo/internal/runtime.String" %5, ptr %6, i64 0, %"github.com/goplus/llgo/internal/runtime.String" %10, i1 false, i1 false)
|
||||
%12 = alloca %"github.com/goplus/llgo/internal/runtime.String", align 8
|
||||
%13 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %12, i32 0, i32 0
|
||||
store ptr @2, ptr %13, align 8
|
||||
store ptr @3, ptr %13, align 8
|
||||
%14 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %12, i32 0, i32 1
|
||||
store i64 1, ptr %14, align 4
|
||||
%15 = load %"github.com/goplus/llgo/internal/runtime.String", ptr %12, align 8
|
||||
%16 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 13)
|
||||
%17 = alloca %"github.com/goplus/llgo/internal/runtime.String", align 8
|
||||
%18 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %17, i32 0, i32 0
|
||||
store ptr @3, ptr %18, align 8
|
||||
store ptr @4, ptr %18, align 8
|
||||
%19 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %17, i32 0, i32 1
|
||||
store i64 0, ptr %19, align 4
|
||||
%20 = load %"github.com/goplus/llgo/internal/runtime.String", ptr %17, align 8
|
||||
%21 = call %"github.com/goplus/llgo/internal/abi.StructField" @"github.com/goplus/llgo/internal/runtime.StructField"(%"github.com/goplus/llgo/internal/runtime.String" %15, ptr %16, i64 8, %"github.com/goplus/llgo/internal/runtime.String" %20, i1 true, i1 false)
|
||||
%22 = alloca %"github.com/goplus/llgo/internal/runtime.String", align 8
|
||||
%23 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %22, i32 0, i32 0
|
||||
store ptr @4, ptr %23, align 8
|
||||
store ptr @5, ptr %23, align 8
|
||||
%24 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %22, i32 0, i32 1
|
||||
store i64 4, ptr %24, align 4
|
||||
%25 = load %"github.com/goplus/llgo/internal/runtime.String", ptr %22, align 8
|
||||
@@ -242,7 +254,7 @@ _llgo_1: ; preds = %_llgo_0
|
||||
%34 = call ptr @"github.com/goplus/llgo/internal/runtime.Struct"(%"github.com/goplus/llgo/internal/runtime.String" %25, %"github.com/goplus/llgo/internal/runtime.Slice" %33)
|
||||
%35 = alloca %"github.com/goplus/llgo/internal/runtime.String", align 8
|
||||
%36 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %35, i32 0, i32 0
|
||||
store ptr @5, ptr %36, align 8
|
||||
store ptr @6, ptr %36, align 8
|
||||
%37 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %35, i32 0, i32 1
|
||||
store i64 42, ptr %37, align 4
|
||||
%38 = load %"github.com/goplus/llgo/internal/runtime.String", ptr %35, align 8
|
||||
@@ -253,35 +265,35 @@ _llgo_1: ; preds = %_llgo_0
|
||||
_llgo_2: ; preds = %_llgo_1, %_llgo_0
|
||||
%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 @6, ptr %41, align 8
|
||||
store ptr @7, ptr %41, align 8
|
||||
%42 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %40, i32 0, i32 1
|
||||
store i64 2, ptr %42, align 4
|
||||
%43 = load %"github.com/goplus/llgo/internal/runtime.String", ptr %40, align 8
|
||||
%44 = load ptr, ptr @"*_llgo_byte", align 8
|
||||
%45 = alloca %"github.com/goplus/llgo/internal/runtime.String", align 8
|
||||
%46 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %45, i32 0, i32 0
|
||||
store ptr @7, ptr %46, align 8
|
||||
store ptr @8, ptr %46, align 8
|
||||
%47 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %45, i32 0, i32 1
|
||||
store i64 0, ptr %47, align 4
|
||||
%48 = load %"github.com/goplus/llgo/internal/runtime.String", ptr %45, align 8
|
||||
%49 = call %"github.com/goplus/llgo/internal/abi.StructField" @"github.com/goplus/llgo/internal/runtime.StructField"(%"github.com/goplus/llgo/internal/runtime.String" %43, ptr %44, i64 0, %"github.com/goplus/llgo/internal/runtime.String" %48, i1 false, i1 false)
|
||||
%50 = alloca %"github.com/goplus/llgo/internal/runtime.String", align 8
|
||||
%51 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %50, i32 0, i32 0
|
||||
store ptr @8, ptr %51, align 8
|
||||
store ptr @9, ptr %51, align 8
|
||||
%52 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %50, i32 0, i32 1
|
||||
store i64 1, ptr %52, align 4
|
||||
%53 = load %"github.com/goplus/llgo/internal/runtime.String", ptr %50, align 8
|
||||
%54 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 13)
|
||||
%55 = alloca %"github.com/goplus/llgo/internal/runtime.String", align 8
|
||||
%56 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %55, i32 0, i32 0
|
||||
store ptr @9, ptr %56, align 8
|
||||
store ptr @10, ptr %56, align 8
|
||||
%57 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %55, i32 0, i32 1
|
||||
store i64 0, ptr %57, align 4
|
||||
%58 = load %"github.com/goplus/llgo/internal/runtime.String", ptr %55, align 8
|
||||
%59 = call %"github.com/goplus/llgo/internal/abi.StructField" @"github.com/goplus/llgo/internal/runtime.StructField"(%"github.com/goplus/llgo/internal/runtime.String" %53, ptr %54, i64 8, %"github.com/goplus/llgo/internal/runtime.String" %58, i1 false, i1 false)
|
||||
%60 = alloca %"github.com/goplus/llgo/internal/runtime.String", align 8
|
||||
%61 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %60, i32 0, i32 0
|
||||
store ptr @10, ptr %61, align 8
|
||||
store ptr @11, ptr %61, align 8
|
||||
%62 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %60, i32 0, i32 1
|
||||
store i64 4, ptr %62, align 4
|
||||
%63 = load %"github.com/goplus/llgo/internal/runtime.String", ptr %60, align 8
|
||||
@@ -301,7 +313,7 @@ _llgo_2: ; preds = %_llgo_1, %_llgo_0
|
||||
%72 = call ptr @"github.com/goplus/llgo/internal/runtime.Struct"(%"github.com/goplus/llgo/internal/runtime.String" %63, %"github.com/goplus/llgo/internal/runtime.Slice" %71)
|
||||
%73 = alloca %"github.com/goplus/llgo/internal/runtime.String", align 8
|
||||
%74 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %73, i32 0, i32 0
|
||||
store ptr @11, ptr %74, align 8
|
||||
store ptr @12, ptr %74, align 8
|
||||
%75 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %73, i32 0, i32 1
|
||||
store i64 8, ptr %75, align 4
|
||||
%76 = load %"github.com/goplus/llgo/internal/runtime.String", ptr %73, align 8
|
||||
|
||||
Reference in New Issue
Block a user