linearscan-hoopl-0.5.1.0: Makes it easy to use the linearscan register allocator with Hoopl

Safe HaskellNone
LanguageHaskell2010

LinearScan.Hoopl.DSL

Synopsis

Documentation

type Asm = StateT Labels SimpleUniqueMonad Source

The Asm monad lets us create labels by name and refer to them later.

type Nodes n a = Free ((,) (n O O)) a Source

A series of Nodes is a set of assembly instructions that ends with some kind of closing operation, such as a jump, branch or return.

nodesToList :: Nodes n a -> (a, [n O O]) Source

The Nodes free monad is really just a convenient way to describe a list that must result in a closing operation at the end.

type BodyNode n = Nodes n () Source

type EndNode n = Nodes n (Asm (n O C)) Source

endNode :: Asm (n O C) -> EndNode n Source

data ProgramF n Source

A program is a series of Nodes, each associated with a label.

Constructors

FreeBlock 

type Program n = FreeT ((,) (ProgramF n)) Asm () Source

compile :: (NonLocal n, HooplNode n) => String -> Program n -> SimpleUniqueMonad (Graph n C C, Label) Source

When we compile a program, the result is a closed Hoopl Graph and the label corresponding to the requested entry label name.