summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorDavid Terei <davidterei@gmail.com>2011-06-14 14:04:11 -0700
committerDavid Terei <davidterei@gmail.com>2011-06-17 20:40:34 -0700
commit1d704e17caef8156a3d4c4b764737ede85884eb8 (patch)
treefdc5c2b7023d16b4aa111739c314be37c5de8e45 /compiler
parent90bab6b82256b5dc0562e46a091b4dcfce18f804 (diff)
downloadhaskell-1d704e17caef8156a3d4c4b764737ede85884eb8.tar.gz
SafeHaskell: Make base GHC.* modules untrusted
Diffstat (limited to 'compiler')
-rw-r--r--compiler/basicTypes/UniqSupply.lhs2
-rw-r--r--compiler/ghc.cabal.in1
-rw-r--r--compiler/ghci/ByteCodeItbls.lhs2
-rw-r--r--compiler/ghci/ByteCodeLink.lhs2
-rw-r--r--compiler/ghci/RtClosureInspect.hs4
-rw-r--r--compiler/main/BreakArray.hs2
-rw-r--r--compiler/prelude/PrelNames.lhs8
-rw-r--r--compiler/utils/Binary.hs2
-rw-r--r--compiler/utils/Encoding.hs6
-rw-r--r--compiler/utils/FastFunctions.lhs2
-rw-r--r--compiler/utils/FastMutInt.lhs5
-rw-r--r--compiler/utils/FastString.lhs5
-rw-r--r--compiler/utils/GhcIO.hs24
-rw-r--r--compiler/utils/Pretty.lhs6
14 files changed, 16 insertions, 55 deletions
diff --git a/compiler/basicTypes/UniqSupply.lhs b/compiler/basicTypes/UniqSupply.lhs
index 4e1de6ad47..f34172f7b2 100644
--- a/compiler/basicTypes/UniqSupply.lhs
+++ b/compiler/basicTypes/UniqSupply.lhs
@@ -29,7 +29,7 @@ module UniqSupply (
import Unique
import FastTypes
-import GhcIO (unsafeDupableInterleaveIO)
+import GHC.IO (unsafeDupableInterleaveIO)
import MonadUtils
import Control.Monad
diff --git a/compiler/ghc.cabal.in b/compiler/ghc.cabal.in
index 7fffe83be2..2711c1b20e 100644
--- a/compiler/ghc.cabal.in
+++ b/compiler/ghc.cabal.in
@@ -435,7 +435,6 @@ Library
FastTypes
Fingerprint
FiniteMap
- GhcIO
GraphBase
GraphColor
GraphOps
diff --git a/compiler/ghci/ByteCodeItbls.lhs b/compiler/ghci/ByteCodeItbls.lhs
index 4ff9e0a2b7..943c9e9992 100644
--- a/compiler/ghci/ByteCodeItbls.lhs
+++ b/compiler/ghci/ByteCodeItbls.lhs
@@ -36,7 +36,7 @@ import Foreign.C.String
import Data.Bits ( Bits(..), shiftR )
import GHC.Exts ( Int(I#), addr2Int# )
-import GHC.Ptr.Unsafe ( Ptr(..) )
+import GHC.Ptr ( Ptr(..) )
import Debug.Trace
import Text.Printf
diff --git a/compiler/ghci/ByteCodeLink.lhs b/compiler/ghci/ByteCodeLink.lhs
index 7fdc2744f4..d4ddcc4ba2 100644
--- a/compiler/ghci/ByteCodeLink.lhs
+++ b/compiler/ghci/ByteCodeLink.lhs
@@ -44,7 +44,7 @@ import Data.Array.Base
import Control.Monad ( zipWithM )
import Control.Monad.ST ( stToIO )
-import GHC.Arr.Unsafe ( Array(..), STArray(..) )
+import GHC.Arr ( Array(..), STArray(..) )
import GHC.Base ( writeArray#, RealWorld, Int(..), Word# )
import GHC.IOBase ( IO(..) )
import GHC.Exts
diff --git a/compiler/ghci/RtClosureInspect.hs b/compiler/ghci/RtClosureInspect.hs
index 358c7e63c3..97485281e1 100644
--- a/compiler/ghci/RtClosureInspect.hs
+++ b/compiler/ghci/RtClosureInspect.hs
@@ -53,9 +53,9 @@ import DynFlags
import Outputable as Ppr
import FastString
import Constants ( wORD_SIZE )
-import GHC.Arr.Unsafe ( Array(..) )
+import GHC.Arr ( Array(..) )
import GHC.Exts
-import GhcIO ( IO(..) )
+import GHC.IO ( IO(..) )
import StaticFlags( opt_PprStyle_Debug )
import Control.Monad
diff --git a/compiler/main/BreakArray.hs b/compiler/main/BreakArray.hs
index 29d7d77439..4d2c07bba9 100644
--- a/compiler/main/BreakArray.hs
+++ b/compiler/main/BreakArray.hs
@@ -26,7 +26,7 @@ module BreakArray
) where
#ifdef GHCI
import GHC.Exts
-import GhcIO ( IO(..) )
+import GHC.IO ( IO(..) )
import Constants
data BreakArray = BA (MutableByteArray# RealWorld)
diff --git a/compiler/prelude/PrelNames.lhs b/compiler/prelude/PrelNames.lhs
index 92240515e1..4fd23ee712 100644
--- a/compiler/prelude/PrelNames.lhs
+++ b/compiler/prelude/PrelNames.lhs
@@ -313,10 +313,10 @@ dATA_TRAVERSABLE= mkBaseModule (fsLit "Data.Traversable")
gHC_CONC = mkBaseModule (fsLit "GHC.Conc")
gHC_IO = mkBaseModule (fsLit "GHC.IO")
gHC_IO_Exception = mkBaseModule (fsLit "GHC.IO.Exception")
-gHC_ST = mkBaseModule (fsLit "GHC.ST.Imp")
-gHC_ARR = mkBaseModule (fsLit "GHC.Arr.Imp")
-gHC_STABLE = mkBaseModule (fsLit "GHC.Stable.Imp")
-gHC_PTR = mkBaseModule (fsLit "GHC.Ptr.Imp")
+gHC_ST = mkBaseModule (fsLit "GHC.ST")
+gHC_ARR = mkBaseModule (fsLit "GHC.Arr")
+gHC_STABLE = mkBaseModule (fsLit "GHC.Stable")
+gHC_PTR = mkBaseModule (fsLit "GHC.Ptr")
gHC_ERR = mkBaseModule (fsLit "GHC.Err")
gHC_REAL = mkBaseModule (fsLit "GHC.Real")
gHC_FLOAT = mkBaseModule (fsLit "GHC.Float")
diff --git a/compiler/utils/Binary.hs b/compiler/utils/Binary.hs
index 80e9171aa4..c5a2c8f4fd 100644
--- a/compiler/utils/Binary.hs
+++ b/compiler/utils/Binary.hs
@@ -82,7 +82,7 @@ import GHC.Real ( Ratio(..) )
import GHC.Exts
import GHC.Word ( Word8(..) )
-import GhcIO ( IO(..) )
+import GHC.IO ( IO(..) )
type BinArray = ForeignPtr Word8
diff --git a/compiler/utils/Encoding.hs b/compiler/utils/Encoding.hs
index 4351538702..6467377a1a 100644
--- a/compiler/utils/Encoding.hs
+++ b/compiler/utils/Encoding.hs
@@ -32,11 +32,7 @@ module Encoding (
import Foreign
import Data.Char
import Numeric
-#if __GLASGOW_HASKELL__ >= 701
-import GHC.Ptr.Unsafe ( Ptr(..) )
-#else
-import GHC.Ptr ( Ptr(..) )
-#endif
+import GHC.Ptr ( Ptr(..) )
import GHC.Base
-- -----------------------------------------------------------------------------
diff --git a/compiler/utils/FastFunctions.lhs b/compiler/utils/FastFunctions.lhs
index 0734240287..b1dacdcd9b 100644
--- a/compiler/utils/FastFunctions.lhs
+++ b/compiler/utils/FastFunctions.lhs
@@ -24,7 +24,7 @@ import GHC.Exts
import GHC.Word
import GHC.Base (unsafeChr)
-import GhcIO (IO(..), unsafeDupableInterleaveIO)
+import GHC.IO (IO(..), unsafeDupableInterleaveIO)
-- Just like unsafePerformIO, but we inline it.
{-# INLINE inlinePerformIO #-}
diff --git a/compiler/utils/FastMutInt.lhs b/compiler/utils/FastMutInt.lhs
index 3a18a13501..26183071f1 100644
--- a/compiler/utils/FastMutInt.lhs
+++ b/compiler/utils/FastMutInt.lhs
@@ -26,12 +26,7 @@ module FastMutInt(
#endif
import GHC.Base
-#if __GLASGOW_HASKELL__ >= 701
-import GHC.Ptr.Safe
-import GHC.Ptr.Unsafe
-#else
import GHC.Ptr
-#endif
#else /* ! __GLASGOW_HASKELL__ */
diff --git a/compiler/utils/FastString.lhs b/compiler/utils/FastString.lhs
index b1449edae2..35d4387dd3 100644
--- a/compiler/utils/FastString.lhs
+++ b/compiler/utils/FastString.lhs
@@ -105,14 +105,13 @@ import Data.IORef ( IORef, newIORef, readIORef, writeIORef )
import Data.Maybe ( isJust )
import Data.Char ( ord )
-import GhcIO ( IO(..) )
+import GHC.IO ( IO(..) )
+import GHC.Ptr ( Ptr(..) )
#if __GLASGOW_HASKELL__ >= 701
import Foreign.Safe
-import GHC.Ptr.Unsafe ( Ptr(..) )
#else
import Foreign hiding ( unsafePerformIO )
-import GHC.Ptr ( Ptr(..) )
#endif
#if defined(__GLASGOW_HASKELL__)
diff --git a/compiler/utils/GhcIO.hs b/compiler/utils/GhcIO.hs
deleted file mode 100644
index 17198de071..0000000000
--- a/compiler/utils/GhcIO.hs
+++ /dev/null
@@ -1,24 +0,0 @@
-
--- | A simple version compatability wrapper around GHC.IO.
---
--- This module exports both the safe and Unsafe version of GHC.IO
--- taking care of the SafeHaskell changeover which spit up the
--- old GHC.IO module.
---
-module GhcIO (
-#if __GLASGOW_HASKELL__ >= 701
- module GHC.IO.Safe,
- module GHC.IO.Unsafe
-#else
- module GHC.IO
-#endif
- ) where
-
-#if __GLASGOW_HASKELL__ >= 701
-import GHC.IO.Safe
-import GHC.IO.Unsafe
-#else
-import GHC.IO
-#endif
-
-
diff --git a/compiler/utils/Pretty.lhs b/compiler/utils/Pretty.lhs
index 7b2702d471..0493daabee 100644
--- a/compiler/utils/Pretty.lhs
+++ b/compiler/utils/Pretty.lhs
@@ -193,11 +193,7 @@ import System.IO
--for a RULES
import GHC.Base ( unpackCString# )
import GHC.Exts ( Int# )
-#if __GLASGOW_HASKELL__ >= 701
-import GHC.Ptr.Unsafe ( Ptr(..) )
-#else
-import GHC.Ptr ( Ptr(..) )
-#endif
+import GHC.Ptr ( Ptr(..) )
#endif
-- Don't import Util( assertPanic ) because it makes a loop in the module structure