Safe Haskell | None |
---|---|
Language | Haskell2010 |
- type Labels = Map String Label
- type BlockIds = Map Label Int
- data SpillStack = SpillStack {
- stackPtr :: Int
- stackSlotSize :: Int
- stackSlots :: Map (Maybe Int) Int
- data EnvState = EnvState {}
- type Env = StateT EnvState SimpleUniqueMonad
- newSpillStack :: Int -> Int -> SpillStack
- newEnvState :: EnvState
- getStackSlot :: Maybe VarId -> Env Int
- type Asm = StateT Labels SimpleUniqueMonad
- getLabel :: String -> Asm Label
- setAssignment :: PhysReg -> VarId -> Env ()
- getAssignment :: PhysReg -> Env VarId
- type Nodes n a = Free ((,) (n O O)) a
- nodesToList :: Nodes n a -> (a, [n O O])
- type BodyNode n = Nodes n ()
- bodyNode :: n O O -> BodyNode n
- type EndNode n = Nodes n (Asm (n O C))
- endNode :: Asm (n O C) -> EndNode n
- data ProgramF n = FreeBlock {
- labelEntry :: Label
- labelBody :: EndNode n
- type Program n = FreeT ((,) (ProgramF n)) Asm ()
- label :: String -> EndNode n -> Program n
- jump :: HooplNode n => String -> EndNode n
- compile :: (NonLocal n, HooplNode n) => String -> Program n -> SimpleUniqueMonad (Graph n C C, Label)
Documentation
data SpillStack Source
SpillStack | |
|
type Env = StateT EnvState SimpleUniqueMonad Source
newSpillStack :: Int -> Int -> SpillStack Source
type Asm = StateT Labels SimpleUniqueMonad Source
The Asm
monad lets us create labels by name and refer to them later.
setAssignment :: PhysReg -> VarId -> Env () Source
getAssignment :: PhysReg -> Env VarId Source
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.