diff --git a/src/cmd/compile/internal/ssa/compile.go b/src/cmd/compile/internal/ssa/compile.go index bd90235682204d..2f15cfd1e7aa98 100644 --- a/src/cmd/compile/internal/ssa/compile.go +++ b/src/cmd/compile/internal/ssa/compile.go @@ -192,29 +192,55 @@ var BuildDump string // name of function to dump after initial build of ssa func PhaseOption(phase, flag string, val int, valString string) string { if phase == "help" { lastcr := 0 - phasenames := "check, all, build, intrinsics" + phasenames := " check, all, build, intrinsics" for _, p := range passes { pn := strings.Replace(p.name, " ", "_", -1) if len(pn)+len(phasenames)-lastcr > 70 { - phasenames += "\n" + phasenames += "\n " lastcr = len(phasenames) phasenames += pn } else { phasenames += ", " + pn } } - return "" + - `GcFlag -d=ssa//[=|] - is one of: + return `PhaseOptions usage: + + go tool compile -d=ssa//[=|] + +where: + +- is one of: ` + phasenames + ` - is one of on, off, debug, mem, time, test, stats, dump - defaults to 1 - is required for "dump", specifies name of function to dump after -Except for dump, output is directed to standard out; dump appears in a file. + +- is one of: + on, off, debug, mem, time, test, stats, dump + +- defaults to 1 + +- is required for the "dump" flag, and specifies the + name of function to dump after + Phase "all" supports flags "time", "mem", and "dump". -Phases "intrinsics" supports flags "on", "off", and "debug". -Interpretation of the "debug" value depends on the phase. -Dump files are named ___.dump. +Phase "intrinsics" supports flags "on", "off", and "debug". + +If the "dump" flag is specified, the output is written on a file named +___.dump; otherwise it is directed to stdout. + +Examples: + + -d=ssa/check/on +enables checking after each phase + + -d=ssa/all/time +enables time reporting for all phases + + -d=ssa/prove/debug=2 +sets debugging level to 2 in the prove pass + +Multiple flags can be passed at once, by separating them with +commas. For example: + + -d=ssa/check/on,ssa/all/time ` }