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)
| 677 | // method-set field ({ uintptr, [N x ptr] }). Returns nil if field is not a |
| 678 | // method set. |
| 679 | func (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. |
no test coverage detected