[dev.ssa] cmd/compile: report better line numbers for Unimplemented/Fatal
If a failure occurs in SSA processing, we always report the
last line of the function we're compiling. Modify the callbacks
from SSA to the GC compiler so we can pass a line number back
and use it in Fatalf.
Change-Id: Ifbfad50d5e167e997e0a96f0775bcc369f5c397e
Reviewed-on: https://go-review.googlesource.com/18599
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: David Chase <drchase@google.com>
diff --git a/src/cmd/compile/internal/ssa/value.go b/src/cmd/compile/internal/ssa/value.go
index fc31863..420c408 100644
--- a/src/cmd/compile/internal/ssa/value.go
+++ b/src/cmd/compile/internal/ssa/value.go
@@ -135,9 +135,13 @@
return c
}
-func (v *Value) Logf(msg string, args ...interface{}) { v.Block.Logf(msg, args...) }
-func (v *Value) Fatalf(msg string, args ...interface{}) { v.Block.Fatalf(msg, args...) }
-func (v *Value) Unimplementedf(msg string, args ...interface{}) { v.Block.Unimplementedf(msg, args...) }
+func (v *Value) Logf(msg string, args ...interface{}) { v.Block.Logf(msg, args...) }
+func (v *Value) Fatalf(msg string, args ...interface{}) {
+ v.Block.Func.Config.Fatalf(v.Line, msg, args...)
+}
+func (v *Value) Unimplementedf(msg string, args ...interface{}) {
+ v.Block.Func.Config.Unimplementedf(v.Line, msg, args...)
+}
// ExternSymbol is an aux value that encodes a variable's
// constant offset from the static base pointer.