cmd/compile: add wasm architecture

This commit adds the wasm architecture to the compile command.
A later commit will contain the corresponding linker changes.

Design doc: https://docs.google.com/document/d/131vjr4DH6JFnb-blm_uRdaC0_Nv3OUwjEY5qVCxCup4

The following files are generated:
- src/cmd/compile/internal/ssa/opGen.go
- src/cmd/compile/internal/ssa/rewriteWasm.go
- src/cmd/internal/obj/wasm/anames.go

Updates #18892

Change-Id: Ifb4a96a3e427aac2362a1c97967d5667450fba3b
Reviewed-on: https://go-review.googlesource.com/103295
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
This commit is contained in:
Richard Musiol 2018-03-29 00:55:53 +02:00 committed by Brad Fitzpatrick
parent a9fc375258
commit 3b137dd2df
25 changed files with 9884 additions and 9 deletions

View file

@ -180,6 +180,7 @@ func Main(archInit func(*Arch)) {
gopkg = types.NewPkg("go", "")
Nacl = objabi.GOOS == "nacl"
Wasm := objabi.GOARCH == "wasm"
flag.BoolVar(&compiling_runtime, "+", false, "compiling runtime")
flag.BoolVar(&compiling_std, "std", false, "compiling standard library")
@ -200,7 +201,7 @@ func Main(archInit func(*Arch)) {
flag.IntVar(&nBackendWorkers, "c", 1, "concurrency during compilation, 1 means no concurrency")
flag.BoolVar(&pure_go, "complete", false, "compiling complete package (no C or assembly)")
flag.StringVar(&debugstr, "d", "", "print debug information about items in `list`; try -d help")
flag.BoolVar(&flagDWARF, "dwarf", true, "generate DWARF symbols")
flag.BoolVar(&flagDWARF, "dwarf", !Wasm, "generate DWARF symbols")
flag.BoolVar(&Ctxt.Flag_locationlists, "dwarflocationlists", true, "add location lists to DWARF in optimized mode")
flag.IntVar(&genDwarfInline, "gendwarfinl", 2, "generate DWARF inline info records")
objabi.Flagcount("e", "no limit on number of errors reported", &Debug['e'])
@ -265,6 +266,7 @@ func Main(archInit func(*Arch)) {
} else {
// turn off inline generation if no dwarf at all
genDwarfInline = 0
Ctxt.Flag_locationlists = false
}
if flag.NArg() < 1 && debugstr != "help" && debugstr != "ssa/help" {