CallIndirect invokes the function pointer f with the specified arguments
(f *Value, args ...*Value)
| 56 | |
| 57 | // CallIndirect invokes the function pointer f with the specified arguments |
| 58 | func (b *Builder) CallIndirect(f *Value, args ...*Value) *Value { |
| 59 | var fty *FunctionType |
| 60 | if ptrTy, ok := Underlying(f.Type()).(Pointer); ok { |
| 61 | fty, _ = Underlying(ptrTy.Element).(*FunctionType) |
| 62 | } |
| 63 | if fty == nil { |
| 64 | fail("CallIndirect() can only be called with function pointers. Got %v", f.Type()) |
| 65 | } |
| 66 | return b.call(f.llvm, fty.Signature, f.name, args) |
| 67 | } |
| 68 | |
| 69 | func (b *Builder) call(fn llvm.Value, sig Signature, name string, args []*Value) *Value { |
| 70 | l := b.callArgs(sig, name, args) |
no test coverage detected