cgo: support full cgo tags
This commit is contained in:
@@ -799,10 +799,6 @@ func (p *context) compileInstr(b llssa.Builder, instr ssa.Instruction) {
|
||||
}
|
||||
switch v := instr.(type) {
|
||||
case *ssa.Store:
|
||||
// skip cgo global variables
|
||||
if checkCgo(v.Addr.Name()) {
|
||||
// return
|
||||
}
|
||||
va := v.Addr
|
||||
if va, ok := va.(*ssa.IndexAddr); ok {
|
||||
if args, ok := p.isVArgs(va.X); ok { // varargs: this is a varargs store
|
||||
@@ -1083,10 +1079,6 @@ func processPkg(ctx *context, ret llssa.Package, pkg *ssa.Package) {
|
||||
case *ssa.Type:
|
||||
ctx.compileType(ret, member)
|
||||
case *ssa.Global:
|
||||
// skip cgo global variables
|
||||
if checkCgo(member.Name()) {
|
||||
// continue
|
||||
}
|
||||
ctx.compileGlobal(ret, member)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -438,13 +438,10 @@ func (p *context) funcName(fn *ssa.Function, ignore bool) (*types.Package, strin
|
||||
if checkCgo(fname) {
|
||||
return nil, fname, llgoInstr
|
||||
}
|
||||
if strings.HasPrefix(fname, "_Cfunc_") {
|
||||
if isCgoCfunc(fn) {
|
||||
if _, ok := llgoInstrs[fname]; ok {
|
||||
return nil, fname, llgoInstr
|
||||
}
|
||||
// fname = fname[7:]
|
||||
// fn.WriteTo(os.Stdout)
|
||||
// return nil, fname, cFunc
|
||||
}
|
||||
if fnPkg := fn.Pkg; fnPkg != nil {
|
||||
pkg = fnPkg.Pkg
|
||||
|
||||
Reference in New Issue
Block a user