Commit fbff64a4 authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Merge branch 'master' of darcs.haskell.org:/home/darcs/ghc

parents 74d40186 d9674323
......@@ -52,7 +52,8 @@ Library
array >= 0.1 && < 0.5,
filepath >= 1 && < 1.4,
Cabal,
hpc
hpc,
transformers
if flag(stage1) && impl(ghc < 7.5)
Build-Depends: old-time >= 1 && < 1.2
......
......@@ -189,11 +189,15 @@ genCall env (PrimTarget MO_Touch) _ _
genCall env (PrimTarget (MO_UF_Conv w)) [dst] [e] = do
let (env1, dstV, stmts1, top1) = getCmmReg env (CmmLocal dst)
ty = cmmToLlvmType $ localRegType dst
width = widthToLlvmFloat w
castV <- mkLocalVar ty
(env2, ve, stmts2, top2) <- exprToVar env1 e
let stmt = Assignment dstV $ Cast LM_Uitofp ve width
stmts = stmts1 `appOL` stmts2 `snocOL` stmt
let stmt3 = Assignment castV $ Cast LM_Uitofp ve width
stmt4 = Store castV dstV
stmts = stmts1 `appOL` stmts2 `snocOL` stmt3 `snocOL` stmt4
return (env2, stmts, top1 ++ top2)
genCall _ (PrimTarget (MO_UF_Conv _)) [_] args =
panic $ "genCall: Too many arguments to MO_UF_Conv. " ++
"Can only handle 1, given" ++ show (length args) ++ "."
......
......@@ -2,41 +2,27 @@
-- | Utilities related to Monad and Applicative classes
-- Mostly for backwards compatability.
{-# OPTIONS -fno-warn-tabs #-}
-- The above warning supression flag is a temporary kludge.
-- While working on this module you are encouraged to remove it and
-- detab the module (please do the detabbing in a separate patch). See
-- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#TabsvsSpaces
-- for details
module MonadUtils
( Applicative(..)
, (<$>)
, MonadFix(..)
, MonadIO(..)
, liftIO1, liftIO2, liftIO3, liftIO4
, zipWith3M
, zipWith3M
, mapAndUnzipM, mapAndUnzip3M, mapAndUnzip4M
, mapAccumLM
, mapSndM
, concatMapM
, mapMaybeM
, fmapMaybeM, fmapEitherM
, fmapMaybeM, fmapEitherM
, anyM, allM
, foldlM, foldlM_, foldrM
, maybeMapM
) where
-------------------------------------------------------------------------------
-- Detection of available libraries
-------------------------------------------------------------------------------
-- we don't depend on MTL for now
#define HAVE_MTL 0
-------------------------------------------------------------------------------
-- Imports
-------------------------------------------------------------------------------
......@@ -44,23 +30,9 @@ module MonadUtils
import Maybes
import Control.Applicative
#if HAVE_MTL
import Control.Monad.Trans
#endif
import Control.Monad
import Control.Monad.Fix
-------------------------------------------------------------------------------
-- MTL
-------------------------------------------------------------------------------
#if !HAVE_MTL
class Monad m => MonadIO m where
liftIO :: IO a -> m a
instance MonadIO IO where liftIO = id
#endif
import Control.Monad.IO.Class
-------------------------------------------------------------------------------
-- Lift combinators
......@@ -92,7 +64,7 @@ zipWith3M :: Monad m => (a -> b -> c -> m d) -> [a] -> [b] -> [c] -> m [d]
zipWith3M _ [] _ _ = return []
zipWith3M _ _ [] _ = return []
zipWith3M _ _ _ [] = return []
zipWith3M f (x:xs) (y:ys) (z:zs)
zipWith3M f (x:xs) (y:ys) (z:zs)
= do { r <- f x y z
; rs <- zipWith3M f xs ys zs
; return $ r:rs
......@@ -152,7 +124,7 @@ fmapEitherM _ fr (Right b) = fr b >>= (return . Right)
anyM :: Monad m => (a -> m Bool) -> [a] -> m Bool
anyM _ [] = return False
anyM f (x:xs) = do b <- f x
if b then return True
if b then return True
else anyM f xs
-- | Monad version of 'all', aborts the computation at the first @False@ value
......
......@@ -330,7 +330,7 @@ endif
# They do not say "this package will be built"; see $(PACKAGES_xx) for that
# Packages that are built but not installed
PKGS_THAT_ARE_INTREE_ONLY := haskeline transformers terminfo xhtml
PKGS_THAT_ARE_INTREE_ONLY := haskeline terminfo xhtml
PKGS_THAT_ARE_DPH := \
dph/dph-base \
......@@ -355,7 +355,7 @@ PKGS_THAT_USE_TH := $(PKGS_THAT_ARE_DPH)
#
# We assume that the stage0 compiler has a suitable bytestring package,
# so we don't have to include it below.
PKGS_THAT_BUILD_WITH_STAGE0 = Cabal/Cabal hpc binary bin-package-db hoopl
PKGS_THAT_BUILD_WITH_STAGE0 = Cabal/Cabal hpc binary bin-package-db hoopl transformers
# $(EXTRA_PACKAGES) is another classification, of packages built but
# not installed
......@@ -1337,17 +1337,17 @@ BINDIST_LIBRARY_FLAGS = --enable-library-vanilla --disable-shared
endif
BINDIST_LIBRARY_FLAGS += --disable-library-prof
.PHONY: validate_build_transformers
validate_build_transformers:
cd libraries/transformers && "$(BINDIST_PREFIX)/bin/ghc" --make Setup
cd libraries/transformers && ./Setup configure --with-ghc="$(BINDIST_PREFIX)/bin/ghc" $(BINDIST_HADDOCK_FLAG) $(BINDIST_LIBRARY_FLAGS) --global --builddir=dist-bindist --prefix="$(BINDIST_PREFIX)"
cd libraries/transformers && ./Setup build --builddir=dist-bindist
.PHONY: validate_build_xhtml
validate_build_xhtml:
cd libraries/xhtml && "$(BINDIST_PREFIX)/bin/ghc" --make Setup
cd libraries/xhtml && ./Setup configure --with-ghc="$(BINDIST_PREFIX)/bin/ghc" $(BINDIST_HADDOCK_FLAG) $(BINDIST_LIBRARY_FLAGS) --global --builddir=dist-bindist --prefix="$(BINDIST_PREFIX)"
cd libraries/xhtml && ./Setup build --builddir=dist-bindist
ifeq "$(HADDOCK_DOCS)" "YES"
cd libraries/transformers && ./Setup haddock --builddir=dist-bindist
cd libraries/xhtml && ./Setup haddock --builddir=dist-bindist
endif
cd libraries/transformers && ./Setup install --builddir=dist-bindist
cd libraries/transformers && ./Setup clean --builddir=dist-bindist
cd libraries/transformers && rm -f Setup Setup.exe Setup.hi Setup.o
cd libraries/xhtml && ./Setup install --builddir=dist-bindist
cd libraries/xhtml && ./Setup clean --builddir=dist-bindist
cd libraries/xhtml && rm -f Setup Setup.exe Setup.hi Setup.o
# -----------------------------------------------------------------------------
# Numbered phase targets
......
......@@ -37,7 +37,6 @@ import SrcLoc
import Module
import ObjLink
import Linker
import qualified MonadUtils
import Exception
import Numeric
......@@ -47,13 +46,13 @@ import Data.IORef
import System.CPUTime
import System.Environment
import System.IO
import Control.Monad as Monad
import Control.Monad
import GHC.Exts
import System.Console.Haskeline (CompletionFunc, InputT)
import qualified System.Console.Haskeline as Haskeline
import Control.Monad.Trans.Class as Trans
import Control.Monad.IO.Class as Trans
import Control.Monad.Trans.Class
import Control.Monad.IO.Class
-----------------------------------------------------------------------------
-- GHCi monad
......@@ -186,11 +185,8 @@ modifyGHCiState f = GHCi $ \r -> liftIO $ readIORef r >>= writeIORef r . f
liftGhc :: Ghc a -> GHCi a
liftGhc m = GHCi $ \_ -> m
instance MonadUtils.MonadIO GHCi where
liftIO = liftGhc . MonadUtils.liftIO
instance Trans.MonadIO Ghc where
liftIO = MonadUtils.liftIO
instance MonadIO GHCi where
liftIO = liftGhc . liftIO
instance HasDynFlags GHCi where
getDynFlags = getSessionDynFlags
......@@ -206,9 +202,6 @@ instance GhcMonad (InputT GHCi) where
setSession = lift . setSession
getSession = lift getSession
instance MonadUtils.MonadIO (InputT GHCi) where
liftIO = Trans.liftIO
instance ExceptionMonad GHCi where
gcatch m h = GHCi $ \r -> unGHCi m r `gcatch` (\e -> unGHCi (h e) r)
gblock (GHCi m) = GHCi $ \r -> gblock (m r)
......@@ -220,9 +213,6 @@ instance ExceptionMonad GHCi where
in
unGHCi (f g_restore) s
instance MonadIO GHCi where
liftIO = MonadUtils.liftIO
instance Haskeline.MonadException Ghc where
controlIO f = Ghc $ \s -> Haskeline.controlIO $ \(Haskeline.RunIO run) -> let
run' = Haskeline.RunIO (fmap (Ghc . const) . run . flip unGhc s)
......@@ -259,7 +249,7 @@ printForUser :: GhcMonad m => SDoc -> m ()
printForUser doc = do
unqual <- GHC.getPrintUnqual
dflags <- getDynFlags
MonadUtils.liftIO $ Outputable.printForUser dflags stdout unqual doc
liftIO $ Outputable.printForUser dflags stdout unqual doc
printForUserPartWay :: SDoc -> GHCi ()
printForUserPartWay doc = do
......
......@@ -815,6 +815,8 @@ BUILD_DOCBOOK_HTML = @BUILD_DOCBOOK_HTML@
BUILD_DOCBOOK_PS = @BUILD_DOCBOOK_PS@
BUILD_DOCBOOK_PDF = @BUILD_DOCBOOK_PDF@
DBLATEX = @DblatexCmd@
# filename.as.url=0 is needed with dblatex 0.3.4 (#7486)
DBLATEX_OPTS = -P 'filename.as.url=0'
XSLTPROC = @XsltprocCmd@
XMLLINT = @XmllintCmd@
HAVE_DOCBOOK_XSL = @HAVE_DOCBOOK_XSL@
......
......@@ -39,12 +39,14 @@ GhcLibHcOpts += -O -dcore-lint
# We define DefaultFastGhcLibWays in this style so that the value is
# correct even if the user alters DYNAMIC_BY_DEFAULT
DefaultFastGhcLibWays = $(if $(filter $(DYNAMIC_BY_DEFAULT),YES),dyn,v)
DefaultProfGhcLibWays = $(if $(filter $(GhcProfiled),YES),p,)
ifeq "$(ValidateSpeed)" "FAST"
GhcLibWays = $(DefaultFastGhcLibWays)
else
GhcLibWays := $(filter v dyn,$(GhcLibWays))
endif
GhcLibWays += $(DefaultProfGhcLibWays)
SplitObjs = NO
NoFibWays =
STRIP_CMD = :
......@@ -113,6 +115,7 @@ libraries/mtl_dist-install_EXTRA_HC_OPTS += -Wwarn
libraries/primitive_dist-install_EXTRA_HC_OPTS += -Wwarn
# temporarily turn off -Werror for transformers
libraries/transformers_dist-boot_EXTRA_HC_OPTS += -Wwarn
libraries/transformers_dist-install_EXTRA_HC_OPTS += -Wwarn
# vector has some unused match warnings
......
......@@ -106,16 +106,13 @@ if [ $speed != "FAST" ]; then
$make test_bindist TEST_PREP=YES
#
# Install the transformers package into the bindist, because it is
# used by some tests.
# It isn't essential that we do this (the failing tests will
# be treated as expected failures), but we get a bit more test
# coverage, and also verify that we can install a package into the
# Install the xhtml package into the bindist.
# This verifies that we can install a package into the
# bindist with Cabal.
#
bindistdir="bindisttest/install dir"
$make validate_build_transformers BINDIST_PREFIX="$thisdir/$bindistdir"
$make validate_build_xhtml BINDIST_PREFIX="$thisdir/$bindistdir"
fi
fi # testsuite-only
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment