-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Register allocation API -- -- Register allocation API @package reg-alloc @version 0.1.0.0 module RegAlloc -- | Transform a list of basic blocks, containing variable references, into -- an equivalent list where each reference has been associated with a -- register allocation. Artificial save and restore instructions may be -- inserted into those blocks to indicate spilling and reloading of -- variables. -- -- In order to call this function, the caller must provide records that -- functionally characterize these blocks and their operations according -- to an abstract API. This is done so that any program graph conforming -- to the API may be used, and no particular representation is required. -- -- A tuple is return where the first value is a textual dump that -- describes the complete allocation state. If this value is never -- forced, that data is not collected. -- -- The second value is the resulting list of allocated blocks. If -- allocation is found to be impossible -- for example if there are not -- enough registers -- a Left value is returned, with a list of -- strings describing the error and its possible context. This is usually -- when the textual dump should be provided, if one's user has selected -- verbose error output, for example. allocate :: (Functor m, Applicative m, Monad m) => Int -> BlockInfo m blk1 blk2 op1 op2 -> OpInfo m op1 op2 -> UseVerifier -> [blk1] -> m (String, Either [String] [blk2])