func (s *state) Unimplementedf(msg string, args ...interface{}) {
s.config.Unimplementedf(s.peekLine(), msg, args...)
}
-func (s *state) Warnl(line int, msg string, args ...interface{}) { s.config.Warnl(line, msg, args...) }
-func (s *state) Debug_checknil() bool { return s.config.Debug_checknil() }
+func (s *state) Warnl(line int32, msg string, args ...interface{}) { s.config.Warnl(line, msg, args...) }
+func (s *state) Debug_checknil() bool { return s.config.Debug_checknil() }
var (
// dummy node for the memory variable
// Warnl reports a "warning", which is usually flag-triggered
// logging output for the benefit of tests.
-func (e *ssaExport) Warnl(line int, fmt_ string, args ...interface{}) {
- Warnl(int32(line), fmt_, args...)
+func (e *ssaExport) Warnl(line int32, fmt_ string, args ...interface{}) {
+ Warnl(line, fmt_, args...)
}
func (e *ssaExport) Debug_checknil() bool {
Unimplementedf(line int32, msg string, args ...interface{})
// Warnl writes compiler messages in the form expected by "errorcheck" tests
- Warnl(line int, fmt_ string, args ...interface{})
+ Warnl(line int32, fmt_ string, args ...interface{})
// Fowards the Debug_checknil flag from gc
Debug_checknil() bool
func (c *Config) Unimplementedf(line int32, msg string, args ...interface{}) {
c.fe.Unimplementedf(line, msg, args...)
}
-func (c *Config) Warnl(line int, msg string, args ...interface{}) { c.fe.Warnl(line, msg, args...) }
-func (c *Config) Debug_checknil() bool { return c.fe.Debug_checknil() }
+func (c *Config) Warnl(line int32, msg string, args ...interface{}) { c.fe.Warnl(line, msg, args...) }
+func (c *Config) Debug_checknil() bool { return c.fe.Debug_checknil() }
func (c *Config) logDebugHashMatch(evname, name string) {
var file *os.File
func (d DummyFrontend) Unimplementedf(line int32, msg string, args ...interface{}) {
d.t.Fatalf(msg, args...)
}
-func (d DummyFrontend) Warnl(line int, msg string, args ...interface{}) { d.t.Logf(msg, args...) }
-func (d DummyFrontend) Debug_checknil() bool { return false }
+func (d DummyFrontend) Warnl(line int32, msg string, args ...interface{}) { d.t.Logf(msg, args...) }
+func (d DummyFrontend) Debug_checknil() bool { return false }
func (d DummyFrontend) TypeBool() Type { return TypeBool }
func (d DummyFrontend) TypeInt8() Type { return TypeInt8 }
for _, a := range args {
value += fmt.Sprintf("\t%v", a)
}
- f.Config.Warnl(int(f.Entry.Line), "\t%s\t%s%s\t%s", f.pass.name, key, value, f.Name)
+ f.Config.Warnl(f.Entry.Line, "\t%s\t%s%s\t%s", f.pass.name, key, value, f.Name)
}
// freeValue frees a value. It must no longer be referenced.
}
func describeBranchPrediction(f *Func, b *Block, likely, not int8, prediction BranchPrediction) {
- f.Config.Warnl(int(b.Line), "Branch prediction rule %s < %s%s",
+ f.Config.Warnl(b.Line, "Branch prediction rule %s < %s%s",
bllikelies[likely-blMin], bllikelies[not-blMin], describePredictionAgrees(b, prediction))
}
noprediction = true
}
if f.pass.debug > 0 && !noprediction {
- f.Config.Warnl(int(b.Line), "Branch prediction rule stay in loop%s",
+ f.Config.Warnl(b.Line, "Branch prediction rule stay in loop%s",
describePredictionAgrees(b, prediction))
}
}
}
if f.pass.debug > 2 {
- f.Config.Warnl(int(b.Line), "BP: Block %s, local=%s, certain=%s", b, bllikelies[local[b.ID]-blMin], bllikelies[certain[b.ID]-blMin])
+ f.Config.Warnl(b.Line, "BP: Block %s, local=%s, certain=%s", b, bllikelies[local[b.ID]-blMin], bllikelies[certain[b.ID]-blMin])
}
}
// Logging in the style of the former compiler -- and omit line 1,
// which is usually in generated code.
- if f.Config.Debug_checknil() && int(node.block.Control.Line) > 1 {
- f.Config.Warnl(int(node.block.Control.Line), "removed nil check")
+ if f.Config.Debug_checknil() && node.block.Control.Line > 1 {
+ f.Config.Warnl(node.block.Control.Line, "removed nil check")
}
switch node.block.Kind {
if ok && isCopy {
if f.pass.debug > 0 {
- f.Config.Warnl(int(b.Line), "converted OpPhi to OpCopy")
+ f.Config.Warnl(b.Line, "converted OpPhi to OpCopy")
}
v.reset(OpCopy)
v.AddArg(b0.Control)
}
if ok && !isCopy {
if f.pass.debug > 0 {
- f.Config.Warnl(int(b.Line), "converted OpPhi to OpNot")
+ f.Config.Warnl(b.Line, "converted OpPhi to OpNot")
}
v.reset(OpNot)
v.AddArg(b0.Control)
m := ft.get(nil, b.Control, boolean)
if m == lt|gt {
if b.Func.pass.debug > 0 {
- b.Func.Config.Warnl(int(b.Line), "Proved boolean %s", b.Control.Op)
+ b.Func.Config.Warnl(b.Line, "Proved boolean %s", b.Control.Op)
}
return positive
}
if m == eq {
if b.Func.pass.debug > 0 {
- b.Func.Config.Warnl(int(b.Line), "Disproved boolean %s", b.Control.Op)
+ b.Func.Config.Warnl(b.Line, "Disproved boolean %s", b.Control.Op)
}
return negative
}
m := ft.get(a0, a1, d)
if m != 0 && tr.r&m == m {
if b.Func.pass.debug > 0 {
- b.Func.Config.Warnl(int(b.Line), "Proved %s", c.Op)
+ b.Func.Config.Warnl(b.Line, "Proved %s", c.Op)
}
return positive
}
if m != 0 && ((lt|eq|gt)^tr.r)&m == m {
if b.Func.pass.debug > 0 {
- b.Func.Config.Warnl(int(b.Line), "Disproved %s", c.Op)
+ b.Func.Config.Warnl(b.Line, "Disproved %s", c.Op)
}
return negative
}
m := ft.get(a0, a1, signed)
if m != 0 && tr.r&m == m {
if b.Func.pass.debug > 0 {
- b.Func.Config.Warnl(int(b.Line), "Proved non-negative bounds %s", c.Op)
+ b.Func.Config.Warnl(b.Line, "Proved non-negative bounds %s", c.Op)
}
return positive
}