MCPcopy Index your code
hub / github.com/tinygo-org/tinygo / extractMethodSigs

Method extractMethodSigs

transform/interface-lowering.go:679–692  ·  view source on GitHub ↗

extractMethodSigs returns the names of method signature globals inside a method-set field ({ uintptr, [N x ptr] }). Returns nil if field is not a method set.

(field llvm.Value)

Source from the content-addressed store, hash-verified

677// method-set field ({ uintptr, [N x ptr] }). Returns nil if field is not a
678// method set.
679func (p *lowerInterfacesPass) extractMethodSigs(field llvm.Value) []string {
680 if !p.isMethodSetType(field.Type()) {
681 return nil
682 }
683 methodArray := p.builder.CreateExtractValue(field, 1, "")
684 n := methodArray.Type().ArrayLength()
685 sigs := make([]string, 0, n)
686 for j := 0; j < n; j++ {
687 sig := p.builder.CreateExtractValue(methodArray, j, "")
688 sig = stripPointerCasts(sig)
689 sigs = append(sigs, sig.Name())
690 }
691 return sigs
692}
693
694// filterMethodSet processes a type-descriptor field that may be a method set.
695// Non-method-set fields are returned unchanged.

Callers 1

runMethod · 0.95

Calls 4

isMethodSetTypeMethod · 0.95
stripPointerCastsFunction · 0.85
NameMethod · 0.65
TypeMethod · 0.45

Tested by

no test coverage detected