GoPLS Viewer

Home|gopls/cmd/gotype/sizesFor18.go
1// Copyright 2017 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5//go:build !go1.9
6// +build !go1.9
7
8// This file contains a copy of the implementation of types.SizesFor
9// since this function is not available in go/types before Go 1.9.
10
11package main
12
13import "go/types"
14
15const defaultCompiler = "gc"
16
17var gcArchSizes = map[string]*types.StdSizes{
18    "386":      {44},
19    "arm":      {44},
20    "arm64":    {88},
21    "amd64":    {88},
22    "amd64p32": {48},
23    "mips":     {44},
24    "mipsle":   {44},
25    "mips64":   {88},
26    "mips64le": {88},
27    "ppc64":    {88},
28    "ppc64le":  {88},
29    "s390x":    {88},
30}
31
32func SizesFor(compilerarch stringtypes.Sizes {
33    if compiler != "gc" {
34        return nil
35    }
36    sok := gcArchSizes[arch]
37    if !ok {
38        return nil
39    }
40    return s
41}
42
MembersX
defaultCompiler
SizesFor
SizesFor.compiler
SizesFor.arch
Members
X