cmd/compile: accept string debug flags

The compiler's -d flag accepts string-valued flags, but currently only
for SSA debug flags. Extend it to support string values for other
flags. This also makes the syntax somewhat more sane so flag=value and
flag:value now both accept integers and strings.

Change-Id: Idd144d8479a430970cc1688f824bffe0a56ed2df
Reviewed-on: https://go-review.googlesource.com/37345
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
This commit is contained in:
Austin Clements 2017-02-22 16:13:06 -05:00
parent 5bfd1ef036
commit 8eb14e9de5
2 changed files with 26 additions and 18 deletions

View file

@ -204,7 +204,7 @@ func PhaseOption(phase, flag string, val int, valString string) string {
}
}
return "" +
`GcFlag -d=ssa/<phase>/<flag>[=<value>]|[:<function_name>]
`GcFlag -d=ssa/<phase>/<flag>[=<value>|<function_name>]
<phase> is one of:
` + phasenames + `
<flag> is one of on, off, debug, mem, time, test, stats, dump