- efBB :: (BlockID, BasicBlock) -> TrapMap -> BBStarts -> [(BlockID, Label)] -> CodeGen e s (TrapMap, BBStarts)
- efBB (bid, bb) calls bbstarts lmap =
- if M.member bid bbstarts then
- return (calls, bbstarts)
- else do
- bb_offset <- getCodeOffset
- let bbstarts' = M.insert bid bb_offset bbstarts
- defineLabel $ getLabel bid lmap
- cs <- mapM emit'' $ code bb
- let calls' = calls `M.union` M.fromList (catMaybes cs)
- case successor bb of
- Return -> return (calls', bbstarts')
+ efBB :: [(BlockID, Label)] -> BlockID -> CodeGen e s [(Maybe (Word32, TrapCause))]
+ efBB lmap bid = do
+ defineLabel $ getLabel bid lmap
+ ret <- mapM emit'' $ code bb
+ case successor bb of