never executed always true always false
    1 {-# LANGUAGE GADTs #-}
    2 {-# LANGUAGE ScopedTypeVariables #-}
    3 
    4 module GHC.Cmm.LRegSet (
    5     LRegSet,
    6     LRegKey,
    7 
    8     emptyLRegSet,
    9     nullLRegSet,
   10     insertLRegSet,
   11     elemLRegSet,
   12 
   13     deleteFromLRegSet,
   14     sizeLRegSet,
   15 
   16     plusLRegSet,
   17     elemsLRegSet
   18   ) where
   19 
   20 import GHC.Prelude
   21 import GHC.Types.Unique
   22 import GHC.Cmm.Expr
   23 
   24 import Data.IntSet as IntSet
   25 
   26 -- Compact sets for membership tests of local variables.
   27 
   28 type LRegSet = IntSet.IntSet
   29 type LRegKey = Int
   30 
   31 emptyLRegSet :: LRegSet
   32 emptyLRegSet = IntSet.empty
   33 
   34 nullLRegSet :: LRegSet -> Bool
   35 nullLRegSet = IntSet.null
   36 
   37 insertLRegSet :: LocalReg -> LRegSet -> LRegSet
   38 insertLRegSet l = IntSet.insert (getKey (getUnique l))
   39 
   40 elemLRegSet :: LocalReg -> LRegSet -> Bool
   41 elemLRegSet l = IntSet.member (getKey (getUnique l))
   42 
   43 deleteFromLRegSet :: LRegSet -> LocalReg -> LRegSet
   44 deleteFromLRegSet set reg = IntSet.delete (getKey . getUnique $ reg) set
   45 
   46 sizeLRegSet :: IntSet -> Int
   47 sizeLRegSet = IntSet.size
   48 
   49 plusLRegSet :: IntSet -> IntSet -> IntSet
   50 plusLRegSet = IntSet.union
   51 
   52 elemsLRegSet :: IntSet -> [Int]
   53 elemsLRegSet = IntSet.toList