Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
jberryman
GHC
Commits
1c83695b
Commit
1c83695b
authored
May 29, 2009
by
Simon Marlow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changes for the new IO library, mainly base-package modules moving around
parent
2675f2b6
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
95 additions
and
30 deletions
+95
-30
compiler/basicTypes/UniqSupply.lhs
compiler/basicTypes/UniqSupply.lhs
+4
-0
compiler/ghci/ByteCodeAsm.lhs
compiler/ghci/ByteCodeAsm.lhs
+6
-1
compiler/ghci/RtClosureInspect.hs
compiler/ghci/RtClosureInspect.hs
+6
-1
compiler/main/BreakArray.hs
compiler/main/BreakArray.hs
+5
-1
compiler/prelude/PrelNames.lhs
compiler/prelude/PrelNames.lhs
+11
-10
compiler/utils/Binary.hs
compiler/utils/Binary.hs
+6
-1
compiler/utils/FastFunctions.lhs
compiler/utils/FastFunctions.lhs
+12
-1
compiler/utils/FastMutInt.lhs
compiler/utils/FastMutInt.lhs
+6
-1
compiler/utils/FastString.lhs
compiler/utils/FastString.lhs
+6
-1
configure.ac
configure.ac
+1
-1
ghc/GhciMonad.hs
ghc/GhciMonad.hs
+3
-3
ghc/InteractiveUI.hs
ghc/InteractiveUI.hs
+12
-1
rts/Prelude.h
rts/Prelude.h
+8
-8
rts/RtsStartup.c
rts/RtsStartup.c
+5
-0
utils/ghc-pkg/Main.hs
utils/ghc-pkg/Main.hs
+4
-0
No files found.
compiler/basicTypes/UniqSupply.lhs
View file @
1c83695b
...
...
@@ -31,7 +31,11 @@ import FastTypes
import MonadUtils
import Control.Monad
import Control.Monad.Fix
#if __GLASGOW_HASKELL__ >= 611
import GHC.IO (unsafeDupableInterleaveIO)
#else
import GHC.IOBase (unsafeDupableInterleaveIO)
#endif
\end{code}
...
...
compiler/ghci/ByteCodeAsm.lhs
View file @
1c83695b
...
...
@@ -46,9 +46,14 @@ import Data.Int ( Int64 )
import Data.Char ( ord )
import GHC.Base ( ByteArray#, MutableByteArray#, RealWorld )
import GHC.IOBase ( IO(..) )
import GHC.Ptr ( Ptr(..) )
#if __GLASGOW_HASKELL__ >= 611
import GHC.IO ( IO(..) )
#else
import GHC.IOBase ( IO(..) )
#endif
-- -----------------------------------------------------------------------------
-- Unlinked BCOs
...
...
compiler/ghci/RtClosureInspect.hs
View file @
1c83695b
...
...
@@ -60,7 +60,12 @@ import Constants ( wORD_SIZE )
import
GHC.Arr
(
Array
(
..
)
)
import
GHC.Exts
import
GHC.IOBase
(
IO
(
IO
)
)
#
if
__GLASGOW_HASKELL__
>=
611
import
GHC.IO
(
IO
(
..
)
)
#
else
import
GHC.IOBase
(
IO
(
..
)
)
#
endif
import
Control.Monad
import
Data.Maybe
...
...
compiler/main/BreakArray.hs
View file @
1c83695b
...
...
@@ -26,7 +26,11 @@ module BreakArray
)
where
#
ifdef
GHCI
import
GHC.Exts
import
GHC.IOBase
#
if
__GLASGOW_HASKELL__
>=
611
import
GHC.IO
(
IO
(
..
)
)
#
else
import
GHC.IOBase
(
IO
(
..
)
)
#
endif
import
GHC.Word
import
Constants
...
...
compiler/prelude/PrelNames.lhs
View file @
1c83695b
...
...
@@ -237,7 +237,7 @@ pRELUDE = mkBaseModule_ pRELUDE_NAME
gHC_PRIM, gHC_TYPES, gHC_BOOL, gHC_UNIT, gHC_ORDERING, gHC_GENERICS, gHC_CLASSES, gHC_BASE, gHC_ENUM,
gHC_SHOW, gHC_READ, gHC_NUM, gHC_INTEGER, gHC_INTEGER_INTERNALS, gHC_LIST, gHC_PARR,
gHC_TUPLE, dATA_TUPLE, dATA_EITHER, dATA_STRING, dATA_FOLDABLE, dATA_TRAVERSABLE,
gHC_PACK, gHC_CONC, gHC_IO
_BASE
,
gHC_PACK, gHC_CONC, gHC_IO
, gHC_IO_Exception
,
gHC_ST, gHC_ARR, gHC_STABLE, gHC_ADDR, gHC_PTR, gHC_ERR, gHC_REAL,
gHC_FLOAT, gHC_TOP_HANDLER, sYSTEM_IO, dYNAMIC, tYPEABLE, gENERICS,
dOTNET, rEAD_PREC, lEX, gHC_INT, gHC_WORD, mONAD, mONAD_FIX, aRROW, cONTROL_APPLICATIVE,
...
...
@@ -266,7 +266,8 @@ dATA_FOLDABLE = mkBaseModule (fsLit "Data.Foldable")
dATA_TRAVERSABLE= mkBaseModule (fsLit "Data.Traversable")
gHC_PACK = mkBaseModule (fsLit "GHC.Pack")
gHC_CONC = mkBaseModule (fsLit "GHC.Conc")
gHC_IO_BASE = mkBaseModule (fsLit "GHC.IOBase")
gHC_IO = mkBaseModule (fsLit "GHC.IO")
gHC_IO_Exception = mkBaseModule (fsLit "GHC.IO.Exception")
gHC_ST = mkBaseModule (fsLit "GHC.ST")
gHC_ARR = mkBaseModule (fsLit "GHC.Arr")
gHC_STABLE = mkBaseModule (fsLit "GHC.Stable")
...
...
@@ -689,7 +690,7 @@ dataClassName = clsQual gENERICS (fsLit "Data") dataClassKey
-- Error module
assertErrorName :: Name
assertErrorName = varQual gHC_IO_
BASE
(fsLit "assertError") assertErrorIdKey
assertErrorName = varQual gHC_IO_
Exception
(fsLit "assertError") assertErrorIdKey
-- Enum module (Enum, Bounded)
enumClassName, enumFromName, enumFromToName, enumFromThenName,
...
...
@@ -735,15 +736,15 @@ toPName = varQual gHC_PARR (fsLit "toP") toPIdKey
emptyPName = varQual gHC_PARR (fsLit "emptyP") emptyPIdKey
appPName = varQual gHC_PARR (fsLit "+:+") appPIdKey
-- IO
Base
things
-- IO things
ioTyConName, ioDataConName, thenIOName, bindIOName, returnIOName,
failIOName :: Name
ioTyConName = tcQual gHC_IO
_BASE
(fsLit "IO") ioTyConKey
ioDataConName = conName gHC_IO
_BASE
(fsLit "IO") ioDataConKey
thenIOName = varQual gHC_IO
_BASE
(fsLit "thenIO") thenIOIdKey
bindIOName = varQual gHC_IO
_BASE
(fsLit "bindIO") bindIOIdKey
returnIOName = varQual gHC_IO
_BASE
(fsLit "returnIO") returnIOIdKey
failIOName = varQual gHC_IO
_BASE
(fsLit "failIO") failIOIdKey
ioTyConName = tcQual gHC_IO (fsLit "IO") ioTyConKey
ioDataConName = conName gHC_IO (fsLit "IO") ioDataConKey
thenIOName = varQual gHC_IO (fsLit "thenIO") thenIOIdKey
bindIOName = varQual gHC_IO (fsLit "bindIO") bindIOIdKey
returnIOName = varQual gHC_IO (fsLit "returnIO") returnIOIdKey
failIOName = varQual gHC_IO (fsLit "failIO") failIOIdKey
-- IO things
printName :: Name
...
...
compiler/utils/Binary.hs
View file @
1c83695b
...
...
@@ -83,10 +83,15 @@ import System.IO.Unsafe ( unsafeInterleaveIO )
import
System.IO.Error
(
mkIOError
,
eofErrorType
)
import
GHC.Real
(
Ratio
(
..
)
)
import
GHC.Exts
import
GHC.IOBase
(
IO
(
..
)
)
import
GHC.Word
(
Word8
(
..
)
)
import
System.IO
(
openBinaryFile
)
#
if
__GLASGOW_HASKELL__
>=
611
import
GHC.IO
(
IO
(
..
)
)
#
else
import
GHC.IOBase
(
IO
(
..
)
)
#
endif
type
BinArray
=
ForeignPtr
Word8
---------------------------------------------------------------
...
...
compiler/utils/FastFunctions.lhs
View file @
1c83695b
...
...
@@ -22,8 +22,19 @@ import System.IO.Unsafe
import GHC.Exts
import GHC.Word
import GHC.IOBase (IO(..))
#if __GLASGOW_HASKELL__ >= 611
import GHC.IO ( IO(..) )
#else
import GHC.IOBase ( IO(..) )
#endif
#if __GLASGOW_HASKELL__ >= 611
import GHC.IO (unsafeDupableInterleaveIO)
#else
import GHC.IOBase (unsafeDupableInterleaveIO)
#endif
import GHC.Base (unsafeChr)
-- Just like unsafePerformIO, but we inline it.
...
...
compiler/utils/FastMutInt.lhs
View file @
1c83695b
...
...
@@ -25,9 +25,14 @@ module FastMutInt(
#endif
import GHC.Base
import GHC.IOBase
import GHC.Ptr
#if __GLASGOW_HASKELL__ >= 611
import GHC.IO ( IO(..) )
#else
import GHC.IOBase ( IO(..) )
#endif
#else /* ! __GLASGOW_HASKELL__ */
import Data.IORef
...
...
compiler/utils/FastString.lhs
View file @
1c83695b
...
...
@@ -103,7 +103,12 @@ import Data.IORef ( IORef, newIORef, readIORef, writeIORef )
import Data.Maybe ( isJust )
import Data.Char ( ord )
import GHC.IOBase ( IO(..) )
#if __GLASGOW_HASKELL__ >= 611
import GHC.IO ( IO(..) )
#else
import GHC.IOBase ( IO(..) )
#endif
import GHC.Ptr ( Ptr(..) )
#if defined(__GLASGOW_HASKELL__)
import GHC.Base ( unpackCString# )
...
...
configure.ac
View file @
1c83695b
...
...
@@ -738,7 +738,7 @@ fi
dnl ** check for more functions
dnl ** The following have been verified to be used in ghc/, but might be used somewhere else, too.
AC_CHECK_FUNCS([getclock getrusage gettimeofday setitimer siginterrupt sysconf times ctime_r
,
sched_setaffinity])
AC_CHECK_FUNCS([getclock getrusage gettimeofday setitimer siginterrupt sysconf times ctime_r sched_setaffinity
setlocale
])
AC_TRY_RUN([
#include <sys/types.h>
...
...
ghc/GhciMonad.hs
View file @
1c83695b
...
...
@@ -363,9 +363,9 @@ initInterpBuffering = do -- make sure these are linked
-- ToDo: we should really look up these names properly, but
-- it's a fiddle and not all the bits are exposed via the GHC
-- interface.
mb_stdin_ptr
<-
ObjLink
.
lookupSymbol
"base_GHCziHandle_stdin_closure"
mb_stdout_ptr
<-
ObjLink
.
lookupSymbol
"base_GHCziHandle_stdout_closure"
mb_stderr_ptr
<-
ObjLink
.
lookupSymbol
"base_GHCziHandle_stderr_closure"
mb_stdin_ptr
<-
ObjLink
.
lookupSymbol
"base_GHCzi
IOzi
Handle
ziFD
_stdin_closure"
mb_stdout_ptr
<-
ObjLink
.
lookupSymbol
"base_GHCzi
IOzi
Handle
ziFD
_stdout_closure"
mb_stderr_ptr
<-
ObjLink
.
lookupSymbol
"base_GHCzi
IOzi
Handle
ziFD
_stderr_closure"
let
f
ref
(
Just
ptr
)
=
writeIORef
ref
ptr
f
_
Nothing
=
panic
"interactiveUI:setBuffering2"
...
...
ghc/InteractiveUI.hs
View file @
1c83695b
...
...
@@ -55,6 +55,11 @@ import Maybes ( orElse, expectJust )
import
FastString
import
Encoding
#
if
__GLASGOW_HASKELL__
<
611
import
Foreign.C
import
Encoding
#
endif
#
ifndef
mingw32_HOST_OS
import
System.Posix
hiding
(
getEnv
)
#
else
...
...
@@ -88,7 +93,13 @@ import Control.Monad as Monad
import
Text.Printf
import
Foreign
import
GHC.Exts
(
unsafeCoerce
#
)
#
if
__GLASGOW_HASKELL__
>=
611
import
GHC.IO.Exception
(
IOErrorType
(
InvalidArgument
)
)
#
else
import
GHC.IOBase
(
IOErrorType
(
InvalidArgument
)
)
#
endif
import
GHC.TopHandler
import
Data.IORef
(
IORef
,
readIORef
,
writeIORef
)
...
...
@@ -501,7 +512,7 @@ fileLoop hdl = do
-- this can happen if the user closed stdin, or
-- perhaps did getContents which closes stdin at
-- EOF.
Right
l
->
fmap
Just
(
Encoding
.
decode
(
BS
.
pack
l
)
)
Right
l
->
return
(
Just
l
)
mkPrompt
::
GHCi
String
mkPrompt
=
do
...
...
rts/Prelude.h
View file @
1c83695b
...
...
@@ -35,10 +35,10 @@ extern W_ ZCMain_main_closure[];
extern
StgClosure
ZCMain_main_closure
;
#endif
PRELUDE_CLOSURE
(
base_GHCziIO
Base
_stackOverflow_closure
);
PRELUDE_CLOSURE
(
base_GHCziIO
Base
_heapOverflow_closure
);
PRELUDE_CLOSURE
(
base_GHCziIO
Base
_blockedOnDeadMVar_closure
);
PRELUDE_CLOSURE
(
base_GHCziIO
Base
_blockedIndefinitely_closure
);
PRELUDE_CLOSURE
(
base_GHCziIO
ziException
_stackOverflow_closure
);
PRELUDE_CLOSURE
(
base_GHCziIO
ziException
_heapOverflow_closure
);
PRELUDE_CLOSURE
(
base_GHCziIO
ziException
_blockedOnDeadMVar_closure
);
PRELUDE_CLOSURE
(
base_GHCziIO
ziException
_blockedIndefinitely_closure
);
PRELUDE_CLOSURE
(
base_ControlziExceptionziBase_nonTermination_closure
);
PRELUDE_CLOSURE
(
base_ControlziExceptionziBase_nestedAtomically_closure
);
...
...
@@ -87,10 +87,10 @@ PRELUDE_INFO(base_GHCziStable_StablePtr_con_info);
#define runFinalizerBatch_closure DLL_IMPORT_DATA_REF(base_GHCziWeak_runFinalizzerBatch_closure)
#define mainIO_closure (&ZCMain_main_closure)
#define stackOverflow_closure DLL_IMPORT_DATA_REF(base_GHCziIO
Base
_stackOverflow_closure)
#define heapOverflow_closure DLL_IMPORT_DATA_REF(base_GHCziIO
Base
_heapOverflow_closure)
#define blockedOnDeadMVar_closure DLL_IMPORT_DATA_REF(base_GHCziIO
Base
_blockedOnDeadMVar_closure)
#define blockedIndefinitely_closure DLL_IMPORT_DATA_REF(base_GHCziIO
Base
_blockedIndefinitely_closure)
#define stackOverflow_closure DLL_IMPORT_DATA_REF(base_GHCziIO
ziException
_stackOverflow_closure)
#define heapOverflow_closure DLL_IMPORT_DATA_REF(base_GHCziIO
ziException
_heapOverflow_closure)
#define blockedOnDeadMVar_closure DLL_IMPORT_DATA_REF(base_GHCziIO
ziException
_blockedOnDeadMVar_closure)
#define blockedIndefinitely_closure DLL_IMPORT_DATA_REF(base_GHCziIO
ziException
_blockedIndefinitely_closure)
#define nonTermination_closure DLL_IMPORT_DATA_REF(base_ControlziExceptionziBase_nonTermination_closure)
#define nestedAtomically_closure DLL_IMPORT_DATA_REF(base_ControlziExceptionziBase_nestedAtomically_closure)
...
...
rts/RtsStartup.c
View file @
1c83695b
...
...
@@ -63,6 +63,9 @@
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_LOCALE_H
#include <locale.h>
#endif
#if USE_PAPI
#include "Papi.h"
...
...
@@ -132,6 +135,8 @@ hs_init(int *argc, char **argv[])
return
;
}
setlocale
(
LC_CTYPE
,
""
);
/* Initialise the stats department, phase 0 */
initStats0
();
...
...
utils/ghc-pkg/Main.hs
View file @
1c83695b
...
...
@@ -61,7 +61,11 @@ import System.Posix hiding (fdToHandle)
import
IO
(
isPermissionError
)
import
System.Posix.Internals
#
if
__GLASGOW_HASKELL__
>=
611
import
GHC.IO.Handle.FD
(
fdToHandle
)
#
else
import
GHC.Handle
(
fdToHandle
)
#
endif
#
if
defined
(
GLOB
)
import
System.Process
(
runInteractiveCommand
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment