Skip to content

Commit 8e77b05

Browse files
committed
Add llgo.useiface metadata emission
1 parent 1398fa6 commit 8e77b05

File tree

49 files changed

+406
-3
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+406
-3
lines changed

cl/_testdata/foo/out.ll

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,8 @@ declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"gi
121121
declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8)
122122

123123
attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) }
124+
125+
!llgo.useiface = !{!0, !1}
126+
127+
!0 = !{ptr @"github.com/goplus/llgo/cl/_testdata/foo.Bar", ptr @"_llgo_struct$K-dZ9QotZfVPz2a0YdRa9vmZUuDXPTqZOlMShKEDJtk"}
128+
!1 = !{ptr @"github.com/goplus/llgo/cl/_testdata/foo.F", ptr @"github.com/goplus/llgo/cl/_testdata/foo.struct$MYpsoM99ZwFY087IpUOkIw1zjBA_sgFXVodmn1m-G88"}

cl/_testdata/print/out.ll

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1206,3 +1206,21 @@ _llgo_0:
12061206
}
12071207

12081208
declare %"github.com/goplus/llgo/runtime/internal/runtime.Slice" @"github.com/goplus/llgo/runtime/internal/runtime.NewSlice3"(ptr, i64, i64, i64, i64, i64)
1209+
1210+
!llgo.useiface = !{!0, !1, !2, !3, !4, !5, !6, !7, !8, !9, !10, !11, !12, !13, !14}
1211+
1212+
!0 = !{ptr @"github.com/goplus/llgo/cl/_testdata/print.main", ptr @_llgo_float32}
1213+
!1 = !{ptr @"github.com/goplus/llgo/cl/_testdata/print.main", ptr @_llgo_float64}
1214+
!2 = !{ptr @"github.com/goplus/llgo/cl/_testdata/print.main", ptr @_llgo_string}
1215+
!3 = !{ptr @"github.com/goplus/llgo/cl/_testdata/print.main", ptr @_llgo_bool}
1216+
!4 = !{ptr @"github.com/goplus/llgo/cl/_testdata/print.main", ptr @_llgo_int32}
1217+
!5 = !{ptr @"github.com/goplus/llgo/cl/_testdata/print.main", ptr @_llgo_int8}
1218+
!6 = !{ptr @"github.com/goplus/llgo/cl/_testdata/print.main", ptr @_llgo_int16}
1219+
!7 = !{ptr @"github.com/goplus/llgo/cl/_testdata/print.main", ptr @_llgo_int64}
1220+
!8 = !{ptr @"github.com/goplus/llgo/cl/_testdata/print.main", ptr @_llgo_int}
1221+
!9 = !{ptr @"github.com/goplus/llgo/cl/_testdata/print.main", ptr @_llgo_uint8}
1222+
!10 = !{ptr @"github.com/goplus/llgo/cl/_testdata/print.main", ptr @_llgo_uint16}
1223+
!11 = !{ptr @"github.com/goplus/llgo/cl/_testdata/print.main", ptr @_llgo_uint32}
1224+
!12 = !{ptr @"github.com/goplus/llgo/cl/_testdata/print.main", ptr @_llgo_uint64}
1225+
!13 = !{ptr @"github.com/goplus/llgo/cl/_testdata/print.main", ptr @_llgo_uintptr}
1226+
!14 = !{ptr @"github.com/goplus/llgo/cl/_testdata/print.main", ptr @_llgo_complex128}

cl/_testdata/vargs/out.ll

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,3 +120,8 @@ declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64)
120120
declare void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"(%"github.com/goplus/llgo/runtime/internal/runtime.eface")
121121

122122
declare i32 @printf(ptr, ...)
123+
124+
!llgo.useiface = !{!0, !1}
125+
126+
!0 = !{ptr @"github.com/goplus/llgo/cl/_testdata/vargs.main", ptr @_llgo_int}
127+
!1 = !{ptr @"github.com/goplus/llgo/cl/_testdata/vargs.test", ptr @_llgo_string}

cl/_testgo/abimethod/out.ll

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1756,3 +1756,33 @@ _llgo_0:
17561756
}
17571757

17581758
attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) }
1759+
1760+
!llgo.useiface = !{!0, !1, !2, !3, !4, !5, !6, !7, !8, !9, !10, !11, !12, !13, !14, !15, !16, !17, !18, !19, !20, !21, !22, !23, !24, !25, !26}
1761+
1762+
!0 = !{ptr @"github.com/goplus/llgo/cl/_testgo/abimethod.testAnonymous1", ptr @"*github.com/goplus/llgo/cl/_testgo/abimethod.struct$mRfo5gQx8vKF1DvrL24XRoyvI_ttVDcwc1JYMRxWfb8"}
1763+
!1 = !{ptr @"github.com/goplus/llgo/cl/_testgo/abimethod.testAnonymous1", ptr @_llgo_string}
1764+
!2 = !{ptr @"github.com/goplus/llgo/cl/_testgo/abimethod.testAnonymous2", ptr @"github.com/goplus/llgo/cl/_testgo/abimethod.struct$mRfo5gQx8vKF1DvrL24XRoyvI_ttVDcwc1JYMRxWfb8"}
1765+
!3 = !{ptr @"github.com/goplus/llgo/cl/_testgo/abimethod.testAnonymous2", ptr @_llgo_string}
1766+
!4 = !{ptr @"github.com/goplus/llgo/cl/_testgo/abimethod.testAnonymous3", ptr @"github.com/goplus/llgo/cl/_testgo/abimethod.struct$F3FioEGWwXQRUdV6xoxVUEDjRNgBQIpL0XIyBECp088"}
1767+
!5 = !{ptr @"github.com/goplus/llgo/cl/_testgo/abimethod.testAnonymous3", ptr @_llgo_string}
1768+
!6 = !{ptr @"github.com/goplus/llgo/cl/_testgo/abimethod.testAnonymous4", ptr @"*github.com/goplus/llgo/cl/_testgo/abimethod.struct$F3FioEGWwXQRUdV6xoxVUEDjRNgBQIpL0XIyBECp088"}
1769+
!7 = !{ptr @"github.com/goplus/llgo/cl/_testgo/abimethod.testAnonymous4", ptr @_llgo_string}
1770+
!8 = !{ptr @"github.com/goplus/llgo/cl/_testgo/abimethod.testAnonymous5", ptr @"*github.com/goplus/llgo/cl/_testgo/abimethod.struct$F3FioEGWwXQRUdV6xoxVUEDjRNgBQIpL0XIyBECp088"}
1771+
!9 = !{ptr @"github.com/goplus/llgo/cl/_testgo/abimethod.testAnonymous5", ptr @_llgo_string}
1772+
!10 = !{ptr @"github.com/goplus/llgo/cl/_testgo/abimethod.testAnonymous6", ptr @"github.com/goplus/llgo/cl/_testgo/abimethod.struct$mRfo5gQx8vKF1DvrL24XRoyvI_ttVDcwc1JYMRxWfb8"}
1773+
!11 = !{ptr @"github.com/goplus/llgo/cl/_testgo/abimethod.testAnonymous6", ptr @_llgo_string}
1774+
!12 = !{ptr @"github.com/goplus/llgo/cl/_testgo/abimethod.testAnonymous7", ptr @"github.com/goplus/llgo/cl/_testgo/abimethod.struct$mRfo5gQx8vKF1DvrL24XRoyvI_ttVDcwc1JYMRxWfb8"}
1775+
!13 = !{ptr @"github.com/goplus/llgo/cl/_testgo/abimethod.testAnonymous7", ptr @_llgo_string}
1776+
!14 = !{ptr @"github.com/goplus/llgo/cl/_testgo/abimethod.testAnonymous8", ptr @"github.com/goplus/llgo/cl/_testgo/abimethod.struct$mRfo5gQx8vKF1DvrL24XRoyvI_ttVDcwc1JYMRxWfb8"}
1777+
!15 = !{ptr @"github.com/goplus/llgo/cl/_testgo/abimethod.testAnonymous8", ptr @_llgo_string}
1778+
!16 = !{ptr @"github.com/goplus/llgo/cl/_testgo/abimethod.testAnonymousBuffer", ptr @"*github.com/goplus/llgo/cl/_testgo/abimethod.struct$RGW016k7zllXgGPm1CvD5-IBe-9lphOOTCFtYyDGLjY"}
1779+
!17 = !{ptr @"github.com/goplus/llgo/cl/_testgo/abimethod.testAnonymousBuffer", ptr @_llgo_string}
1780+
!18 = !{ptr @"github.com/goplus/llgo/cl/_testgo/abimethod.testGeneric", ptr @"*_llgo_github.com/goplus/llgo/cl/_testgo/abimethod.Pointer[any]"}
1781+
!19 = !{ptr @"github.com/goplus/llgo/cl/_testgo/abimethod.testGeneric", ptr @_llgo_string}
1782+
!20 = !{ptr @"github.com/goplus/llgo/cl/_testgo/abimethod.testGeneric$1", ptr @_llgo_int}
1783+
!21 = !{ptr @"github.com/goplus/llgo/cl/_testgo/abimethod.testNamed1", ptr @"*_llgo_github.com/goplus/llgo/cl/_testgo/abimethod.T"}
1784+
!22 = !{ptr @"github.com/goplus/llgo/cl/_testgo/abimethod.testNamed1", ptr @_llgo_string}
1785+
!23 = !{ptr @"github.com/goplus/llgo/cl/_testgo/abimethod.testNamed2", ptr @"_llgo_github.com/goplus/llgo/cl/_testgo/abimethod.T"}
1786+
!24 = !{ptr @"github.com/goplus/llgo/cl/_testgo/abimethod.testNamed2", ptr @_llgo_string}
1787+
!25 = !{ptr @"github.com/goplus/llgo/cl/_testgo/abimethod.testNamed3", ptr @"*_llgo_github.com/goplus/llgo/cl/_testgo/abimethod.T"}
1788+
!26 = !{ptr @"github.com/goplus/llgo/cl/_testgo/abimethod.testNamed3", ptr @_llgo_string}

cl/_testgo/closureall/out.ll

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,3 +274,8 @@ _llgo_0:
274274
declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfacePtrData"(%"github.com/goplus/llgo/runtime/internal/runtime.iface")
275275

276276
attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) }
277+
278+
!llgo.useiface = !{!0, !1}
279+
280+
!0 = !{ptr @"github.com/goplus/llgo/cl/_testgo/closureall.main", ptr @"*_llgo_github.com/goplus/llgo/cl/_testgo/closureall.S"}
281+
!1 = !{ptr @"github.com/goplus/llgo/cl/_testgo/closureall.main", ptr @_llgo_string}

cl/_testgo/embedunexport-1598/out.ll

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,3 +174,7 @@ declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"gi
174174
declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8)
175175

176176
attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) }
177+
178+
!llgo.useiface = !{!0}
179+
180+
!0 = !{ptr @"github.com/goplus/llgo/cl/_testgo/embedunexport-1598.main", ptr @"*_llgo_github.com/goplus/llgo/cl/_testgo/embedunexport-1598.Wrapped"}

cl/_testgo/equal/out.ll

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,3 +525,14 @@ _llgo_0:
525525
declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.MakeMap"(ptr, i64)
526526

527527
attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) }
528+
529+
!llgo.useiface = !{!0, !1, !2, !3, !4, !5, !6, !7}
530+
531+
!0 = !{ptr @"github.com/goplus/llgo/cl/_testgo/equal.assert", ptr @_llgo_string}
532+
!1 = !{ptr @"github.com/goplus/llgo/cl/_testgo/equal.init#3", ptr @_llgo_int}
533+
!2 = !{ptr @"github.com/goplus/llgo/cl/_testgo/equal.init#3", ptr @_llgo_string}
534+
!3 = !{ptr @"github.com/goplus/llgo/cl/_testgo/equal.init#5", ptr @_llgo_int}
535+
!4 = !{ptr @"github.com/goplus/llgo/cl/_testgo/equal.init#5", ptr @"_llgo_struct$n1H8J_3prDN3firMwPxBLVTkE5hJ9Di-AqNvaC9jczw"}
536+
!5 = !{ptr @"github.com/goplus/llgo/cl/_testgo/equal.init#5", ptr @"_llgo_github.com/goplus/llgo/cl/_testgo/equal.T"}
537+
!6 = !{ptr @"github.com/goplus/llgo/cl/_testgo/equal.init#5", ptr @_llgo_string}
538+
!7 = !{ptr @"github.com/goplus/llgo/cl/_testgo/equal.init#5", ptr @"_llgo_github.com/goplus/llgo/cl/_testgo/equal.N"}

cl/_testgo/errors/out.ll

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,3 +123,7 @@ declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8)
123123
declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfacePtrData"(%"github.com/goplus/llgo/runtime/internal/runtime.iface")
124124

125125
declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String")
126+
127+
!llgo.useiface = !{!0}
128+
129+
!0 = !{ptr @"github.com/goplus/llgo/cl/_testgo/errors.New", ptr @"*_llgo_github.com/goplus/llgo/cl/_testgo/errors.errorString"}

cl/_testgo/ifaceconv/out.ll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,3 +471,9 @@ declare i1 @"github.com/goplus/llgo/runtime/internal/runtime.EfaceEqual"(%"githu
471471
declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String")
472472

473473
declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8)
474+
475+
!llgo.useiface = !{!0, !1, !2}
476+
477+
!0 = !{ptr @"github.com/goplus/llgo/cl/_testgo/ifaceconv.main", ptr @_llgo_string}
478+
!1 = !{ptr @"github.com/goplus/llgo/cl/_testgo/ifaceconv.main", ptr @"_llgo_github.com/goplus/llgo/cl/_testgo/ifaceconv.C1"}
479+
!2 = !{ptr @"github.com/goplus/llgo/cl/_testgo/ifaceconv.main", ptr @"_llgo_github.com/goplus/llgo/cl/_testgo/ifaceconv.C2"}

cl/_testgo/ifaceprom/out.ll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,3 +480,9 @@ declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"gi
480480
declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8)
481481

482482
attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) }
483+
484+
!llgo.useiface = !{!0, !1, !2}
485+
486+
!0 = !{ptr @"github.com/goplus/llgo/cl/_testgo/ifaceprom.main", ptr @"_llgo_github.com/goplus/llgo/cl/_testgo/ifaceprom.impl"}
487+
!1 = !{ptr @"github.com/goplus/llgo/cl/_testgo/ifaceprom.main", ptr @_llgo_int}
488+
!2 = !{ptr @"github.com/goplus/llgo/cl/_testgo/ifaceprom.main", ptr @_llgo_string}

0 commit comments

Comments
 (0)