MCPcopy Create free account
hub / github.com/google/gapid / callArgs

Method callArgs

core/codegen/builder.go:113–135  ·  view source on GitHub ↗
(sig Signature, name string, args []*Value)

Source from the content-addressed store, hash-verified

111}
112
113func (b *Builder) callArgs(sig Signature, name string, args []*Value) []llvm.Value {
114 if sig.Variadic {
115 if g, e := len(args), len(sig.Parameters); g < e {
116 fail("Got %d arguments, but needed %d to call %v", g, e, sig.string(name))
117 }
118 } else if g, e := len(args), len(sig.Parameters); g != e {
119 fail("Got %d arguments, but needed %d to call %v", g, e, sig.string(name))
120 }
121 l := make([]llvm.Value, len(args))
122 for i, a := range args {
123 if a == nil {
124 fail("Argument %d is nil when attempting to call %v", i, sig.string(name))
125 }
126 l[i] = a.llvm
127 if i < len(sig.Parameters) {
128 if g, e := a.ty, sig.Parameters[i]; g != e {
129 fail("Incorrect argument type for parameter %d when calling %v: Got %v, expected %v",
130 i, sig.string(name), g.TypeName(), e.TypeName())
131 }
132 }
133 }
134 return l
135}
136
137// Parameter returns i'th function parameter
138func (b *Builder) Parameter(i int) *Value {

Callers 2

callMethod · 0.95
InvokeMethod · 0.95

Calls 3

stringMethod · 0.80
failFunction · 0.70
TypeNameMethod · 0.65

Tested by

no test coverage detected