obj.Flagstr("cpuprofile", "write cpu profile to `file`", &cpuprofile)
obj.Flagstr("memprofile", "write memory profile to `file`", &memprofile)
obj.Flagint64("memprofilerate", "set runtime.MemProfileRate to `rate`", &memprofilerate)
+ flag.BoolVar(&ssaEnabled, "ssa", true, "use SSA backend to generate code")
obj.Flagparse(usage)
if flag_dynlink {
// Run all the passes
printFunc(f)
f.Config.HTML.WriteFunc("start", f)
- checkFunc(f)
+ if checkEnabled {
+ checkFunc(f)
+ }
const logMemStats = false
for _, p := range passes {
if !f.Config.optimize && !p.required {
f.logStat("TIME(ns):BYTES:ALLOCS", time, nBytes, nAllocs)
}
}
- checkFunc(f)
+ if checkEnabled {
+ checkFunc(f)
+ }
}
// Squash error printing defer
test int // pass-specific ad-hoc option, perhaps useful in development
}
+// Run consistency checker between each phase
+var checkEnabled = true
+
// PhaseOption sets the specified flag in the specified ssa phase,
// returning empty string if this was successful or a string explaining
// the error if it was not. A version of the phase name with "_"
// GO_GCFLAGS=-d=ssa/generic_cse/time,ssa/generic_cse/stats,ssa/generic_cse/debug=3 ./make.bash ...
//
func PhaseOption(phase, flag string, val int) string {
+ if phase == "check" && flag == "on" {
+ checkEnabled = val != 0
+ return ""
+ }
+ if phase == "check" && flag == "off" {
+ checkEnabled = val == 0
+ return ""
+ }
underphase := strings.Replace(phase, "_", " ", -1)
for i, p := range passes {
if p.name == phase || p.name == underphase {