never executed always true always false
1 module GHC.CmmToAsm.AArch64.RegInfo where
2
3 import GHC.Prelude
4
5 import GHC.CmmToAsm.AArch64.Instr
6 import GHC.Cmm.BlockId
7 import GHC.Cmm
8
9 import GHC.Utils.Outputable
10
11 data JumpDest = DestBlockId BlockId
12
13 -- Debug Instance
14 instance Outputable JumpDest where
15 ppr (DestBlockId bid) = text "jd<blk>:" <> ppr bid
16
17 -- TODO: documen what this does. See Ticket 19914
18 getJumpDestBlockId :: JumpDest -> Maybe BlockId
19 getJumpDestBlockId (DestBlockId bid) = Just bid
20
21 -- TODO: document what this does. See Ticket 19914
22 canShortcut :: Instr -> Maybe JumpDest
23 canShortcut _ = Nothing
24
25 -- TODO: document what this does. See Ticket 19914
26 shortcutStatics :: (BlockId -> Maybe JumpDest) -> RawCmmStatics -> RawCmmStatics
27 shortcutStatics _ other_static = other_static
28
29 -- TODO: document what this does. See Ticket 19914
30 shortcutJump :: (BlockId -> Maybe JumpDest) -> Instr -> Instr
31 shortcutJump _ other = other