cl: process all go directives

This commit is contained in:
Li Jie
2025-01-11 16:47:23 +08:00
parent 6048693423
commit 6b11c100ba
2 changed files with 34 additions and 12 deletions

View File

@@ -187,6 +187,10 @@ func isCgoExternSymbol(f *ssa.Function) bool {
return isCgoCfunc(name) || isCgoCmacro(name)
}
func isCgoCfpvar(name string) bool {
return strings.HasPrefix(name, "_Cfpvar_")
}
func isCgoCfunc(name string) bool {
return strings.HasPrefix(name, "_Cfunc_")
}
@@ -1066,7 +1070,9 @@ func processPkg(ctx *context, ret llssa.Package, pkg *ssa.Package) {
case *ssa.Type:
ctx.compileType(ret, member)
case *ssa.Global:
ctx.compileGlobal(ret, member)
if !isCgoVar(member.Name()) {
ctx.compileGlobal(ret, member)
}
}
}