SafeHaskell: Make base GHC.* modules untrusted
authorDavid Terei <davidterei@gmail.com>
Tue, 14 Jun 2011 21:04:11 +0000 (14:04 -0700)
committerDavid Terei <davidterei@gmail.com>
Sat, 18 Jun 2011 03:40:34 +0000 (20:40 -0700)
15 files changed:
compiler/basicTypes/UniqSupply.lhs
compiler/ghc.cabal.in
compiler/ghci/ByteCodeItbls.lhs
compiler/ghci/ByteCodeLink.lhs
compiler/ghci/RtClosureInspect.hs
compiler/main/BreakArray.hs
compiler/prelude/PrelNames.lhs
compiler/utils/Binary.hs
compiler/utils/Encoding.hs
compiler/utils/FastFunctions.lhs
compiler/utils/FastMutInt.lhs
compiler/utils/FastString.lhs
compiler/utils/GhcIO.hs [deleted file]
compiler/utils/Pretty.lhs
rts/Prelude.h

index 4e1de6a..f34172f 100644 (file)
@@ -29,7 +29,7 @@ module UniqSupply (
 import Unique
 import FastTypes
 
-import GhcIO (unsafeDupableInterleaveIO)
+import GHC.IO (unsafeDupableInterleaveIO)
 
 import MonadUtils
 import Control.Monad
index 7fffe83..2711c1b 100644 (file)
@@ -435,7 +435,6 @@ Library
         FastTypes
         Fingerprint
         FiniteMap
-        GhcIO
         GraphBase
         GraphColor
         GraphOps
index 4ff9e0a..943c9e9 100644 (file)
@@ -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
index 7fdc274..d4ddcc4 100644 (file)
@@ -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
index 358c7e6..9748528 100644 (file)
@@ -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
index 29d7d77..4d2c07b 100644 (file)
@@ -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)
index 9224051..4fd23ee 100644 (file)
@@ -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")
index 80e9171..c5a2c8f 100644 (file)
@@ -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
 
index 4351538..6467377 100644 (file)
@@ -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
 
 -- -----------------------------------------------------------------------------
index 0734240..b1dacdc 100644 (file)
@@ -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 #-}
index 3a18a13..2618307 100644 (file)
@@ -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__ */
 
index b1449ed..35d4387 100644 (file)
@@ -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 (file)
index 17198de..0000000
+++ /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
-
-
index 7b2702d..0493daa 100644 (file)
@@ -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
index e32980e..86bb609 100644 (file)
@@ -43,7 +43,7 @@ PRELUDE_CLOSURE(base_GHCziIOziException_blockedIndefinitelyOnSTM_closure);
 PRELUDE_CLOSURE(base_ControlziExceptionziBase_nonTermination_closure);
 PRELUDE_CLOSURE(base_ControlziExceptionziBase_nestedAtomically_closure);
 
-PRELUDE_CLOSURE(base_GHCziConcziSyncziImp_runSparks_closure);
+PRELUDE_CLOSURE(base_GHCziConcziSync_runSparks_closure);
 PRELUDE_CLOSURE(base_GHCziConcziIO_ensureIOManagerIsRunning_closure);
 PRELUDE_CLOSURE(base_GHCziConcziSignal_runHandlers_closure);
 
@@ -52,8 +52,8 @@ PRELUDE_INFO(ghczmprim_GHCziTypes_Izh_static_info);
 PRELUDE_INFO(ghczmprim_GHCziTypes_Fzh_static_info);
 PRELUDE_INFO(ghczmprim_GHCziTypes_Dzh_static_info);
 PRELUDE_INFO(base_Addr_Azh_static_info);
-PRELUDE_INFO(base_GHCziPtrziImp_Ptr_static_info);
-PRELUDE_INFO(base_GHCziPtrziImp_FunPtr_static_info);
+PRELUDE_INFO(base_GHCziPtr_Ptr_static_info);
+PRELUDE_INFO(base_GHCziPtr_FunPtr_static_info);
 PRELUDE_INFO(base_GHCziInt_I8zh_static_info);
 PRELUDE_INFO(base_GHCziInt_I16zh_static_info);
 PRELUDE_INFO(base_GHCziInt_I32zh_static_info);
@@ -67,8 +67,8 @@ PRELUDE_INFO(ghczmprim_GHCziTypes_Czh_con_info);
 PRELUDE_INFO(ghczmprim_GHCziTypes_Izh_con_info);
 PRELUDE_INFO(ghczmprim_GHCziTypes_Fzh_con_info);
 PRELUDE_INFO(ghczmprim_GHCziTypes_Dzh_con_info);
-PRELUDE_INFO(base_GHCziPtrziImp_Ptr_con_info);
-PRELUDE_INFO(base_GHCziPtrziImp_FunPtr_con_info);
+PRELUDE_INFO(base_GHCziPtr_Ptr_con_info);
+PRELUDE_INFO(base_GHCziPtr_FunPtr_con_info);
 PRELUDE_INFO(base_Addr_Azh_con_info);
 PRELUDE_INFO(base_GHCziWord_Wzh_con_info);
 PRELUDE_INFO(base_GHCziInt_I8zh_con_info);
@@ -79,8 +79,8 @@ PRELUDE_INFO(base_GHCziWord_W8zh_con_info);
 PRELUDE_INFO(base_GHCziWord_W16zh_con_info);
 PRELUDE_INFO(base_GHCziWord_W32zh_con_info);
 PRELUDE_INFO(base_GHCziWord_W64zh_con_info);
-PRELUDE_INFO(base_GHCziStableziImp_StablePtr_static_info);
-PRELUDE_INFO(base_GHCziStableziImp_StablePtr_con_info);
+PRELUDE_INFO(base_GHCziStable_StablePtr_static_info);
+PRELUDE_INFO(base_GHCziStable_StablePtr_con_info);
 
 #define True_closure              DLL_IMPORT_DATA_REF(ghczmprim_GHCziTypes_True_closure)
 #define False_closure             DLL_IMPORT_DATA_REF(ghczmprim_GHCziTypes_False_closure)
@@ -88,7 +88,7 @@ PRELUDE_INFO(base_GHCziStableziImp_StablePtr_con_info);
 #define runFinalizerBatch_closure DLL_IMPORT_DATA_REF(base_GHCziWeak_runFinalizzerBatch_closure)
 #define mainIO_closure            (&ZCMain_main_closure)
 
-#define runSparks_closure         DLL_IMPORT_DATA_REF(base_GHCziConcziSyncziImp_runSparks_closure)
+#define runSparks_closure         DLL_IMPORT_DATA_REF(base_GHCziConcziSync_runSparks_closure)
 #define ensureIOManagerIsRunning_closure DLL_IMPORT_DATA_REF(base_GHCziConcziIO_ensureIOManagerIsRunning_closure)
 #define runHandlers_closure       DLL_IMPORT_DATA_REF(base_GHCziConcziSignal_runHandlers_closure)
 
@@ -113,8 +113,8 @@ PRELUDE_INFO(base_GHCziStableziImp_StablePtr_con_info);
 #define W16zh_static_info         DLL_IMPORT_DATA_REF(base_GHCziWord_W16zh_static_info)
 #define W32zh_static_info         DLL_IMPORT_DATA_REF(base_GHCziWord_W32zh_static_info)
 #define W64zh_static_info         DLL_IMPORT_DATA_REF(base_GHCziWord_W64zh_static_info)
-#define Ptr_static_info           DLL_IMPORT_DATA_REF(base_GHCziPtrziImp_Ptr_static_info)
-#define FunPtr_static_info        DLL_IMPORT_DATA_REF(base_GHCziPtrziImp_FunPtr_static_info)
+#define Ptr_static_info           DLL_IMPORT_DATA_REF(base_GHCziPtr_Ptr_static_info)
+#define FunPtr_static_info        DLL_IMPORT_DATA_REF(base_GHCziPtr_FunPtr_static_info)
 #define Czh_con_info              DLL_IMPORT_DATA_REF(ghczmprim_GHCziTypes_Czh_con_info)
 #define Izh_con_info              DLL_IMPORT_DATA_REF(ghczmprim_GHCziTypes_Izh_con_info)
 #define Fzh_con_info              DLL_IMPORT_DATA_REF(ghczmprim_GHCziTypes_Fzh_con_info)
@@ -130,9 +130,9 @@ PRELUDE_INFO(base_GHCziStableziImp_StablePtr_con_info);
 #define I32zh_con_info            DLL_IMPORT_DATA_REF(base_GHCziInt_I32zh_con_info)
 #define I64zh_con_info            DLL_IMPORT_DATA_REF(base_GHCziInt_I64zh_con_info)
 #define I64zh_con_info            DLL_IMPORT_DATA_REF(base_GHCziInt_I64zh_con_info)
-#define Ptr_con_info              DLL_IMPORT_DATA_REF(base_GHCziPtrziImp_Ptr_con_info)
-#define FunPtr_con_info           DLL_IMPORT_DATA_REF(base_GHCziPtrziImp_FunPtr_con_info)
-#define StablePtr_static_info     DLL_IMPORT_DATA_REF(base_GHCziStableziImp_StablePtr_static_info)
-#define StablePtr_con_info        DLL_IMPORT_DATA_REF(base_GHCziStableziImp_StablePtr_con_info)
+#define Ptr_con_info              DLL_IMPORT_DATA_REF(base_GHCziPtr_Ptr_con_info)
+#define FunPtr_con_info           DLL_IMPORT_DATA_REF(base_GHCziPtr_FunPtr_con_info)
+#define StablePtr_static_info     DLL_IMPORT_DATA_REF(base_GHCziStable_StablePtr_static_info)
+#define StablePtr_con_info        DLL_IMPORT_DATA_REF(base_GHCziStable_StablePtr_con_info)
 
 #endif /* PRELUDE_H */