[dev.regabi] cmd/compile: clean up flag handling [generated]

The flag values have grown fairly haphazard, with no organization
or even common naming convention. This CL moves all flag values
into the Flag struct (formerly misnamed Debug), except for a few
that live in Ctxt fields instead.

This CL is entirely automated changes.
A followup CL will make a few manual cleanups, leaving this CL
completely automated and easier to regenerate during merge
conflicts.

Cleaning up flags is necessary because the printing routines
look at some of them, and the printing routines need to move
out of package gc to a new package shared by gc and any
other packages that split out of gc.

[git-generate]

cd src/cmd/compile/internal/gc
rf '
	mv Debug Flag
	mv DebugFlags Flags
	mv Flags.e Flags.LowerE
	mv Flags.h Flags.LowerH
	mv Flags.j Flags.LowerJ
	mv Flags.l Flags.LowerL
	mv Flags.m Flags.LowerM
	mv Flags.r Flags.LowerR
	mv Flags.w Flags.LowerW
	mv Flags.P Flags.Percent
	mv compiling_runtime Flag.CompilingRuntime
	mv compiling_std Flag.Std
	mv localimport Flag.D
	mv asmhdr Flag.AsmHdr
	mv buildid Flag.BuildID
	mv nBackendWorkers Flag.LowerC
	mv pure_go Flag.Complete
	mv debugstr Flag.LowerD
	mv flagDWARF Flag.Dwarf
	mv genDwarfInline Flag.GenDwarfInl
	mv flag_installsuffix Flag.InstallSuffix
	mv flag_lang Flag.Lang
	mv linkobj Flag.LinkObj
	mv debuglive Flag.Live
	mv flag_msan Flag.MSan
	mv nolocalimports Flag.NoLocalImports
	mv outfile Flag.LowerO
	mv myimportpath Ctxt.Pkgpath
	mv writearchive Flag.Pack
	mv flag_race Flag.Race
	mv spectre Flag.Spectre
	mv trace Flag.LowerT
	mv pathPrefix Flag.TrimPath
	mv Debug_vlog Ctxt.Debugvlog
	mv use_writebarrier Flag.WB
	mv Main.flag_shared Flag.Shared
	mv Main.flag_dynlink Flag.Dynlink
	mv Main.goversion Flag.GoVersion
	mv Main.symabisPath Flag.SymABIs
	mv cpuprofile Flag.CPUProfile
	mv memprofile Flag.MemProfile
	mv traceprofile Flag.TraceProfile
	mv blockprofile Flag.BlockProfile
	mv mutexprofile Flag.MutexProfile
	mv benchfile Flag.Bench
	mv Main.smallFrames Flag.SmallFrames
	mv Main.jsonLogOpt Flag.JSON

	add Flag:$ \
		Cfg struct{}
	mv embedCfg Flag.Cfg.Embed
	mv idirs Flag.Cfg.ImportDirs
	mv importMap Flag.Cfg.ImportMap
	mv packageFile Flag.Cfg.PackageFile
	mv spectreIndex Flag.Cfg.SpectreIndex

	mv addidir addImportDir

	mv main.go:/Wasm/-0,/ssaDump/-3 ParseFlags

	mv usage Flag Flags ParseFlags \
		concurrentFlagOk concurrentBackendAllowed \
		addImportDir addImportMap \
		readImportCfg readEmbedCfg \
		flag.go

	# Remove //go:generate line copied from main.go
	# along with two self-assignments from the merge.
	rm flag.go:/go:generate/-+ \
		flag.go:/Ctxt.Pkgpath = Ctxt.Pkgpath/-+ \
		flag.go:/Ctxt.Debugvlog = Ctxt.Debugvlog/-+
'

Change-Id: I10431c15fe7d9f48024d53141d4224d957dbf334
Reviewed-on: https://go-review.googlesource.com/c/go/+/271667
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
31 files changed
tree: eb1203dda1a9a082224d05a98992f55481126fff
  1. .github/
  2. api/
  3. doc/
  4. lib/
  5. misc/
  6. src/
  7. test/
  8. .gitattributes
  9. .gitignore
  10. AUTHORS
  11. CONTRIBUTING.md
  12. CONTRIBUTORS
  13. favicon.ico
  14. LICENSE
  15. PATENTS
  16. README.md
  17. robots.txt
  18. SECURITY.md
README.md

The Go Programming Language

Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.

Gopher image Gopher image by Renee French, licensed under Creative Commons 3.0 Attributions license.

Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.

Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.

Download and Install

Binary Distributions

Official binary distributions are available at https://golang.org/dl/.

After downloading a binary release, visit https://golang.org/doc/install or load doc/install.html in your web browser for installation instructions.

Install From Source

If a binary distribution is not available for your combination of operating system and architecture, visit https://golang.org/doc/install/source or load doc/install-source.html in your web browser for source installation instructions.

Contributing

Go is the work of thousands of contributors. We appreciate your help!

To contribute, please read the contribution guidelines: https://golang.org/doc/contribute.html

Note that the Go project uses the issue tracker for bug reports and proposals only. See https://golang.org/wiki/Questions for a list of places to ask questions about the Go language.