build: fix unsafe.Sizeof for llgo:type C

This commit is contained in:
visualfc
2024-07-16 13:55:48 +08:00
parent 21a2f71ad9
commit 830c40440f
11 changed files with 283 additions and 168 deletions

View File

@@ -26,12 +26,14 @@ import (
// -----------------------------------------------------------------------------
type goTypes struct {
typs map[unsafe.Pointer]unsafe.Pointer
typs map[unsafe.Pointer]unsafe.Pointer
typbg map[string]Background
}
func newGoTypes() goTypes {
typs := make(map[unsafe.Pointer]unsafe.Pointer)
return goTypes{typs}
typbk := make(map[string]Background)
return goTypes{typs, typbk}
}
type Background int
@@ -93,6 +95,9 @@ func (p goTypes) cvtType(typ types.Type) (raw types.Type, cvt bool) {
case *types.Struct:
return p.cvtStruct(t)
case *types.Named:
if p.typbg[t.String()] == InC {
break
}
return p.cvtNamed(t)
case *types.Signature:
return p.cvtClosure(t), true