Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[hoopl] fix ghc warnings
  • Loading branch information
pmurias committed Apr 15, 2011
1 parent 5615c21 commit a31f8f4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 6 additions & 3 deletions hoopl/ConstProp.hs
@@ -1,6 +1,7 @@
{-# OPTIONS_GHC -Wall -fno-warn-name-shadowing #-}
{-# LANGUAGE ScopedTypeVariables, GADTs, NoMonomorphismRestriction #-}
module ConstProp (ConstFact, constLattice, initFact, varHasLit, constProp, constPropPass) where
module ConstProp (ConstFact, constLattice, initFact, varHasLit, constProp, constPropPass, M) where


--import Control.Monad
import Insn
Expand All @@ -16,6 +17,7 @@ import Compiler.Hoopl
-- Top => variable's value is not constant
-- Type and definition of the lattice

type M = CheckingFuelMonad (SimpleUniqueMonad)
type ConstFact = Map.Map Int (WithTop Expr)
constLattice :: DataflowLattice ConstFact
constLattice = DataflowLattice
Expand Down Expand Up @@ -46,6 +48,7 @@ varHasLit = mkFTransfer ft
ft (RegSet reg constant@(Double _)) f = Map.insert reg (PElem constant) f
ft (RegSet reg _) f = Map.insert reg Top f

constPropPass :: FwdPass M Insn ConstFact
constPropPass = FwdPass
{ fp_lattice = constLattice
, fp_transfer = varHasLit
Expand Down Expand Up @@ -76,7 +79,7 @@ simplify :: FuelMonad m => FwdRewrite m Insn ConstFact
simplify = mkFRewrite s
where
s :: (Monad m) => Insn e x -> a -> m (Maybe (Graph Insn e x))
s (BifPlus reg (Double a) (Double b)) f = return $ Just $ mkMiddle $ RegSet reg (Double (a+b))
s _ f = return Nothing
s (BifPlus reg (Double a) (Double b)) _ = return $ Just $ mkMiddle $ RegSet reg (Double (a+b))
s _ _ = return Nothing


1 change: 0 additions & 1 deletion hoopl/nam.hs
Expand Up @@ -11,7 +11,6 @@ import Control.Monad.State.Strict
import System.Environment
mainLineNam = nam . head . xref

type M = CheckingFuelMonad (SimpleUniqueMonad)

unmonad :: M a -> a
unmonad p = (runSimpleUniqueMonad $ runWithFuel 99999 p)
Expand Down

0 comments on commit a31f8f4

Please sign in to comment.