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

Method Index

core/codegen/value.go:194–200  ·  view source on GitHub ↗

Index returns a new pointer to the array or field element found by following the list of indices as specified by path.

(path ...ValueIndexOrName)

Source from the content-addressed store, hash-verified

192// Index returns a new pointer to the array or field element found by following
193// the list of indices as specified by path.
194func (v *Value) Index(path ...ValueIndexOrName) *Value {
195 if !IsPointer(v.ty) {
196 fail("Index only works with pointer value types. Got %v", v.Type().TypeName())
197 }
198 indices, name, target := v.b.path(v.Type(), v.Name(), path...)
199 return v.b.val(v.b.m.Types.Pointer(target), v.b.llvm.CreateGEP(v.llvm, indices, "")).SetName(name)
200}
201
202// Insert creates a copy of the struct or array v with the field/element at
203// changed to val.

Callers 1

packAnyMethod · 0.95

Calls 9

TypeMethod · 0.95
NameMethod · 0.95
IsPointerFunction · 0.85
SetNameMethod · 0.80
failFunction · 0.70
TypeNameMethod · 0.65
pathMethod · 0.45
valMethod · 0.45
PointerMethod · 0.45

Tested by

no test coverage detected