8 #include "HsVersions.h"
15 -- A minor helper (TODO document)
16 blocksToBlockEnv :: [BrokenBlock] -> BlockEnv BrokenBlock
17 blocksToBlockEnv blocks = listToUFM $ map (\b -> (brokenBlockId b, b)) blocks
21 brokenBlockId :: BlockId, -- Like a CmmBasicBlock
22 brokenBlockEntry :: BlockEntryInfo,
23 -- How this block can be entered
25 brokenBlockStmts :: [CmmStmt],
26 -- Like a CmmBasicBlock
27 -- (but without the last statement)
29 brokenBlockTargets :: [BlockId],
30 -- Blocks that this block could
31 -- branch to one either by conditional
32 -- branches or via the last statement
34 brokenBlockExit :: FinalStmt
35 -- How the block can be left
39 = FunctionEntry -- Beginning of a function
40 CLabel -- The function name
41 CmmFormals -- Aguments to function
43 | ContinuationEntry -- Return point of a call
44 CmmFormals -- return values (argument to continuation)
46 -- | ProcPointEntry -- no return values, but some live might end up as params or possibly in the frame
48 | ControlEntry -- A label in the input
50 -- Final statement in a BlokenBlock
51 -- Constructors and arguments match those in Cmm,
52 -- but are restricted to branches, returns, jumps, calls and switches
55 BlockId -- next block (must be a ControlEntry)
58 CmmActuals -- return values
61 CmmExpr -- the function to call
62 CmmActuals -- arguments to call
65 BlockId -- next block after call (must be a ContinuationEntry)
66 CmmCallTarget -- the function to call
67 CmmFormals -- results from call (redundant with ContinuationEntry)
68 CmmActuals -- arguments to call
69 (Maybe [GlobalReg]) -- registers that must be saved (TODO)
72 CmmExpr [Maybe BlockId] -- Table branch
74 -- TODO: | ProcPointExit (needed?)