1
0
mirror of https://github.com/golang/go synced 2024-11-23 20:40:07 -07:00

go/types: add gccgo sizes information

This will need to be updated from time to time as new targets are
added to gccgo. But that is better than always returning nil.

Change-Id: I04b8c4d0f8efa38e2a148eb2e38b16b09f0351c3
Reviewed-on: https://go-review.googlesource.com/c/158844
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Ian Lance Taylor 2019-01-22 07:40:19 -08:00
parent 7a9968f96f
commit 98cbf45cfc
2 changed files with 48 additions and 2 deletions

View File

@ -0,0 +1,40 @@
// Copyright 2019 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// This is a copy of the file generated during the gccgo build process.
// Last update 2019-01-22.
package types
var gccgoArchSizes = map[string]*StdSizes{
"386": {4, 4},
"alpha": {8, 8},
"amd64": {8, 8},
"amd64p32": {4, 8},
"arm": {4, 8},
"armbe": {4, 8},
"arm64": {8, 8},
"arm64be": {8, 8},
"ia64": {8, 8},
"m68k": {4, 2},
"mips": {4, 8},
"mipsle": {4, 8},
"mips64": {8, 8},
"mips64le": {8, 8},
"mips64p32": {4, 8},
"mips64p32le": {4, 8},
"nios2": {4, 8},
"ppc": {4, 8},
"ppc64": {8, 8},
"ppc64le": {8, 8},
"riscv": {4, 8},
"riscv64": {8, 8},
"s390": {4, 8},
"s390x": {8, 8},
"sh": {4, 8},
"shbe": {4, 8},
"sparc": {4, 8},
"sparc64": {8, 8},
"wasm": {8, 8},
}

View File

@ -182,10 +182,16 @@ var gcArchSizes = map[string]*StdSizes{
// "386", "arm", "arm64", "amd64", "amd64p32", "mips", "mipsle",
// "mips64", "mips64le", "ppc64", "ppc64le", "riscv64", "s390x", "sparc64", "wasm".
func SizesFor(compiler, arch string) Sizes {
if compiler != "gc" {
var m map[string]*StdSizes
switch compiler {
case "gc":
m = gcArchSizes
case "gccgo":
m = gccgoArchSizes
default:
return nil
}
s, ok := gcArchSizes[arch]
s, ok := m[arch]
if !ok {
return nil
}