Commit 60ee7636 authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

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

parents 0b20ae91 a0ba88be
...@@ -84,7 +84,7 @@ data Literal ...@@ -84,7 +84,7 @@ data Literal
-- First the primitive guys -- First the primitive guys
MachChar Char -- ^ @Char#@ - at least 31 bits. Create with 'mkMachChar' MachChar Char -- ^ @Char#@ - at least 31 bits. Create with 'mkMachChar'
| MachStr FastString -- ^ A string-literal: stored and emitted | MachStr FastBytes -- ^ A string-literal: stored and emitted
-- UTF-8 encoded, we'll arrange to decode it -- UTF-8 encoded, we'll arrange to decode it
-- at runtime. Also emitted with a @'\0'@ -- at runtime. Also emitted with a @'\0'@
-- terminator. Create with 'mkMachString' -- terminator. Create with 'mkMachString'
...@@ -248,7 +248,8 @@ mkMachChar = MachChar ...@@ -248,7 +248,8 @@ mkMachChar = MachChar
-- | Creates a 'Literal' of type @Addr#@, which is appropriate for passing to -- | Creates a 'Literal' of type @Addr#@, which is appropriate for passing to
-- e.g. some of the \"error\" functions in GHC.Err such as @GHC.Err.runtimeError@ -- e.g. some of the \"error\" functions in GHC.Err such as @GHC.Err.runtimeError@
mkMachString :: String -> Literal mkMachString :: String -> Literal
mkMachString s = MachStr (mkFastString s) -- stored UTF-8 encoded -- stored UTF-8 encoded
mkMachString s = MachStr (fastStringToFastBytes $ mkFastString s)
mkLitInteger :: Integer -> Type -> Literal mkLitInteger :: Integer -> Type -> Literal
mkLitInteger = LitInteger mkLitInteger = LitInteger
...@@ -436,7 +437,7 @@ pprLiteral :: (SDoc -> SDoc) -> Literal -> SDoc ...@@ -436,7 +437,7 @@ pprLiteral :: (SDoc -> SDoc) -> Literal -> SDoc
-- to wrap parens around literals that occur in -- to wrap parens around literals that occur in
-- a context requiring an atomic thing -- a context requiring an atomic thing
pprLiteral _ (MachChar ch) = pprHsChar ch pprLiteral _ (MachChar ch) = pprHsChar ch
pprLiteral _ (MachStr s) = pprHsString s pprLiteral _ (MachStr s) = pprHsBytes s
pprLiteral _ (MachInt i) = pprIntVal i pprLiteral _ (MachInt i) = pprIntVal i
pprLiteral _ (MachDouble d) = double (fromRat d) pprLiteral _ (MachDouble d) = double (fromRat d)
pprLiteral _ (MachNullAddr) = ptext (sLit "__NULL") pprLiteral _ (MachNullAddr) = ptext (sLit "__NULL")
...@@ -469,7 +470,7 @@ Hash values should be zero or a positive integer. No negatives please. ...@@ -469,7 +470,7 @@ Hash values should be zero or a positive integer. No negatives please.
\begin{code} \begin{code}
hashLiteral :: Literal -> Int hashLiteral :: Literal -> Int
hashLiteral (MachChar c) = ord c + 1000 -- Keep it out of range of common ints hashLiteral (MachChar c) = ord c + 1000 -- Keep it out of range of common ints
hashLiteral (MachStr s) = hashFS s hashLiteral (MachStr s) = hashFB s
hashLiteral (MachNullAddr) = 0 hashLiteral (MachNullAddr) = 0
hashLiteral (MachInt i) = hashInteger i hashLiteral (MachInt i) = hashInteger i
hashLiteral (MachInt64 i) = hashInteger i hashLiteral (MachInt64 i) = hashInteger i
......
...@@ -191,7 +191,7 @@ pprModuleName :: ModuleName -> SDoc ...@@ -191,7 +191,7 @@ pprModuleName :: ModuleName -> SDoc
pprModuleName (ModuleName nm) = pprModuleName (ModuleName nm) =
getPprStyle $ \ sty -> getPprStyle $ \ sty ->
if codeStyle sty if codeStyle sty
then ftext (zEncodeFS nm) then ztext (zEncodeFS nm)
else ftext nm else ftext nm
moduleNameFS :: ModuleName -> FastString moduleNameFS :: ModuleName -> FastString
...@@ -271,7 +271,7 @@ pprPackagePrefix p mod = getPprStyle doc ...@@ -271,7 +271,7 @@ pprPackagePrefix p mod = getPprStyle doc
| codeStyle sty = | codeStyle sty =
if p == mainPackageId if p == mainPackageId
then empty -- never qualify the main package in code then empty -- never qualify the main package in code
else ftext (zEncodeFS (packageIdFS p)) <> char '_' else ztext (zEncodeFS (packageIdFS p)) <> char '_'
| qualModule sty mod = ftext (packageIdFS (modulePackageId mod)) <> char ':' | qualModule sty mod = ftext (packageIdFS (modulePackageId mod)) <> char ':'
-- the PrintUnqualified tells us which modules have to -- the PrintUnqualified tells us which modules have to
-- be qualified with package names -- be qualified with package names
......
...@@ -514,7 +514,7 @@ ppr_occ_name occ = ftext (occNameFS occ) ...@@ -514,7 +514,7 @@ ppr_occ_name occ = ftext (occNameFS occ)
-- In code style, we Z-encode the strings. The results of Z-encoding each FastString are -- In code style, we Z-encode the strings. The results of Z-encoding each FastString are
-- cached behind the scenes in the FastString implementation. -- cached behind the scenes in the FastString implementation.
ppr_z_occ_name :: OccName -> SDoc ppr_z_occ_name :: OccName -> SDoc
ppr_z_occ_name occ = ftext (zEncodeFS (occNameFS occ)) ppr_z_occ_name occ = ztext (zEncodeFS (occNameFS occ))
-- Prints (if mod information is available) "Defined at <loc>" or -- Prints (if mod information is available) "Defined at <loc>" or
-- "Defined in <mod>" information for a Name. -- "Defined in <mod>" information for a Name.
......
...@@ -265,7 +265,7 @@ pprOccName :: OccName -> SDoc ...@@ -265,7 +265,7 @@ pprOccName :: OccName -> SDoc
pprOccName (OccName sp occ) pprOccName (OccName sp occ)
= getPprStyle $ \ sty -> = getPprStyle $ \ sty ->
if codeStyle sty if codeStyle sty
then ftext (zEncodeFS occ) then ztext (zEncodeFS occ)
else pp_occ <> pp_debug sty else pp_occ <> pp_debug sty
where where
pp_debug sty | debugStyle sty = braces (pprNameSpaceBrief sp) pp_debug sty | debugStyle sty = braces (pprNameSpaceBrief sp)
......
...@@ -18,13 +18,6 @@ Haskell). ...@@ -18,13 +18,6 @@ Haskell).
\begin{code} \begin{code}
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE BangPatterns #-}
{-# 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 Unique ( module Unique (
-- * Main data types -- * Main data types
Unique, Uniquable(..), Unique, Uniquable(..),
......
{- BlockId module should probably go away completely, being superseded by Label -} {- BlockId module should probably go away completely, being superseded by Label -}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module BlockId module BlockId
( BlockId, mkBlockId -- ToDo: BlockId should be abstract, but it isn't yet ( BlockId, mkBlockId -- ToDo: BlockId should be abstract, but it isn't yet
, BlockSet, BlockEnv , BlockSet, BlockEnv
......
-- Cmm representations using Hoopl's Graph CmmNode e x. -- Cmm representations using Hoopl's Graph CmmNode e x.
{-# LANGUAGE GADTs #-} {-# LANGUAGE GADTs #-}
{-# OPTIONS_GHC -fno-warn-warnings-deprecations #-} {-# OPTIONS_GHC -fno-warn-warnings-deprecations #-}
{-# OPTIONS_GHC -fno-warn-incomplete-patterns #-}
#if __GLASGOW_HASKELL__ >= 703
-- GHC 7.0.1 improved incomplete pattern warnings with GADTs
{-# OPTIONS_GHC -fwarn-incomplete-patterns #-}
#endif
module Cmm ( module Cmm (
-- * Cmm top-level datatypes -- * Cmm top-level datatypes
......
...@@ -48,11 +48,7 @@ import qualified Data.Set as Set ...@@ -48,11 +48,7 @@ import qualified Data.Set as Set
import Control.Monad import Control.Monad
foldSet :: (a -> b -> b) -> b -> Set a -> b foldSet :: (a -> b -> b) -> b -> Set a -> b
#if __GLASGOW_HASKELL__ < 704
foldSet = Set.fold
#else
foldSet = Set.foldr foldSet = Set.foldr
#endif
---------------------------------------------------------------- ----------------------------------------------------------------
-- Building InfoTables -- Building InfoTables
......
{-# LANGUAGE RecordWildCards, GADTs #-} {-# LANGUAGE RecordWildCards, GADTs #-}
#if __GLASGOW_HASKELL__ < 701
{-# OPTIONS_GHC -fno-warn-incomplete-patterns #-}
#endif
module CmmLayoutStack ( module CmmLayoutStack (
cmmLayoutStack, setInfoTableStackMap cmmLayoutStack, setInfoTableStackMap
) where ) where
......
...@@ -6,9 +6,6 @@ ...@@ -6,9 +6,6 @@
-- --
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
{-# LANGUAGE GADTs #-} {-# LANGUAGE GADTs #-}
#if __GLASGOW_HASKELL__ < 701
{-# OPTIONS_GHC -fno-warn-incomplete-patterns #-}
#endif
module CmmLint ( module CmmLint (
cmmLint, cmmLintGraph cmmLint, cmmLintGraph
) where ) where
......
...@@ -8,12 +8,6 @@ ...@@ -8,12 +8,6 @@
-- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#TabsvsSpaces -- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#TabsvsSpaces
-- for details -- for details
{-# OPTIONS_GHC -fno-warn-incomplete-patterns #-}
#if __GLASGOW_HASKELL__ >= 703
-- GHC 7.0.1 improved incomplete pattern warnings with GADTs
{-# OPTIONS_GHC -fwarn-incomplete-patterns #-}
#endif
module CmmNode ( module CmmNode (
CmmNode(..), ForeignHint(..), CmmFormal, CmmActual, CmmNode(..), ForeignHint(..), CmmFormal, CmmActual,
UpdFrameOffset, Convention(..), ForeignConvention(..), ForeignTarget(..), UpdFrameOffset, Convention(..), ForeignConvention(..), ForeignTarget(..),
......
{-# LANGUAGE GADTs, DisambiguateRecordFields #-} {-# LANGUAGE GADTs, DisambiguateRecordFields #-}
{-# OPTIONS_GHC -fno-warn-warnings-deprecations #-} {-# OPTIONS_GHC -fno-warn-warnings-deprecations #-}
#if __GLASGOW_HASKELL__ < 701
{-# OPTIONS_GHC -fno-warn-incomplete-patterns #-}
#endif
module CmmProcPoint module CmmProcPoint
( ProcPointSet, Status(..) ( ProcPointSet, Status(..)
......
...@@ -8,11 +8,6 @@ ...@@ -8,11 +8,6 @@
{-# OPTIONS_GHC -fno-warn-deprecations #-} {-# OPTIONS_GHC -fno-warn-deprecations #-}
-- Warnings from deprecated blockToNodeList -- Warnings from deprecated blockToNodeList
{-# OPTIONS_GHC -fno-warn-incomplete-patterns #-}
#if __GLASGOW_HASKELL__ >= 703
-- GHC 7.0.1 improved incomplete pattern warnings with GADTs
{-# OPTIONS_GHC -fwarn-incomplete-patterns #-}
#endif
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
......
#if __GLASGOW_HASKELL__ < 701
{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
#endif
module Hoopl ( module Hoopl (
module Compiler.Hoopl, module Compiler.Hoopl,
module Hoopl.Dataflow, module Hoopl.Dataflow,
......
...@@ -10,15 +10,8 @@ ...@@ -10,15 +10,8 @@
-- --
{-# LANGUAGE RankNTypes, ScopedTypeVariables, GADTs, EmptyDataDecls, PatternGuards, TypeFamilies, MultiParamTypeClasses #-} {-# LANGUAGE RankNTypes, ScopedTypeVariables, GADTs, EmptyDataDecls, PatternGuards, TypeFamilies, MultiParamTypeClasses #-}
#if __GLASGOW_HASKELL__ >= 703
{-# OPTIONS_GHC -fprof-auto-top #-} {-# OPTIONS_GHC -fprof-auto-top #-}
#endif
#if __GLASGOW_HASKELL__ >= 701
{-# LANGUAGE Trustworthy #-} {-# LANGUAGE Trustworthy #-}
#endif
#if __GLASGOW_HASKELL__ < 701
{-# OPTIONS_GHC -fno-warn-incomplete-patterns #-}
#endif
module Hoopl.Dataflow module Hoopl.Dataflow
( DataflowLattice(..), OldFact(..), NewFact(..), Fact, mkFactBase ( DataflowLattice(..), OldFact(..), NewFact(..), Fact, mkFactBase
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
-- A useful example pass over Cmm is in nativeGen/MachCodeGen.hs -- A useful example pass over Cmm is in nativeGen/MachCodeGen.hs
-- --
{-# OPTIONS_GHC -fno-warn-orphans #-}
module OldPprCmm ( module OldPprCmm (
pprStmt, pprStmt,
module PprCmmDecl, module PprCmmDecl,
......
This diff is collapsed.
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
-- --
-- A useful example pass over Cmm is in nativeGen/MachCodeGen.hs -- A useful example pass over Cmm is in nativeGen/MachCodeGen.hs
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE GADTs, TypeFamilies, FlexibleContexts #-} {-# LANGUAGE GADTs, TypeFamilies, FlexibleContexts #-}
module PprCmm module PprCmm
( module PprCmmDecl ( module PprCmmDecl
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
-- A useful example pass over Cmm is in nativeGen/MachCodeGen.hs -- A useful example pass over Cmm is in nativeGen/MachCodeGen.hs
-- --
{-# OPTIONS_GHC -fno-warn-orphans #-}
module PprCmmDecl module PprCmmDecl
( writeCmms, pprCmms, pprCmmGroup, pprSection, pprStatic ( writeCmms, pprCmms, pprCmmGroup, pprSection, pprStatic
) )
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
-- A useful example pass over Cmm is in nativeGen/MachCodeGen.hs -- A useful example pass over Cmm is in nativeGen/MachCodeGen.hs
-- --
{-# OPTIONS_GHC -fno-warn-orphans #-}
module PprCmmExpr module PprCmmExpr
( pprExpr, pprLit ( pprExpr, pprLit
, pprExpr9 {-only to import in OldPprCmm. When it dies, remove the export -} , pprExpr9 {-only to import in OldPprCmm. When it dies, remove the export -}
......
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