]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: rename (*Type).HasPointer to (*Type).HasHeapPointer
authorAustin Clements <austin@google.com>
Mon, 2 Oct 2017 21:31:43 +0000 (17:31 -0400)
committerAustin Clements <austin@google.com>
Tue, 3 Oct 2017 13:40:06 +0000 (13:40 +0000)
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 <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/cmd/compile/internal/ssa/writebarrier.go
src/cmd/compile/internal/types/type.go

index 0daff45b4372be656fa4784c2f266a7eaecc0a1c..129a06eecb4fdd672cbac100a6b8fd0e0ee778f7 100644 (file)
@@ -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]) {
index 7033dd2b9ae2cb4f76d22e2834e0b346e93e0c89..92b5d2da95b3ca566726021580f1a773f7834772 100644 (file)
@@ -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
        }