mirror of
https://github.com/golang/go.git
synced 2025-05-18 13:54:40 +00:00
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: Cherry Zhang <cherryyz@google.com>
This commit is contained in:
parent
f47c8f130e
commit
70258cc59f
@ -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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user