cl: interface support __llgo_va_list

This commit is contained in:
visualfc
2025-09-09 13:20:01 +08:00
parent 89af430329
commit fd17a43ade
6 changed files with 451 additions and 22 deletions

View File

@@ -537,6 +537,9 @@ func isAllocVargs(ctx *context, v *ssa.Alloc) bool {
default:
return false
}
if call.IsInvoke() {
return llssa.HasNameValist(call.Signature())
}
return ctx.funcKind(call.Value) == fnHasVArg
}
}
@@ -936,7 +939,9 @@ func (p *context) compileVArg(ret []llssa.Expr, b llssa.Builder, v ssa.Value) []
return ret
}
case *ssa.Parameter:
return ret
if llssa.HasNameValist(v.Parent().Signature) {
return ret
}
}
panic(fmt.Sprintf("compileVArg: unknown value - %T\n", v))
}