Documentation ¶
Overview ¶
Package compiler contains style-to-compiler resolution.
Index ¶
- Variables
- type Compiler
- type Resolver
- func (r *Resolver) DefaultMOpts(c *mdl.Compiler) (stringhelp.Set, error)
- func (r *Resolver) DefaultOptLevels(c *mdl.Compiler) (stringhelp.Set, error)
- func (r *Resolver) Get(c *mdl.Compiler) (Compiler, error)
- func (r *Resolver) OptLevels(c *mdl.Compiler) (map[string]optlevel.Level, error)
- func (r *Resolver) Probe(ctx context.Context, sr service.Runner) (mdl.ConfigMap, error)
- func (r *Resolver) RunCompiler(ctx context.Context, j mdl.Job, sr service.Runner) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNil occurs when the compiler we try to resolve is nil. ErrNil = errors.New("compiler nil") // ErrUnknownStyle occurs when we ask the resolver for a compiler style of which it isn't aware. ErrUnknownStyle = errors.New("unknown compiler style") // CResolve is a pre-populated compiler resolver. CResolve = Resolver{Compilers: map[id.ID]Compiler{ id.CStyleGCC: gcc.GCC{ DefaultRunInfo: service.RunInfo{Cmd: "gcc", Args: []string{"-pthread", "-std=gnu11"}}, AltCommands: []string{ "clang", }, }, }} )
Functions ¶
This section is empty.
Types ¶
type Compiler ¶
type Compiler interface { // Probe uses sr to probe for copies of a particular compiler class with id classId, adding them to target. Probe(ctx context.Context, sr service.Runner, classId id.ID, target mdl.ConfigMap) error mdl.Inspector interpreter.Driver }
Compiler contains the various interfaces that a compiler can implement.
type Resolver ¶
type Resolver struct { // Compilers is the raw map from style strings to compiler runners. Compilers map[id.ID]Compiler }
Resolver maps compiler styles to compilers.
func (*Resolver) DefaultMOpts ¶
DefaultMOpts gets the default machine-specific optimisation profiles for the compiler described by c.
func (*Resolver) DefaultOptLevels ¶
DefaultOptLevels gets the default optimisation levels for the compiler described by c.
func (*Resolver) OptLevels ¶
OptLevels gets information about all available optimisation levels for the compiler described by c.
Click to show internal directories.
Click to hide internal directories.