cgo: supports c/go callback funcs

This commit is contained in:
Li Jie
2024-11-26 22:34:19 +08:00
parent 5380ffa471
commit 90763de93c
12 changed files with 162 additions and 84 deletions

View File

@@ -117,6 +117,10 @@ func (g Global) InitNil() {
g.impl.SetInitializer(llvm.ConstNull(g.impl.GlobalValueType()))
}
func (g Global) ReplaceAllUsesWith(v Expr) {
g.impl.ReplaceAllUsesWith(v.impl)
}
// -----------------------------------------------------------------------------
// Function represents the parameters, results, and code of a function

View File

@@ -59,6 +59,15 @@ func (v Expr) SetOrdering(ordering AtomicOrdering) Expr {
return v
}
func (v Expr) SetName(alias string) Expr {
v.impl.SetName(alias)
return v
}
func (v Expr) Name() string {
return v.impl.Name()
}
// -----------------------------------------------------------------------------
type builtinTy struct {