.gitignore added
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / golang.org / x / tools@v0.1.1-0.20210319172145-bda8f5cee399 / 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
11 package main
12
13 import "go/types"
14
15 const defaultCompiler = "gc"
16
17 var gcArchSizes = map[string]*types.StdSizes{
18         "386":      {4, 4},
19         "arm":      {4, 4},
20         "arm64":    {8, 8},
21         "amd64":    {8, 8},
22         "amd64p32": {4, 8},
23         "mips":     {4, 4},
24         "mipsle":   {4, 4},
25         "mips64":   {8, 8},
26         "mips64le": {8, 8},
27         "ppc64":    {8, 8},
28         "ppc64le":  {8, 8},
29         "s390x":    {8, 8},
30 }
31
32 func SizesFor(compiler, arch string) types.Sizes {
33         if compiler != "gc" {
34                 return nil
35         }
36         s, ok := gcArchSizes[arch]
37         if !ok {
38                 return nil
39         }
40         return s
41 }