tools: golang.org/x/tools/go/internal/gccgoimporter Index | Files

package gccgoimporter

import "golang.org/x/tools/go/internal/gccgoimporter"

Package gccgoimporter implements Import for gccgo-generated object files.

Index

Package Files

backdoor.go gccgoinstallation.go importer.go parser.go

func Parse Uses

func Parse(in io.Reader, imports map[string]*types.Package, path string) (_ *types.Package, err error)

Parse reads and parses gccgo export data from in and constructs a Package, inserting it into the imports map.

type GccgoInstallation Uses

type GccgoInstallation struct {
    // Version of gcc (e.g. 4.8.0).
    GccVersion string

    // Target triple (e.g. x86_64-unknown-linux-gnu).
    TargetTriple string

    // Built-in library paths used by this installation.
    LibPaths []string
}

Information about a specific installation of gccgo.

func (*GccgoInstallation) GetImporter Uses

func (inst *GccgoInstallation) GetImporter(incpaths []string, initmap map[*types.Package]InitData) Importer

Return an importer that searches incpaths followed by the gcc installation's built-in search paths and the current directory.

func (*GccgoInstallation) InitFromDriver Uses

func (inst *GccgoInstallation) InitFromDriver(gccgoPath string, args ...string) (err error)

Ask the driver at the given path for information for this GccgoInstallation. The given arguments are passed directly to the call to the driver.

func (*GccgoInstallation) SearchPaths Uses

func (inst *GccgoInstallation) SearchPaths() (paths []string)

Return the list of export search paths for this GccgoInstallation.

type Importer Uses

type Importer func(imports map[string]*types.Package, path string) (*types.Package, error)

An Importer resolves import paths to Packages. The imports map records packages already known, indexed by package path. An importer must determine the canonical package path and check imports to see if it is already present in the map. If so, the Importer can return the map entry. Otherwise, the importer must load the package data for the given path into a new *Package, record it in imports map, and return the package.

func GetImporter Uses

func GetImporter(searchpaths []string, initmap map[*types.Package]InitData) Importer

type InitData Uses

type InitData struct {
    // Initialization priority of this package relative to other packages.
    // This is based on the maximum depth of the package's dependency graph;
    // it is guaranteed to be greater than that of its dependencies.
    Priority int

    // The list of packages which this package depends on to be initialized,
    // including itself if needed. This is the subset of the transitive closure of
    // the package's dependencies that need initialization.
    Inits []PackageInit
}

The gccgo-specific init data for a package.

type PackageInit Uses

type PackageInit struct {
    Name     string // short package name
    InitFunc string // name of init function
    Priority int    // priority of init function, see InitData.Priority
}

A PackageInit describes an imported package that needs initialization.

Package gccgoimporter imports 15 packages (graph) and is imported by 3 packages. Updated 2017-08-21. Refresh now. Tools for package owners.