compiler: don't try to get pointer methods

I don't know why this was ever needed, but it seems to be incorrect and
unnecessary.
Этот коммит содержится в:
Ayke van Laethem 2018-09-06 20:04:41 +02:00
родитель 0f83c3b3c6
коммит 30ac6ec281
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: E97FF5335DFDFDED

Просмотреть файл

@ -721,22 +721,13 @@ func (c *Compiler) getDIType(typ types.Type) (llvm.Metadata, error) {
} }
} }
// Get all methods of a type: both value receivers and pointer receivers. // Get all methods of a type.
func getAllMethods(prog *ssa.Program, typ types.Type) []*types.Selection { func getAllMethods(prog *ssa.Program, typ types.Type) []*types.Selection {
var methods []*types.Selection
// value receivers
ms := prog.MethodSets.MethodSet(typ) ms := prog.MethodSets.MethodSet(typ)
methods := make([]*types.Selection, ms.Len())
for i := 0; i < ms.Len(); i++ { for i := 0; i < ms.Len(); i++ {
methods = append(methods, ms.At(i)) methods[i] = ms.At(i)
} }
// pointer receivers
ms = prog.MethodSets.MethodSet(types.NewPointer(typ))
for i := 0; i < ms.Len(); i++ {
methods = append(methods, ms.At(i))
}
return methods return methods
} }