Safe Haskell | Trustworthy |
---|---|
Language | Haskell2010 |
Definition of the core compiler driver building blocks. The
spine of the compiler is the FutharkM
monad, although note that
individual passes are pure functions, and do not use the FutharkM
monad (see Futhark.Pass).
Running the compiler involves producing an initial IR program (see
Futhark.Compiler.Program), running a Pipeline
to produce a
final program (still in IR), then running an Action
, which is
usually a code generator.
Synopsis
- data Pipeline fromlore tolore
- data PipelineConfig = PipelineConfig {}
- data Action lore = Action {
- actionName :: String
- actionDescription :: String
- actionProcedure :: Prog lore -> FutharkM ()
- data FutharkM a
- runFutharkM :: FutharkM a -> Verbosity -> IO (Either CompilerError a)
- data Verbosity
- module Futhark.Error
- onePass :: Checkable tolore => Pass fromlore tolore -> Pipeline fromlore tolore
- passes :: Checkable lore => [Pass lore lore] -> Pipeline lore lore
- runPipeline :: Pipeline fromlore tolore -> PipelineConfig -> Prog fromlore -> FutharkM (Prog tolore)
Documentation
data Pipeline fromlore tolore Source #
A compiler pipeline is conceptually a function from programs to
programs, where the actual representation may change. Pipelines
can be composed using their Category
instance.
data PipelineConfig Source #
Configuration object for running a compiler pipeline.
A compilation always ends with some kind of action.
Action | |
|
The main Futhark compiler driver monad - basically some state
tracking on top if IO
.
Instances
Monad FutharkM Source # | |
Functor FutharkM Source # | |
Applicative FutharkM Source # | |
MonadIO FutharkM Source # | |
Defined in Futhark.Pipeline | |
MonadLogger FutharkM Source # | |
MonadFreshNames FutharkM Source # | |
Defined in Futhark.Pipeline getNameSource :: FutharkM VNameSource Source # putNameSource :: VNameSource -> FutharkM () Source # | |
MonadError CompilerError FutharkM Source # | |
Defined in Futhark.Pipeline throwError :: CompilerError -> FutharkM a # catchError :: FutharkM a -> (CompilerError -> FutharkM a) -> FutharkM a # |
runFutharkM :: FutharkM a -> Verbosity -> IO (Either CompilerError a) Source #
Run a FutharkM
action.
How much information to print to stderr while the compiler is running.
NotVerbose | Silence is golden. |
Verbose | Print messages about which pass is running. |
VeryVerbose | Also print logs from individual passes. |
module Futhark.Error
onePass :: Checkable tolore => Pass fromlore tolore -> Pipeline fromlore tolore Source #
Construct a pipeline from a single compiler pass.
passes :: Checkable lore => [Pass lore lore] -> Pipeline lore lore Source #
Create a pipeline from a list of passes.
runPipeline :: Pipeline fromlore tolore -> PipelineConfig -> Prog fromlore -> FutharkM (Prog tolore) Source #
Run the pipeline on the given program.