From: Austin Clements Date: Mon, 2 Oct 2017 21:31:43 +0000 (-0400) Subject: cmd/compile: rename (*Type).HasPointer to (*Type).HasHeapPointer X-Git-Tag: go1.10beta1~914 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=70258cc59f587749ec02d3645687efe2ee85f53f;p=gostls13.git cmd/compile: rename (*Type).HasPointer to (*Type).HasHeapPointer This method indicates whether a type contains any *heap* pointers, not just whether it contains any pointers. Rename the method to make this clear. Change-Id: Ifff143e2f02a820444ac26b84250495c0098cb33 Reviewed-on: https://go-review.googlesource.com/67690 Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot Reviewed-by: Cherry Zhang --- diff --git a/src/cmd/compile/internal/ssa/writebarrier.go b/src/cmd/compile/internal/ssa/writebarrier.go index 0daff45b43..129a06eecb 100644 --- a/src/cmd/compile/internal/ssa/writebarrier.go +++ b/src/cmd/compile/internal/ssa/writebarrier.go @@ -17,7 +17,7 @@ func needwb(v *Value) bool { if !ok { v.Fatalf("store aux is not a type: %s", v.LongString()) } - if !t.HasPointer() { + if !t.HasHeapPointer() { return false } if IsStackAddr(v.Args[0]) { diff --git a/src/cmd/compile/internal/types/type.go b/src/cmd/compile/internal/types/type.go index 7033dd2b9a..92b5d2da95 100644 --- a/src/cmd/compile/internal/types/type.go +++ b/src/cmd/compile/internal/types/type.go @@ -1391,10 +1391,10 @@ func Haspointers(t *Type) bool { return true } -// HasPointer returns whether t contains heap pointer. +// HasHeapPointer returns whether t contains a heap pointer. // This is used for write barrier insertion, so we ignore // pointers to go:notinheap types. -func (t *Type) HasPointer() bool { +func (t *Type) HasHeapPointer() bool { if t.IsPtr() && t.Elem().NotInHeap() { return false }