1
2
3
4
5 package ssa
6
7 import "cmd/compile/internal/logopt"
8
9
10
11
12
13 func checkbce(f *Func) {
14 if f.pass.debug <= 0 && !logopt.Enabled() {
15 return
16 }
17
18 for _, b := range f.Blocks {
19 if b.Kind == BlockInvalid {
20 continue
21 }
22 for _, v := range b.Values {
23 if v.Op == OpIsInBounds || v.Op == OpIsSliceInBounds {
24 if f.pass.debug > 0 {
25 f.Warnl(v.Pos, "Found %v", v.Op)
26 }
27 if logopt.Enabled() {
28 if v.Op == OpIsInBounds {
29 logopt.LogOpt(v.Pos, "isInBounds", "checkbce", f.Name)
30 }
31 if v.Op == OpIsSliceInBounds {
32 logopt.LogOpt(v.Pos, "isSliceInBounds", "checkbce", f.Name)
33 }
34 }
35 }
36 }
37 }
38 }
39
View as plain text