From afbe646ab4480696d61462e9cab2ad048b5c1b6c Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Tue, 24 Oct 2017 17:10:02 -0400 Subject: cmd/compile: report typedslicecopy write barriers Most write barrier calls are inserted by SSA, but copy and append are lowered to runtime.typedslicecopy during walk. Fix these to set Func.WBPos and emit the "write barrier" warning, as done for the write barriers inserted by SSA. As part of this, we refactor setting WBPos and emitting this warning into the frontend so it can be shared by both walk and SSA. Change-Id: I5fe9997d9bdb55e03e01dd58aee28908c35f606b Reviewed-on: https://go-review.googlesource.com/73411 Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot Reviewed-by: Matthew Dempsky --- src/cmd/compile/internal/ssa/export_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/cmd/compile/internal/ssa/export_test.go') diff --git a/src/cmd/compile/internal/ssa/export_test.go b/src/cmd/compile/internal/ssa/export_test.go index ad69463bdd..d1d6831eb3 100644 --- a/src/cmd/compile/internal/ssa/export_test.go +++ b/src/cmd/compile/internal/ssa/export_test.go @@ -125,6 +125,8 @@ func (d DummyFrontend) Syslook(s string) *obj.LSym { func (DummyFrontend) UseWriteBarrier() bool { return true // only writebarrier_test cares } +func (DummyFrontend) SetWBPos(pos src.XPos) { +} func (d DummyFrontend) Logf(msg string, args ...interface{}) { d.t.Logf(msg, args...) } func (d DummyFrontend) Log() bool { return true } @@ -132,7 +134,6 @@ func (d DummyFrontend) Log() bool { return true } func (d DummyFrontend) Fatalf(_ src.XPos, msg string, args ...interface{}) { d.t.Fatalf(msg, args...) } func (d DummyFrontend) Warnl(_ src.XPos, msg string, args ...interface{}) { d.t.Logf(msg, args...) } func (d DummyFrontend) Debug_checknil() bool { return false } -func (d DummyFrontend) Debug_wb() bool { return false } var dummyTypes Types -- cgit v1.2.3-54-g00ecf