blob: f5f355a74e1268bcac416424d316c2829d6dab5c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
module T20725 where
import GHC.Cmm
import GHC.Cmm.Dataflow
import GHC.Cmm.Dataflow.Block
import GHC.Cmm.Dataflow.Collections
import GHC.Cmm.Dataflow.Graph
import GHC.Cmm.Dataflow.Label
data TrivialFact = TrivialFact
trivialLattice :: DataflowLattice TrivialFact
trivialLattice = DataflowLattice TrivialFact (\_ _ -> NotChanged TrivialFact)
-- | ensures that analysis is possible independent of node type
trivialMap :: forall node .
(NonLocal node)
=> GenCmmGraph node
-> LabelMap TrivialFact
trivialMap g =
analyzeCmmFwd trivialLattice transfer g startFacts
where startFacts = mkFactBase trivialLattice []
transfer block facts =
asBase [(successor, TrivialFact) | successor <- successors block]
where asBase = mkFactBase trivialLattice
|