Commit 70258cc5 authored by Austin Clements's avatar Austin Clements

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 <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: 's avatarCherry Zhang <cherryyz@google.com>
parent f47c8f13
......@@ -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]) {
......
......@@ -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
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment