| Safe Haskell | Safe |
|---|---|
| Language | Haskell2010 |
ReWire.Pass
Description
Scaffolding for running, tracing, and dumping pipeline passes, used by
the compiler (ReWire.ModCache, ReWire.FrontEnd) and, for printHeader
alone, by the embedder (ReWire.HSE.PassInfo).
Documentation
pass :: forall m a b. (MonadIO m, Data b, Show b) => Config -> FilePath -> Natural -> Text -> String -> (b -> Text) -> (a -> m b) -> a -> m b Source #
Run one numbered, named pipeline pass: announce it (verbose only, as "[n] name"), run the transformation, then write the rendering of its output to a file beside the output file when -d n (or --dump-all) is on -- so "-d n" reads "dump the IR after pass n". The dump file is the output file (or the given source file) with its extension replaced by "<n>.<ext>" (e.g., MiniISA.6.eir); ext names the IR's textual format, which the render argument produces. Under -v, the dump also carries the IR's show output (indented by pretty-simple) in a comment, so it stays parseable. Numbers are assigned consecutively at the call sites (ReWire.ModCache and ReWire.FrontEnd for the compiler).
printHeader :: MonadIO m => Text -> m () Source #