Commit 98cbf45c authored by Ian Lance Taylor's avatar Ian Lance Taylor

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: default avatarAlan Donovan <adonovan@google.com>
Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 7a9968f9
// 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},
}
......@@ -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
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment