Documentation ¶
Index ¶
- func CompilePackage(moduleName string, pkg *loader.Package, machine llvm.TargetMachine, ...) (llvm.Module, []error)
- func CompileProgram(lprogram *loader.Program, machine llvm.TargetMachine, config *Config, ...) (llvm.Module, []error)
- func NewTargetMachine(config *Config) (llvm.TargetMachine, error)
- func Sizes(machine llvm.TargetMachine) types.Sizes
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompilePackage ¶ added in v0.17.0
func CompilePackage(moduleName string, pkg *loader.Package, machine llvm.TargetMachine, config *Config, dumpSSA bool) (llvm.Module, []error)
CompilePackage compiles a single package to a LLVM module.
func CompileProgram ¶ added in v0.17.0
func CompileProgram(lprogram *loader.Program, machine llvm.TargetMachine, config *Config, dumpSSA bool) (llvm.Module, []error)
CompileProgram compiles the given package path or .go file path. Return an error when this fails (in any stage). If successful it returns the LLVM module. If not, one or more errors will be returned.
func NewTargetMachine ¶ added in v0.13.0
NewTargetMachine returns a new llvm.TargetMachine based on the passed-in configuration. It is used by the compiler and is needed for machine code emission.
Types ¶
type Config ¶
type Config struct { // Target and output information. Triple string CPU string Features []string GOOS string GOARCH string CodeModel string RelocationModel string // Various compiler options that determine how code is generated. Scheduler string FuncImplementation string AutomaticStackSize bool DefaultStackSize uint64 NeedsStackObjects bool Debug bool // Whether to emit debug information in the LLVM module. }
Config is the configuration for the compiler. Most settings should be copied directly from compileopts.Config, it recreated here to decouple the compiler package a bit and because it makes caching easier.
This struct can be used for caching: if one of the flags here changes the code must be recompiled.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package ircheck implements a checker for LLVM IR, that goes a bit further than the regular LLVM IR verifier.
|
Package ircheck implements a checker for LLVM IR, that goes a bit further than the regular LLVM IR verifier. |
Package llvmutil contains utility functions used across multiple compiler packages.
|
Package llvmutil contains utility functions used across multiple compiler packages. |