From 73b42f924dbfa1525e362330bc536ddeaf3d5234 Mon Sep 17 00:00:00 2001 From: visualfc Date: Mon, 8 Jul 2024 20:19:25 +0800 Subject: [PATCH] ssa: fix setDirectIface --- cl/_testgo/equal/out.ll | 3 +++ cl/_testgo/errors/out.ll | 4 ++++ cl/_testgo/ifaceconv/out.ll | 3 +++ cl/_testgo/ifaceprom/out.ll | 4 ++++ cl/_testgo/interface/out.ll | 7 +++++++ cl/_testgo/invoke/out.ll | 12 ++++++++++++ cl/_testgo/reader/out.ll | 15 +++++++++++++++ cl/_testgo/struczero/out.ll | 4 ++++ cl/_testrt/abinamed/out.ll | 23 +++++++++++++++++++++++ cl/_testrt/any/out.ll | 3 +++ cl/_testrt/eface/out.ll | 4 ++++ cl/_testrt/makemap/out.ll | 10 ++++++++++ cl/_testrt/map/out.ll | 3 +++ internal/runtime/z_face.go | 4 ++++ ssa/abitype.go | 4 ++++ 15 files changed, 103 insertions(+) diff --git a/cl/_testgo/equal/out.ll b/cl/_testgo/equal/out.ll index 1a4dfc8a..87022076 100644 --- a/cl/_testgo/equal/out.ll +++ b/cl/_testgo/equal/out.ll @@ -864,6 +864,7 @@ _llgo_17: ; preds = %_llgo_16 %174 = load %"github.com/goplus/llgo/internal/runtime.Slice", ptr %170, align 8 %175 = call ptr @"github.com/goplus/llgo/internal/runtime.Struct"(%"github.com/goplus/llgo/internal/runtime.String" %164, i64 208, %"github.com/goplus/llgo/internal/runtime.Slice" %174) %176 = call ptr @"github.com/goplus/llgo/internal/runtime.MapOf"(ptr %116, ptr %117, ptr %175, i64 4) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %176) store ptr %176, ptr @"map[_llgo_int]_llgo_string", align 8 br label %_llgo_18 @@ -907,6 +908,8 @@ declare ptr @"github.com/goplus/llgo/internal/runtime.MapOf"(ptr, ptr, ptr, i64) declare ptr @"github.com/goplus/llgo/internal/runtime.ArrayOf"(i64, ptr) +declare void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr) + declare ptr @"github.com/goplus/llgo/internal/runtime.MakeMap"(ptr, i64) declare void @"github.com/goplus/llgo/internal/runtime.init"() diff --git a/cl/_testgo/errors/out.ll b/cl/_testgo/errors/out.ll index 778341e3..85e7f553 100644 --- a/cl/_testgo/errors/out.ll +++ b/cl/_testgo/errors/out.ll @@ -178,6 +178,7 @@ _llgo_3: ; preds = %_llgo_2 store i64 1, ptr %45, align 4 %46 = load %"github.com/goplus/llgo/internal/runtime.Slice", ptr %42, align 8 %47 = call ptr @"github.com/goplus/llgo/internal/runtime.Func"(%"github.com/goplus/llgo/internal/runtime.Slice" %39, %"github.com/goplus/llgo/internal/runtime.Slice" %46, i1 false) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %47) store ptr %47, ptr @"_llgo_func$zNDVRsWTIpUPKouNUS805RGX--IV9qVK8B31IZbg5to", align 8 br label %_llgo_4 @@ -218,6 +219,7 @@ _llgo_4: ; preds = %_llgo_3, %_llgo_2 %69 = load %"github.com/goplus/llgo/internal/runtime.String", ptr %66, align 8 call void @"github.com/goplus/llgo/internal/runtime.InitNamed"(ptr %0, %"github.com/goplus/llgo/internal/runtime.String" %65, %"github.com/goplus/llgo/internal/runtime.String" %69, ptr %23, { ptr, i64, i64 } zeroinitializer, %"github.com/goplus/llgo/internal/runtime.Slice" %61) %70 = call ptr @"github.com/goplus/llgo/internal/runtime.PointerTo"(ptr %0) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %70) store ptr %70, ptr @"*_llgo_main.errorString", align 8 %71 = load ptr, ptr @"_llgo_func$zNDVRsWTIpUPKouNUS805RGX--IV9qVK8B31IZbg5to", align 8 %72 = load ptr, ptr @"_llgo_iface$Fh8eUJ-Gw4e6TYuajcFIOSCuqSPKAt5nS4ow7xeGXEU", align 8 @@ -282,6 +284,8 @@ declare void @"github.com/goplus/llgo/internal/runtime.InitNamed"(ptr, %"github. declare ptr @"github.com/goplus/llgo/internal/runtime.Func"(%"github.com/goplus/llgo/internal/runtime.Slice", %"github.com/goplus/llgo/internal/runtime.Slice", i1) +declare void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr) + declare ptr @"github.com/goplus/llgo/internal/runtime.PointerTo"(ptr) 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") diff --git a/cl/_testgo/ifaceconv/out.ll b/cl/_testgo/ifaceconv/out.ll index 1d6d6cdd..444d68c2 100644 --- a/cl/_testgo/ifaceconv/out.ll +++ b/cl/_testgo/ifaceconv/out.ll @@ -820,6 +820,7 @@ _llgo_5: ; preds = %_llgo_4 store i64 0, ptr %32, align 4 %33 = load %"github.com/goplus/llgo/internal/runtime.Slice", ptr %29, align 8 %34 = call ptr @"github.com/goplus/llgo/internal/runtime.Func"(%"github.com/goplus/llgo/internal/runtime.Slice" %27, %"github.com/goplus/llgo/internal/runtime.Slice" %33, i1 false) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %34) store ptr %34, ptr @"_llgo_func$2_iS07vIlF2_rZqWB5eU0IvP_9HviM4MYZNkXZDvbac", align 8 br label %_llgo_6 @@ -1271,6 +1272,8 @@ declare ptr @"github.com/goplus/llgo/internal/runtime.IfaceType"(%"github.com/go declare ptr @"github.com/goplus/llgo/internal/runtime.Func"(%"github.com/goplus/llgo/internal/runtime.Slice", %"github.com/goplus/llgo/internal/runtime.Slice", i1) +declare void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr) + declare ptr @"github.com/goplus/llgo/internal/runtime.NewItab"(ptr, ptr) declare ptr @"github.com/goplus/llgo/internal/runtime.NewNamed"(i64, i64, i64) diff --git a/cl/_testgo/ifaceprom/out.ll b/cl/_testgo/ifaceprom/out.ll index 9cdf83a5..5d3955ae 100644 --- a/cl/_testgo/ifaceprom/out.ll +++ b/cl/_testgo/ifaceprom/out.ll @@ -691,6 +691,7 @@ _llgo_5: ; preds = %_llgo_4 store i64 1, ptr %40, align 4 %41 = load %"github.com/goplus/llgo/internal/runtime.Slice", ptr %37, align 8 %42 = call ptr @"github.com/goplus/llgo/internal/runtime.Func"(%"github.com/goplus/llgo/internal/runtime.Slice" %34, %"github.com/goplus/llgo/internal/runtime.Slice" %41, i1 false) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %42) store ptr %42, ptr @"_llgo_func$ETeB8WwW04JEq0ztcm-XPTJtuYvtpkjIsAc0-2NT9zA", align 8 br label %_llgo_6 @@ -765,6 +766,7 @@ _llgo_9: ; preds = %_llgo_8 store i64 1, ptr %81, align 4 %82 = load %"github.com/goplus/llgo/internal/runtime.Slice", ptr %78, align 8 %83 = call ptr @"github.com/goplus/llgo/internal/runtime.Func"(%"github.com/goplus/llgo/internal/runtime.Slice" %75, %"github.com/goplus/llgo/internal/runtime.Slice" %82, i1 false) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %83) store ptr %83, ptr @"_llgo_func$zNDVRsWTIpUPKouNUS805RGX--IV9qVK8B31IZbg5to", align 8 br label %_llgo_10 @@ -960,6 +962,8 @@ declare ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64) declare ptr @"github.com/goplus/llgo/internal/runtime.Func"(%"github.com/goplus/llgo/internal/runtime.Slice", %"github.com/goplus/llgo/internal/runtime.Slice", i1) +declare void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr) + 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 ptr @"github.com/goplus/llgo/internal/runtime.NewItab"(ptr, ptr) diff --git a/cl/_testgo/interface/out.ll b/cl/_testgo/interface/out.ll index 65a2e545..3df56320 100644 --- a/cl/_testgo/interface/out.ll +++ b/cl/_testgo/interface/out.ll @@ -256,6 +256,7 @@ _llgo_0: _llgo_1: ; preds = %_llgo_0 %2 = call ptr @"github.com/goplus/llgo/internal/runtime.NewNamed"(i64 25, i64 2, i64 2) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %2) store ptr %2, ptr @_llgo_main.Game1, align 8 br label %_llgo_2 @@ -298,6 +299,7 @@ _llgo_3: ; preds = %_llgo_2 store i64 1, ptr %25, align 4 %26 = load %"github.com/goplus/llgo/internal/runtime.Slice", ptr %22, align 8 %27 = call ptr @"github.com/goplus/llgo/internal/runtime.Struct"(%"github.com/goplus/llgo/internal/runtime.String" %19, i64 8, %"github.com/goplus/llgo/internal/runtime.Slice" %26) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %27) store ptr %27, ptr @"_llgo_struct$cJmCzeVn0orHWafCrTGAnbbAF46F2A4Fms4bJBm8ITI", align 8 br label %_llgo_4 @@ -341,6 +343,7 @@ _llgo_7: ; preds = %_llgo_5 store i64 0, ptr %47, align 4 %48 = load %"github.com/goplus/llgo/internal/runtime.Slice", ptr %44, align 8 %49 = call ptr @"github.com/goplus/llgo/internal/runtime.Func"(%"github.com/goplus/llgo/internal/runtime.Slice" %42, %"github.com/goplus/llgo/internal/runtime.Slice" %48, i1 false) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %49) store ptr %49, ptr @"_llgo_func$2_iS07vIlF2_rZqWB5eU0IvP_9HviM4MYZNkXZDvbac", align 8 br label %_llgo_8 @@ -430,6 +433,7 @@ _llgo_8: ; preds = %_llgo_7, %_llgo_5 _llgo_9: ; preds = %_llgo_6 %101 = call ptr @"github.com/goplus/llgo/internal/runtime.PointerTo"(ptr %2) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %101) store ptr %101, ptr @"*_llgo_main.Game1", align 8 br label %_llgo_10 @@ -529,6 +533,7 @@ _llgo_16: ; preds = %_llgo_15, %_llgo_14 _llgo_17: ; preds = %_llgo_16 %151 = call ptr @"github.com/goplus/llgo/internal/runtime.PointerTo"(ptr %104) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %151) store ptr %151, ptr @"*_llgo_main.Game2", align 8 br label %_llgo_18 @@ -652,6 +657,8 @@ _llgo_20: ; preds = %_llgo_19, %_llgo_18 declare ptr @"github.com/goplus/llgo/internal/runtime.NewNamed"(i64, i64, i64) +declare void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr) + declare ptr @"github.com/goplus/llgo/internal/runtime.Struct"(%"github.com/goplus/llgo/internal/runtime.String", i64, %"github.com/goplus/llgo/internal/runtime.Slice") 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) diff --git a/cl/_testgo/invoke/out.ll b/cl/_testgo/invoke/out.ll index d63e4350..aedda48c 100644 --- a/cl/_testgo/invoke/out.ll +++ b/cl/_testgo/invoke/out.ll @@ -741,6 +741,7 @@ _llgo_7: ; preds = %_llgo_6 store i64 1, ptr %50, align 4 %51 = load %"github.com/goplus/llgo/internal/runtime.Slice", ptr %47, align 8 %52 = call ptr @"github.com/goplus/llgo/internal/runtime.Func"(%"github.com/goplus/llgo/internal/runtime.Slice" %44, %"github.com/goplus/llgo/internal/runtime.Slice" %51, i1 false) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %52) store ptr %52, ptr @"_llgo_func$ETeB8WwW04JEq0ztcm-XPTJtuYvtpkjIsAc0-2NT9zA", align 8 br label %_llgo_8 @@ -796,6 +797,7 @@ _llgo_9: ; preds = %_llgo_8 store i64 0, ptr %82, align 4 %83 = load %"github.com/goplus/llgo/internal/runtime.Slice", ptr %79, align 8 %84 = call ptr @"github.com/goplus/llgo/internal/runtime.Func"(%"github.com/goplus/llgo/internal/runtime.Slice" %77, %"github.com/goplus/llgo/internal/runtime.Slice" %83, i1 false) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %84) store ptr %84, ptr @"_llgo_func$2_iS07vIlF2_rZqWB5eU0IvP_9HviM4MYZNkXZDvbac", align 8 br label %_llgo_10 @@ -897,6 +899,7 @@ _llgo_12: ; preds = %_llgo_11, %_llgo_4 _llgo_13: ; preds = %_llgo_12 %141 = call ptr @"github.com/goplus/llgo/internal/runtime.PointerTo"(ptr %2) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %141) store ptr %141, ptr @"*_llgo_main.T", align 8 br label %_llgo_14 @@ -986,6 +989,7 @@ _llgo_18: ; preds = %_llgo_17, %_llgo_16 _llgo_19: ; preds = %_llgo_18 %187 = call ptr @"github.com/goplus/llgo/internal/runtime.PointerTo"(ptr %144) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %187) store ptr %187, ptr @"*_llgo_main.T1", align 8 br label %_llgo_20 @@ -1085,6 +1089,7 @@ _llgo_26: ; preds = %_llgo_25, %_llgo_24 _llgo_27: ; preds = %_llgo_26 %236 = call ptr @"github.com/goplus/llgo/internal/runtime.PointerTo"(ptr %190) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %236) store ptr %236, ptr @"*_llgo_main.T2", align 8 br label %_llgo_28 @@ -1163,6 +1168,7 @@ _llgo_34: ; preds = %_llgo_33, %_llgo_32 _llgo_35: ; preds = %_llgo_34 %272 = call ptr @"github.com/goplus/llgo/internal/runtime.PointerTo"(ptr %239) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %272) store ptr %272, ptr @"*_llgo_main.T3", align 8 br label %_llgo_36 @@ -1264,6 +1270,7 @@ _llgo_42: ; preds = %_llgo_41, %_llgo_40 _llgo_43: ; preds = %_llgo_42 %323 = call ptr @"github.com/goplus/llgo/internal/runtime.PointerTo"(ptr %275) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %323) store ptr %323, ptr @"*_llgo_main.T4", align 8 br label %_llgo_44 @@ -1386,6 +1393,7 @@ _llgo_48: ; preds = %_llgo_47, %_llgo_46 _llgo_49: ; preds = %_llgo_48 %391 = call ptr @"github.com/goplus/llgo/internal/runtime.PointerTo"(ptr %326) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %391) store ptr %391, ptr @"*_llgo_main.T5", align 8 br label %_llgo_50 @@ -1406,6 +1414,7 @@ _llgo_52: ; preds = %_llgo_51, %_llgo_50 _llgo_53: ; preds = %_llgo_52 %397 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 58) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %397) store ptr %397, ptr @_llgo_Pointer, align 8 br label %_llgo_54 @@ -1558,6 +1567,7 @@ _llgo_56: ; preds = %_llgo_55, %_llgo_54 _llgo_57: ; preds = %_llgo_56 %489 = call ptr @"github.com/goplus/llgo/internal/runtime.PointerTo"(ptr %394) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %489) store ptr %489, ptr @"*_llgo_main.T6", align 8 br label %_llgo_58 @@ -1727,6 +1737,8 @@ declare void @"github.com/goplus/llgo/internal/runtime.InitNamed"(ptr, %"github. declare ptr @"github.com/goplus/llgo/internal/runtime.Func"(%"github.com/goplus/llgo/internal/runtime.Slice", %"github.com/goplus/llgo/internal/runtime.Slice", i1) +declare void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr) + 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 ptr @"github.com/goplus/llgo/internal/runtime.NewItab"(ptr, ptr) diff --git a/cl/_testgo/reader/out.ll b/cl/_testgo/reader/out.ll index e04e0f2c..eddb1c1f 100644 --- a/cl/_testgo/reader/out.ll +++ b/cl/_testgo/reader/out.ll @@ -1170,6 +1170,7 @@ _llgo_7: ; preds = %_llgo_6 store i64 1, ptr %26, align 4 %27 = load %"github.com/goplus/llgo/internal/runtime.Slice", ptr %23, align 8 %28 = call ptr @"github.com/goplus/llgo/internal/runtime.Func"(%"github.com/goplus/llgo/internal/runtime.Slice" %20, %"github.com/goplus/llgo/internal/runtime.Slice" %27, i1 false) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %28) store ptr %28, ptr @"_llgo_func$zNDVRsWTIpUPKouNUS805RGX--IV9qVK8B31IZbg5to", align 8 br label %_llgo_8 @@ -1251,6 +1252,7 @@ _llgo_11: ; preds = %_llgo_10 store i64 2, ptr %72, align 4 %73 = load %"github.com/goplus/llgo/internal/runtime.Slice", ptr %69, align 8 %74 = call ptr @"github.com/goplus/llgo/internal/runtime.Func"(%"github.com/goplus/llgo/internal/runtime.Slice" %65, %"github.com/goplus/llgo/internal/runtime.Slice" %73, i1 false) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %74) store ptr %74, ptr @"_llgo_func$06yPPin-fnDnxFKkLLcJ1GEUhIobjPimde7T_Id_hmY", align 8 br label %_llgo_12 @@ -1344,6 +1346,7 @@ _llgo_17: ; preds = %_llgo_16 store i64 2, ptr %123, align 4 %124 = load %"github.com/goplus/llgo/internal/runtime.Slice", ptr %120, align 8 %125 = call ptr @"github.com/goplus/llgo/internal/runtime.Func"(%"github.com/goplus/llgo/internal/runtime.Slice" %116, %"github.com/goplus/llgo/internal/runtime.Slice" %124, i1 false) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %125) store ptr %125, ptr @"_llgo_func$MrYxYl10p_I07B55pBsGw9la9zbzU2vGDPLWrT714Uk", align 8 br label %_llgo_18 @@ -1553,6 +1556,7 @@ _llgo_25: ; preds = %_llgo_24 store i64 1, ptr %248, align 4 %249 = load %"github.com/goplus/llgo/internal/runtime.Slice", ptr %245, align 8 %250 = call ptr @"github.com/goplus/llgo/internal/runtime.Func"(%"github.com/goplus/llgo/internal/runtime.Slice" %242, %"github.com/goplus/llgo/internal/runtime.Slice" %249, i1 false) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %250) store ptr %250, ptr @"_llgo_func$8rsrSd_r3UHd_2DiYTyaOKR7BYkei4zw5ysG35KF38w", align 8 br label %_llgo_26 @@ -1865,6 +1869,7 @@ _llgo_29: ; preds = %_llgo_28 store i64 2, ptr %439, align 4 %440 = load %"github.com/goplus/llgo/internal/runtime.Slice", ptr %436, align 8 %441 = call ptr @"github.com/goplus/llgo/internal/runtime.Func"(%"github.com/goplus/llgo/internal/runtime.Slice" %432, %"github.com/goplus/llgo/internal/runtime.Slice" %440, i1 false) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %441) store ptr %441, ptr @"_llgo_func$thH5FBpdXzJNnCpSfiLU5ItTntFU6LWp0RJhDm2XJjw", align 8 br label %_llgo_30 @@ -2062,6 +2067,7 @@ _llgo_35: ; preds = %_llgo_34 store i64 1, ptr %560, align 4 %561 = load %"github.com/goplus/llgo/internal/runtime.Slice", ptr %557, align 8 %562 = call ptr @"github.com/goplus/llgo/internal/runtime.Func"(%"github.com/goplus/llgo/internal/runtime.Slice" %554, %"github.com/goplus/llgo/internal/runtime.Slice" %561, i1 false) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %562) store ptr %562, ptr @"_llgo_func$ETeB8WwW04JEq0ztcm-XPTJtuYvtpkjIsAc0-2NT9zA", align 8 br label %_llgo_36 @@ -2136,6 +2142,7 @@ _llgo_37: ; preds = %_llgo_36 store i64 2, ptr %605, align 4 %606 = load %"github.com/goplus/llgo/internal/runtime.Slice", ptr %602, align 8 %607 = call ptr @"github.com/goplus/llgo/internal/runtime.Func"(%"github.com/goplus/llgo/internal/runtime.Slice" %598, %"github.com/goplus/llgo/internal/runtime.Slice" %606, i1 false) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %607) store ptr %607, ptr @"_llgo_func$TY5Etv7VBKM_-2um1BDEeQEE2lP06Pt6G54EuKiNC3c", align 8 br label %_llgo_38 @@ -2197,6 +2204,7 @@ _llgo_41: ; preds = %_llgo_40 store i64 2, ptr %638, align 4 %639 = load %"github.com/goplus/llgo/internal/runtime.Slice", ptr %635, align 8 %640 = call ptr @"github.com/goplus/llgo/internal/runtime.Func"(%"github.com/goplus/llgo/internal/runtime.Slice" %631, %"github.com/goplus/llgo/internal/runtime.Slice" %639, i1 false) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %640) store ptr %640, ptr @"_llgo_func$6bvVpCcGPUc3z_EmsQTHB0AVT1hP5-NNLVRgm43teCM", align 8 br label %_llgo_42 @@ -2261,6 +2269,7 @@ _llgo_45: ; preds = %_llgo_44 store i64 3, ptr %673, align 4 %674 = load %"github.com/goplus/llgo/internal/runtime.Slice", ptr %670, align 8 %675 = call ptr @"github.com/goplus/llgo/internal/runtime.Func"(%"github.com/goplus/llgo/internal/runtime.Slice" %665, %"github.com/goplus/llgo/internal/runtime.Slice" %674, i1 false) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %675) store ptr %675, ptr @"_llgo_func$CB0CO6hV_feSzhi4pz1P4omza2fKNK930wvOR1T33fU", align 8 br label %_llgo_46 @@ -2318,6 +2327,7 @@ _llgo_47: ; preds = %_llgo_46 store i64 2, ptr %707, align 4 %708 = load %"github.com/goplus/llgo/internal/runtime.Slice", ptr %704, align 8 %709 = call ptr @"github.com/goplus/llgo/internal/runtime.Func"(%"github.com/goplus/llgo/internal/runtime.Slice" %700, %"github.com/goplus/llgo/internal/runtime.Slice" %708, i1 false) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %709) store ptr %709, ptr @"_llgo_func$HE7H49xPa1uXmrkMDpqB3RCRGf3qzhLGrxKCEXOYjms", align 8 br label %_llgo_48 @@ -2366,6 +2376,7 @@ _llgo_49: ; preds = %_llgo_48 store i64 1, ptr %735, align 4 %736 = load %"github.com/goplus/llgo/internal/runtime.Slice", ptr %732, align 8 %737 = call ptr @"github.com/goplus/llgo/internal/runtime.Func"(%"github.com/goplus/llgo/internal/runtime.Slice" %729, %"github.com/goplus/llgo/internal/runtime.Slice" %736, i1 false) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %737) store ptr %737, ptr @"_llgo_func$Eoig9xhJM5GShHH5aNPxTZZXp1IZxprRl4zPuv2hkug", align 8 br label %_llgo_50 @@ -2475,6 +2486,7 @@ _llgo_50: ; preds = %_llgo_49, %_llgo_48 %801 = load %"github.com/goplus/llgo/internal/runtime.String", ptr %798, align 8 call void @"github.com/goplus/llgo/internal/runtime.InitNamed"(ptr %496, %"github.com/goplus/llgo/internal/runtime.String" %797, %"github.com/goplus/llgo/internal/runtime.String" %801, ptr %541, { ptr, i64, i64 } zeroinitializer, %"github.com/goplus/llgo/internal/runtime.Slice" %793) %802 = call ptr @"github.com/goplus/llgo/internal/runtime.PointerTo"(ptr %496) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %802) store ptr %802, ptr @"*_llgo_main.stringReader", align 8 %803 = load ptr, ptr @"_llgo_func$06yPPin-fnDnxFKkLLcJ1GEUhIobjPimde7T_Id_hmY", align 8 %804 = load ptr, ptr @"_llgo_iface$OFO8Us9n8ajWCabGedeuoJ-Za2zAMk4Jh0FunAcUCFE", align 8 @@ -2600,6 +2612,7 @@ _llgo_52: ; preds = %_llgo_51, %_llgo_50 %879 = load %"github.com/goplus/llgo/internal/runtime.String", ptr %876, align 8 call void @"github.com/goplus/llgo/internal/runtime.InitNamed"(ptr %830, %"github.com/goplus/llgo/internal/runtime.String" %875, %"github.com/goplus/llgo/internal/runtime.String" %879, ptr %853, { ptr, i64, i64 } zeroinitializer, %"github.com/goplus/llgo/internal/runtime.Slice" %871) %880 = call ptr @"github.com/goplus/llgo/internal/runtime.PointerTo"(ptr %830) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %880) store ptr %880, ptr @"*_llgo_main.errorString", align 8 %881 = load ptr, ptr @"_llgo_func$zNDVRsWTIpUPKouNUS805RGX--IV9qVK8B31IZbg5to", align 8 %882 = load ptr, ptr @"_llgo_iface$Fh8eUJ-Gw4e6TYuajcFIOSCuqSPKAt5nS4ow7xeGXEU", align 8 @@ -2658,6 +2671,8 @@ declare ptr @"github.com/goplus/llgo/internal/runtime.Func"(%"github.com/goplus/ declare ptr @"github.com/goplus/llgo/internal/runtime.AllocU"(i64) +declare void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr) + 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 i1 @"github.com/goplus/llgo/internal/runtime.Implements"(ptr, ptr) diff --git a/cl/_testgo/struczero/out.ll b/cl/_testgo/struczero/out.ll index 2d2e4d19..2f3ac066 100644 --- a/cl/_testgo/struczero/out.ll +++ b/cl/_testgo/struczero/out.ll @@ -335,6 +335,7 @@ _llgo_6: ; preds = %_llgo_5, %_llgo_3 _llgo_7: ; preds = %_llgo_6 %91 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 40) %92 = call ptr @"github.com/goplus/llgo/internal/runtime.PointerTo"(ptr %91) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %92) store ptr %92, ptr @"*_llgo_byte", align 8 br label %_llgo_8 @@ -366,6 +367,7 @@ _llgo_9: ; preds = %_llgo_8 store i64 1, ptr %107, align 4 %108 = load %"github.com/goplus/llgo/internal/runtime.Slice", ptr %104, align 8 %109 = call ptr @"github.com/goplus/llgo/internal/runtime.Func"(%"github.com/goplus/llgo/internal/runtime.Slice" %101, %"github.com/goplus/llgo/internal/runtime.Slice" %108, i1 false) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %109) store ptr %109, ptr @"_llgo_func$NfGSLZ1QiKRoFkKeqYSXE5hUU5bpeteSJKrbMNUzYRE", align 8 br label %_llgo_10 @@ -443,6 +445,8 @@ declare ptr @"github.com/goplus/llgo/internal/runtime.AllocU"(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.SetDirectIface"(ptr) + declare ptr @"github.com/goplus/llgo/internal/runtime.Func"(%"github.com/goplus/llgo/internal/runtime.Slice", %"github.com/goplus/llgo/internal/runtime.Slice", i1) declare ptr @"github.com/goplus/llgo/cl/internal/foo.(*Foo).Pb"(ptr) diff --git a/cl/_testrt/abinamed/out.ll b/cl/_testrt/abinamed/out.ll index dd100624..c83b1d94 100644 --- a/cl/_testrt/abinamed/out.ll +++ b/cl/_testrt/abinamed/out.ll @@ -567,6 +567,7 @@ _llgo_6: ; preds = %_llgo_5, %_llgo_4 _llgo_7: ; preds = %_llgo_6 %72 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 58) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %72) store ptr %72, ptr @_llgo_Pointer, align 8 br label %_llgo_8 @@ -910,6 +911,7 @@ _llgo_17: ; preds = %_llgo_16 store i64 1, ptr %285, align 4 %286 = load %"github.com/goplus/llgo/internal/runtime.Slice", ptr %282, align 8 %287 = call ptr @"github.com/goplus/llgo/internal/runtime.Func"(%"github.com/goplus/llgo/internal/runtime.Slice" %279, %"github.com/goplus/llgo/internal/runtime.Slice" %286, i1 false) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %287) store ptr %287, ptr @"_llgo_func$ETeB8WwW04JEq0ztcm-XPTJtuYvtpkjIsAc0-2NT9zA", align 8 br label %_llgo_18 @@ -1084,6 +1086,7 @@ _llgo_24: ; preds = %_llgo_100, %_llgo_2 _llgo_25: ; preds = %_llgo_23 %389 = call ptr @"github.com/goplus/llgo/internal/runtime.PointerTo"(ptr %21) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %389) store ptr %389, ptr @"*_llgo_github.com/goplus/llgo/internal/abi.Type", align 8 br label %_llgo_26 @@ -1115,6 +1118,7 @@ _llgo_27: ; preds = %_llgo_26 store i64 1, ptr %404, align 4 %405 = load %"github.com/goplus/llgo/internal/runtime.Slice", ptr %401, align 8 %406 = call ptr @"github.com/goplus/llgo/internal/runtime.Func"(%"github.com/goplus/llgo/internal/runtime.Slice" %398, %"github.com/goplus/llgo/internal/runtime.Slice" %405, i1 false) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %406) store ptr %406, ptr @"_llgo_func$4-mqItKfDlL0CgVKnUxoresYgh6zW1WSlZYZSsVzLRo", align 8 br label %_llgo_28 @@ -1381,6 +1385,7 @@ _llgo_35: ; preds = %_llgo_33 store i64 1, ptr %566, align 4 %567 = load %"github.com/goplus/llgo/internal/runtime.Slice", ptr %563, align 8 %568 = call ptr @"github.com/goplus/llgo/internal/runtime.Func"(%"github.com/goplus/llgo/internal/runtime.Slice" %560, %"github.com/goplus/llgo/internal/runtime.Slice" %567, i1 false) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %568) store ptr %568, ptr @"_llgo_func$YHeRw3AOvQtzv982-ZO3Yn8vh3Fx89RM3VvI8E4iKVk", align 8 br label %_llgo_36 @@ -1760,6 +1765,7 @@ _llgo_51: ; preds = %_llgo_50 store i64 1, ptr %788, align 4 %789 = load %"github.com/goplus/llgo/internal/runtime.Slice", ptr %785, align 8 %790 = call ptr @"github.com/goplus/llgo/internal/runtime.Func"(%"github.com/goplus/llgo/internal/runtime.Slice" %782, %"github.com/goplus/llgo/internal/runtime.Slice" %789, i1 false) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %790) store ptr %790, ptr @"_llgo_func$zNDVRsWTIpUPKouNUS805RGX--IV9qVK8B31IZbg5to", align 8 br label %_llgo_52 @@ -1844,6 +1850,7 @@ _llgo_53: ; preds = %_llgo_48 store i64 1, ptr %837, align 4 %838 = load %"github.com/goplus/llgo/internal/runtime.Slice", ptr %834, align 8 %839 = call ptr @"github.com/goplus/llgo/internal/runtime.Func"(%"github.com/goplus/llgo/internal/runtime.Slice" %831, %"github.com/goplus/llgo/internal/runtime.Slice" %838, i1 false) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %839) store ptr %839, ptr @"_llgo_func$ntUE0UmVAWPS2O7GpCCGszSn-XnjHJntZZ2jYtwbFXI", align 8 br label %_llgo_54 @@ -2495,6 +2502,7 @@ _llgo_63: ; preds = %_llgo_61 store i64 1, ptr %1250, align 4 %1251 = load %"github.com/goplus/llgo/internal/runtime.Slice", ptr %1247, align 8 %1252 = call ptr @"github.com/goplus/llgo/internal/runtime.Func"(%"github.com/goplus/llgo/internal/runtime.Slice" %1244, %"github.com/goplus/llgo/internal/runtime.Slice" %1251, i1 false) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %1252) store ptr %1252, ptr @"_llgo_func$1kITCsyu7hFLMxHLR7kDlvu4SOra_HtrtdFUQH9P13s", align 8 br label %_llgo_64 @@ -3072,6 +3080,7 @@ _llgo_79: ; preds = %_llgo_78 store i64 1, ptr %1603, align 4 %1604 = load %"github.com/goplus/llgo/internal/runtime.Slice", ptr %1600, align 8 %1605 = call ptr @"github.com/goplus/llgo/internal/runtime.Func"(%"github.com/goplus/llgo/internal/runtime.Slice" %1597, %"github.com/goplus/llgo/internal/runtime.Slice" %1604, i1 false) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %1605) store ptr %1605, ptr @"_llgo_func$r0w3aCNVheLGqjxncuxitGhNtWJagb9gZLqOSrNI7dg", align 8 br label %_llgo_80 @@ -3134,6 +3143,7 @@ _llgo_80: ; preds = %_llgo_79, %_llgo_78 _llgo_81: ; preds = %_llgo_76 %1640 = call ptr @"github.com/goplus/llgo/internal/runtime.PointerTo"(ptr %1520) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %1640) store ptr %1640, ptr @"*_llgo_github.com/goplus/llgo/internal/abi.UncommonType", align 8 br label %_llgo_82 @@ -3165,6 +3175,7 @@ _llgo_83: ; preds = %_llgo_82 store i64 1, ptr %1655, align 4 %1656 = load %"github.com/goplus/llgo/internal/runtime.Slice", ptr %1652, align 8 %1657 = call ptr @"github.com/goplus/llgo/internal/runtime.Func"(%"github.com/goplus/llgo/internal/runtime.Slice" %1649, %"github.com/goplus/llgo/internal/runtime.Slice" %1656, i1 false) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %1657) store ptr %1657, ptr @"_llgo_func$DbD4nZv_bjE4tH8hh-VfAjMXMpNfIsMlLJJJPKupp34", align 8 br label %_llgo_84 @@ -3242,6 +3253,7 @@ _llgo_84: ; preds = %_llgo_83, %_llgo_82 _llgo_85: ; preds = %_llgo_70 %1697 = call ptr @"github.com/goplus/llgo/internal/runtime.PointerTo"(ptr %1277) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %1697) store ptr %1697, ptr @"*_llgo_github.com/goplus/llgo/internal/abi.StructType", align 8 br label %_llgo_86 @@ -3273,6 +3285,7 @@ _llgo_87: ; preds = %_llgo_86 store i64 1, ptr %1712, align 4 %1713 = load %"github.com/goplus/llgo/internal/runtime.Slice", ptr %1709, align 8 %1714 = call ptr @"github.com/goplus/llgo/internal/runtime.Func"(%"github.com/goplus/llgo/internal/runtime.Slice" %1706, %"github.com/goplus/llgo/internal/runtime.Slice" %1713, i1 false) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %1714) store ptr %1714, ptr @"_llgo_func$qiNnn6Cbm3GtDp4gDI4U_DRV3h8zlz91s9jrfOXC--U", align 8 br label %_llgo_88 @@ -3375,6 +3388,7 @@ _llgo_88: ; preds = %_llgo_87, %_llgo_86 _llgo_89: ; preds = %_llgo_62 %1769 = call ptr @"github.com/goplus/llgo/internal/runtime.PointerTo"(ptr %864) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %1769) store ptr %1769, ptr @"*_llgo_github.com/goplus/llgo/internal/abi.MapType", align 8 br label %_llgo_90 @@ -3406,6 +3420,7 @@ _llgo_91: ; preds = %_llgo_90 store i64 1, ptr %1784, align 4 %1785 = load %"github.com/goplus/llgo/internal/runtime.Slice", ptr %1781, align 8 %1786 = call ptr @"github.com/goplus/llgo/internal/runtime.Func"(%"github.com/goplus/llgo/internal/runtime.Slice" %1778, %"github.com/goplus/llgo/internal/runtime.Slice" %1785, i1 false) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %1786) store ptr %1786, ptr @"_llgo_func$d-NlqnjcQnaMjsBQY7qh2SWQmHb0XIigoceXdiJ8YT4", align 8 br label %_llgo_92 @@ -3568,6 +3583,7 @@ _llgo_92: ; preds = %_llgo_91, %_llgo_90 _llgo_93: ; preds = %_llgo_42 %1881 = call ptr @"github.com/goplus/llgo/internal/runtime.PointerTo"(ptr %593) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %1881) store ptr %1881, ptr @"*_llgo_github.com/goplus/llgo/internal/abi.InterfaceType", align 8 br label %_llgo_94 @@ -3599,6 +3615,7 @@ _llgo_95: ; preds = %_llgo_94 store i64 1, ptr %1896, align 4 %1897 = load %"github.com/goplus/llgo/internal/runtime.Slice", ptr %1893, align 8 %1898 = call ptr @"github.com/goplus/llgo/internal/runtime.Func"(%"github.com/goplus/llgo/internal/runtime.Slice" %1890, %"github.com/goplus/llgo/internal/runtime.Slice" %1897, i1 false) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %1898) store ptr %1898, ptr @"_llgo_func$1QmforOaCy2fBAssC2y1FWCCT6fpq9RKwP2j2HIASY8", align 8 br label %_llgo_96 @@ -3848,6 +3865,7 @@ _llgo_96: ; preds = %_llgo_95, %_llgo_94 _llgo_97: ; preds = %_llgo_34 %2049 = call ptr @"github.com/goplus/llgo/internal/runtime.PointerTo"(ptr %431) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %2049) store ptr %2049, ptr @"*_llgo_github.com/goplus/llgo/internal/abi.FuncType", align 8 br label %_llgo_98 @@ -3879,6 +3897,7 @@ _llgo_99: ; preds = %_llgo_98 store i64 1, ptr %2064, align 4 %2065 = load %"github.com/goplus/llgo/internal/runtime.Slice", ptr %2061, align 8 %2066 = call ptr @"github.com/goplus/llgo/internal/runtime.Func"(%"github.com/goplus/llgo/internal/runtime.Slice" %2058, %"github.com/goplus/llgo/internal/runtime.Slice" %2065, i1 false) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %2066) store ptr %2066, ptr @"_llgo_func$DsoxgOnxqV7tLvokF3AA14v1gtHsHaThoC8Q_XGcQww", align 8 br label %_llgo_100 @@ -4139,6 +4158,7 @@ _llgo_100: ; preds = %_llgo_99, %_llgo_98 _llgo_101: ; preds = %_llgo_24 %2225 = call ptr @"github.com/goplus/llgo/internal/runtime.PointerTo"(ptr %301) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %2225) store ptr %2225, ptr @"*_llgo_github.com/goplus/llgo/internal/abi.ArrayType", align 8 br label %_llgo_102 @@ -4170,6 +4190,7 @@ _llgo_103: ; preds = %_llgo_102 store i64 1, ptr %2240, align 4 %2241 = load %"github.com/goplus/llgo/internal/runtime.Slice", ptr %2237, align 8 %2242 = call ptr @"github.com/goplus/llgo/internal/runtime.Func"(%"github.com/goplus/llgo/internal/runtime.Slice" %2234, %"github.com/goplus/llgo/internal/runtime.Slice" %2241, i1 false) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %2242) store ptr %2242, ptr @"_llgo_func$CsVqlCxhoEcIvPD5BSBukfSiD9C7Ic5_Gf32MLbCWB4", align 8 br label %_llgo_104 @@ -4534,6 +4555,8 @@ declare ptr @"github.com/goplus/llgo/internal/runtime.AllocU"(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.SetDirectIface"(ptr) + declare ptr @"github.com/goplus/llgo/internal/runtime.Func"(%"github.com/goplus/llgo/internal/runtime.Slice", %"github.com/goplus/llgo/internal/runtime.Slice", i1) declare i64 @"github.com/goplus/llgo/internal/abi.(*Type).Align"(ptr) diff --git a/cl/_testrt/any/out.ll b/cl/_testrt/any/out.ll index 7e6c5432..088408a5 100644 --- a/cl/_testrt/any/out.ll +++ b/cl/_testrt/any/out.ll @@ -138,6 +138,7 @@ _llgo_2: ; preds = %_llgo_1, %_llgo_0 _llgo_3: ; preds = %_llgo_2 %5 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 35) %6 = call ptr @"github.com/goplus/llgo/internal/runtime.PointerTo"(ptr %5) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %6) store ptr %6, ptr @"*_llgo_int8", align 8 br label %_llgo_4 @@ -169,6 +170,8 @@ declare ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64) declare ptr @"github.com/goplus/llgo/internal/runtime.PointerTo"(ptr) +declare void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr) + declare ptr @"github.com/goplus/llgo/internal/runtime.AllocU"(i64) declare void @"github.com/goplus/llgo/internal/runtime.Panic"(%"github.com/goplus/llgo/internal/runtime.eface") diff --git a/cl/_testrt/eface/out.ll b/cl/_testrt/eface/out.ll index 192248ed..5b45fc89 100644 --- a/cl/_testrt/eface/out.ll +++ b/cl/_testrt/eface/out.ll @@ -612,6 +612,7 @@ _llgo_31: ; preds = %_llgo_30 store i64 0, ptr %58, align 4 %59 = load %"github.com/goplus/llgo/internal/runtime.Slice", ptr %55, align 8 %60 = call ptr @"github.com/goplus/llgo/internal/runtime.Func"(%"github.com/goplus/llgo/internal/runtime.Slice" %53, %"github.com/goplus/llgo/internal/runtime.Slice" %59, i1 false) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %60) store ptr %60, ptr @"_llgo_func$2_iS07vIlF2_rZqWB5eU0IvP_9HviM4MYZNkXZDvbac", align 8 br label %_llgo_32 @@ -623,6 +624,7 @@ _llgo_32: ; preds = %_llgo_31, %_llgo_30 _llgo_33: ; preds = %_llgo_32 %63 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 34) %64 = call ptr @"github.com/goplus/llgo/internal/runtime.PointerTo"(ptr %63) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %64) store ptr %64, ptr @"*_llgo_int", align 8 br label %_llgo_34 @@ -782,6 +784,8 @@ declare ptr @"github.com/goplus/llgo/internal/runtime.AllocU"(i64) declare ptr @"github.com/goplus/llgo/internal/runtime.Func"(%"github.com/goplus/llgo/internal/runtime.Slice", %"github.com/goplus/llgo/internal/runtime.Slice", i1) +declare void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr) + declare ptr @"github.com/goplus/llgo/internal/runtime.PointerTo"(ptr) declare ptr @"github.com/goplus/llgo/internal/runtime.SliceOf"(ptr) diff --git a/cl/_testrt/makemap/out.ll b/cl/_testrt/makemap/out.ll index 72a84eba..67f1573f 100644 --- a/cl/_testrt/makemap/out.ll +++ b/cl/_testrt/makemap/out.ll @@ -1091,6 +1091,7 @@ _llgo_1: ; preds = %_llgo_0 %60 = load %"github.com/goplus/llgo/internal/runtime.Slice", ptr %56, align 8 %61 = call ptr @"github.com/goplus/llgo/internal/runtime.Struct"(%"github.com/goplus/llgo/internal/runtime.String" %50, i64 208, %"github.com/goplus/llgo/internal/runtime.Slice" %60) %62 = call ptr @"github.com/goplus/llgo/internal/runtime.MapOf"(ptr %2, ptr %3, ptr %61, i64 4) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %62) store ptr %62, ptr @"map[_llgo_int]_llgo_string", align 8 br label %_llgo_2 @@ -1186,6 +1187,7 @@ _llgo_3: ; preds = %_llgo_2 %123 = load %"github.com/goplus/llgo/internal/runtime.Slice", ptr %119, align 8 %124 = call ptr @"github.com/goplus/llgo/internal/runtime.Struct"(%"github.com/goplus/llgo/internal/runtime.String" %113, i64 208, %"github.com/goplus/llgo/internal/runtime.Slice" %123) %125 = call ptr @"github.com/goplus/llgo/internal/runtime.MapOf"(ptr %65, ptr %66, ptr %124, i64 12) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %125) store ptr %125, ptr @"map[_llgo_string]_llgo_int", align 8 br label %_llgo_4 @@ -1333,6 +1335,7 @@ _llgo_7: ; preds = %_llgo_6 %217 = load %"github.com/goplus/llgo/internal/runtime.Slice", ptr %213, align 8 %218 = call ptr @"github.com/goplus/llgo/internal/runtime.Struct"(%"github.com/goplus/llgo/internal/runtime.String" %207, i64 208, %"github.com/goplus/llgo/internal/runtime.Slice" %217) %219 = call ptr @"github.com/goplus/llgo/internal/runtime.MapOf"(ptr %145, ptr %146, ptr %218, i64 24) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %219) store ptr %219, ptr @"map[_llgo_any]_llgo_int", align 8 br label %_llgo_8 @@ -1515,6 +1518,7 @@ _llgo_26: ; preds = %_llgo_25, %_llgo_24 _llgo_27: ; preds = %_llgo_26 %303 = call ptr @"github.com/goplus/llgo/internal/runtime.NewNamed"(i64 17, i64 0, i64 0) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %303) store ptr %303, ptr @_llgo_main.K2, align 8 br label %_llgo_28 @@ -1525,6 +1529,7 @@ _llgo_28: ; preds = %_llgo_27, %_llgo_26 _llgo_29: ; preds = %_llgo_28 %306 = call ptr @"github.com/goplus/llgo/internal/runtime.PointerTo"(ptr %245) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %306) store ptr %306, ptr @"*_llgo_main.N", align 8 br label %_llgo_30 @@ -1537,6 +1542,7 @@ _llgo_30: ; preds = %_llgo_29, %_llgo_28 _llgo_31: ; preds = %_llgo_30 %310 = call ptr @"github.com/goplus/llgo/internal/runtime.PointerTo"(ptr %245) %311 = call ptr @"github.com/goplus/llgo/internal/runtime.ArrayOf"(i64 1, ptr %310) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %311) store ptr %311, ptr @"[1]*_llgo_main.N", align 8 br label %_llgo_32 @@ -1574,6 +1580,7 @@ _llgo_35: ; preds = %_llgo_34 %326 = load %"github.com/goplus/llgo/internal/runtime.String", ptr %323, align 8 %327 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 34) %328 = call ptr @"github.com/goplus/llgo/internal/runtime.ChanOf"(i64 3, %"github.com/goplus/llgo/internal/runtime.String" %326, ptr %327) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %328) store ptr %328, ptr @"chan _llgo_int", align 8 br label %_llgo_36 @@ -1683,6 +1690,7 @@ _llgo_37: ; preds = %_llgo_36 %399 = load %"github.com/goplus/llgo/internal/runtime.Slice", ptr %395, align 8 %400 = call ptr @"github.com/goplus/llgo/internal/runtime.Struct"(%"github.com/goplus/llgo/internal/runtime.String" %389, i64 144, %"github.com/goplus/llgo/internal/runtime.Slice" %399) %401 = call ptr @"github.com/goplus/llgo/internal/runtime.MapOf"(ptr %336, ptr %337, ptr %400, i64 4) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %401) store ptr %401, ptr @"map[chan _llgo_int]_llgo_int", align 8 br label %_llgo_38 @@ -1702,6 +1710,8 @@ declare ptr @"github.com/goplus/llgo/internal/runtime.ArrayOf"(i64, ptr) declare ptr @"github.com/goplus/llgo/internal/runtime.AllocU"(i64) +declare void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr) + declare ptr @"github.com/goplus/llgo/internal/runtime.MakeMap"(ptr, i64) declare ptr @"github.com/goplus/llgo/internal/runtime.MapAssign"(ptr, ptr, ptr) diff --git a/cl/_testrt/map/out.ll b/cl/_testrt/map/out.ll index 0097ae17..7d84bf77 100644 --- a/cl/_testrt/map/out.ll +++ b/cl/_testrt/map/out.ll @@ -152,6 +152,7 @@ _llgo_1: ; preds = %_llgo_0 %60 = load %"github.com/goplus/llgo/internal/runtime.Slice", ptr %56, align 8 %61 = call ptr @"github.com/goplus/llgo/internal/runtime.Struct"(%"github.com/goplus/llgo/internal/runtime.String" %50, i64 144, %"github.com/goplus/llgo/internal/runtime.Slice" %60) %62 = call ptr @"github.com/goplus/llgo/internal/runtime.MapOf"(ptr %2, ptr %3, ptr %61, i64 4) + call void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr %62) store ptr %62, ptr @"map[_llgo_int]_llgo_int", align 8 br label %_llgo_2 @@ -171,6 +172,8 @@ declare ptr @"github.com/goplus/llgo/internal/runtime.ArrayOf"(i64, ptr) declare ptr @"github.com/goplus/llgo/internal/runtime.AllocU"(i64) +declare void @"github.com/goplus/llgo/internal/runtime.SetDirectIface"(ptr) + declare ptr @"github.com/goplus/llgo/internal/runtime.MakeMap"(ptr, i64) declare ptr @"github.com/goplus/llgo/internal/runtime.MapAssign"(ptr, ptr, ptr) diff --git a/internal/runtime/z_face.go b/internal/runtime/z_face.go index 5231b4b3..dd496f70 100644 --- a/internal/runtime/z_face.go +++ b/internal/runtime/z_face.go @@ -410,6 +410,10 @@ func (v eface) Elem() eface { panic("invalid eface elem") } +func SetDirectIface(t *abi.Type) { + t.Kind_ |= abi.KindDirectIface +} + func isDirectIface(t *_type) bool { return t.Kind_&abi.KindDirectIface != 0 } diff --git a/ssa/abitype.go b/ssa/abitype.go index cbb4769a..8dd2a9bd 100644 --- a/ssa/abitype.go +++ b/ssa/abitype.go @@ -366,6 +366,10 @@ func (p Package) abiTypeInit(g Global, t types.Type, pub bool) { b.SetBlockEx(blks[0], AtEnd, false) } vexpr := tabi() + prog := p.Prog + if kind, _, _ := abi.DataKindOf(t, 0, prog.is32Bits); kind == abi.Pointer { + b.InlineCall(b.Pkg.rtFunc("SetDirectIface"), vexpr) + } b.Store(expr, vexpr) if pub { b.Jump(blks[1])