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

@@ -196,8 +196,6 @@ func (p *context) initFiles(pkgPath string, files []*ast.File) {
p.collectSkipNames(line)
}
}
case token.TYPE:
handleTypeDecl(p.prog, p.goTyps, decl)
}
}
}
@@ -568,9 +566,7 @@ func handleTypeDecl(prog llssa.Program, pkg *types.Package, decl *ast.GenDecl) {
if len(decl.Specs) == 1 {
if bg := typeBackground(decl.Doc); bg != "" {
inPkgName := decl.Specs[0].(*ast.TypeSpec).Name.Name
if obj := pkg.Scope().Lookup(inPkgName); obj != nil {
prog.Type(obj.Type(), toBackground(bg))
}
prog.SetTypeBackground(pkg.Path()+"."+inPkgName, toBackground(bg))
}
}
}