module RegAlloc.Linear.Base (
BlockAssignment,
+
Loc(..),
+ regsOfLoc,
-- for stats
SpillReason(..),
import RegAlloc.Linear.StackMap
import RegLiveness
-import MachRegs
+import Regs
import Outputable
import Unique
ppr l = text (show l)
+-- | Get the reg numbers stored in this Loc.
+regsOfLoc :: Loc -> [RegNo]
+regsOfLoc (InReg r) = [r]
+regsOfLoc (InBoth r _) = [r]
+regsOfLoc (InMem _) = []
+
+
-- | Reasons why instructions might be inserted by the spiller.
-- Used when generating stats for -ddrop-asm-stats.
--
data RA_State
= RA_State
+ {
-- | the current mapping from basic blocks to
-- the register assignments at the beginning of that block.
- { ra_blockassig :: BlockAssignment
+ ra_blockassig :: BlockAssignment
-- | free machine registers
, ra_freeregs :: {-#UNPACK#-}!FreeRegs