hmap = rawMapBB method
getLabel :: BlockID -> [(BlockID, Label)] -> Label
- getLabel _ [] = error "label not found!"
+ getLabel bid [] = error $ "label " ++ show bid ++ " not found"
getLabel i ((x,l):xs) = if i==x then l else getLabel i xs
efBB :: (BlockID, BasicBlock) -> TrapMap -> BBStarts -> [(BlockID, Label)] -> CodeGen e s (TrapMap, BBStarts)
getCurrentOffset :: CodeGen e s Word32
getCurrentOffset = do
- ep <- (fromIntegral . ptrToIntPtr) `liftM` getEntryPoint
- offset <- fromIntegral `liftM` getCodeOffset
+ ep <- (fromIntegral . ptrToIntPtr) <$> getEntryPoint
+ offset <- fromIntegral <$> getCodeOffset
return $ ep + offset
emitInvoke :: Word16 -> Bool -> CodeGen e s (Maybe (Word32, TrapCause))