Source file src/cmd/compile/internal/ir/package.go
1 // Copyright 2020 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 package ir 6 7 import "cmd/compile/internal/types" 8 9 // A Package holds information about the package being compiled. 10 type Package struct { 11 // Imports, listed in source order. 12 // See golang.org/issue/31636. 13 Imports []*types.Pkg 14 15 // Init functions, listed in source order. 16 Inits []*Func 17 18 // Funcs contains all (instantiated) functions, methods, and 19 // function literals to be compiled. 20 Funcs []*Func 21 22 // Externs holds constants, (non-generic) types, and variables 23 // declared at package scope. 24 Externs []*Name 25 26 // AsmHdrDecls holds declared constants and struct types that should 27 // be included in -asmhdr output. It's only populated when -asmhdr 28 // is set. 29 AsmHdrDecls []*Name 30 31 // Cgo directives. 32 CgoPragmas [][]string 33 34 // Variables with //go:embed lines. 35 Embeds []*Name 36 37 // PluginExports holds exported functions and variables that are 38 // accessible through the package plugin API. It's only populated 39 // for -buildmode=plugin (i.e., compiling package main and -dynlink 40 // is set). 41 PluginExports []*Name 42 } 43