summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2019-05-18 17:43:43 +0100
committerMatthew Pickering <matthewtpickering@gmail.com>2019-05-18 17:43:53 +0100
commit37fefb5e7a05c69d4c0b42d24f68d919d9143186 (patch)
treea2997e109d31f4c7f0294bb785335c1d9165bd51
parent9b4364860d7c9beaec156bc66b01c3e0e75db8b9 (diff)
downloadhaskell-wip/16672.tar.gz
WIP: #16672wip/16672
-rw-r--r--compiler/ghci/Linker.hs4
-rw-r--r--compiler/main/DynFlags.hs10
-rw-r--r--compiler/typecheck/TcCanonical.hs2
-rwxr-xr-xhadrian/ghci.sh7
-rw-r--r--hadrian/src/Rules.hs9
-rw-r--r--hadrian/src/Settings/Builders/Ghc.hs2
-rw-r--r--utils/genprimopcode/ParserM.hs6
7 files changed, 28 insertions, 12 deletions
diff --git a/compiler/ghci/Linker.hs b/compiler/ghci/Linker.hs
index b3135e1d2b..ace2c702b2 100644
--- a/compiler/ghci/Linker.hs
+++ b/compiler/ghci/Linker.hs
@@ -115,7 +115,7 @@ readPLS dl =
modifyMbPLS_
:: DynLinker -> (Maybe PersistentLinkerState -> IO (Maybe PersistentLinkerState)) -> IO ()
-modifyMbPLS_ dl f = modifyMVar_ (dl_mpls dl) f
+modifyMbPLS_ dl f = modifyMVar_ (dl_mpls dl) f
emptyPLS :: DynFlags -> PersistentLinkerState
emptyPLS _ = PersistentLinkerState {
@@ -350,7 +350,7 @@ linkCmdLineLibs' hsc_env pls =
in nub $ map normalise paths
let lib_paths = nub $ lib_paths_base ++ gcc_paths
all_paths_env <- addEnvPaths "LD_LIBRARY_PATH" all_paths
- traceM "all_paths" (ppr all_paths_env)
+ pprTraceM "all_paths" (ppr all_paths_env)
pathCache <- mapM (addLibrarySearchPath hsc_env) all_paths_env
pls1 <- foldM (preloadLib hsc_env lib_paths framework_paths) pls
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index e94798aede..52843b4cb0 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -2812,7 +2812,7 @@ parseDynamicFlagsFull activeFlags cmdline dflags0 args = do
let (dflags5, consistency_warnings) = makeDynFlagsConsistent dflags4
-- Set timer stats & heap size
- when (enableTimeStats dflags5) $ liftIO enableTimingStats
+-- when (enableTimeStats dflags5) $ liftIO enableTimingStats
case (ghcHeapSize dflags5) of
Just x -> liftIO (setHeapSize x)
_ -> return ()
@@ -5967,8 +5967,12 @@ decodeSize str
n = readRational m
pred c = isDigit c || c == '.'
-foreign import ccall unsafe "setHeapSize" setHeapSize :: Int -> IO ()
-foreign import ccall unsafe "enableTimingStats" enableTimingStats :: IO ()
+setHeapSize :: Int -> IO ()
+setHeapSize _ = return ()
+enableTimingStats :: IO ()
+enableTimingStats = return ()
+--foreign import ccall unsafe "setHeapSize" setHeapSize :: Int -> IO ()
+--foreign import ccall unsafe "enableTimingStats" enableTimingStats :: IO ()
-- -----------------------------------------------------------------------------
-- Types for managing temporary files.
diff --git a/compiler/typecheck/TcCanonical.hs b/compiler/typecheck/TcCanonical.hs
index 47c4cc807c..2bf4609f85 100644
--- a/compiler/typecheck/TcCanonical.hs
+++ b/compiler/typecheck/TcCanonical.hs
@@ -2,6 +2,8 @@
module TcCanonical(
canonicalize,
+ canEqNC,
+ can_eq_nc,
unifyDerived,
makeSuperClasses, maybeSym,
StopOrContinue(..), stopWith, continueWith,
diff --git a/hadrian/ghci.sh b/hadrian/ghci.sh
index 4c9b9c6710..daadd9a181 100755
--- a/hadrian/ghci.sh
+++ b/hadrian/ghci.sh
@@ -2,5 +2,8 @@
set -e
-GHC_FLAGS=$(TERM=dumb CABFLAGS=-v0 . "hadrian/build.cabal.sh" tool-args -q --build-root=.hadrian_ghci --flavour=ghc-in-ghci "$@")
-ghci $GHC_FLAGS -fno-code -fwrite-interface -hidir=.hadrian_ghci/interface -O0 ghc/Main.hs
+GHC=/home/matt/ghc/m559b/stage1/bin/ghc
+export GHC_LOADED_INTO_GHCI=1
+GHC_FLAGS=$(TERM=dumb CABFLAGS=-v0 . "hadrian/build.cabal.sh" tool-args -q --build-root=.hadrian_ghci --flavour=ghc-in-ghci "$@")
+echo $GHC_FLAGS
+/home/matt/ghc/m559b/stage1/bin/ghc --interactive -fexternal-interpreter -O0 $GHC_FLAGS -fwrite-interface -hidir=.hadrian_ghci/interface -O0 -DGHC_LOADED_INTO_GHCI -Lcompiler/parser ghc/Main.hs
diff --git a/hadrian/src/Rules.hs b/hadrian/src/Rules.hs
index 78e3790d48..9c8adec4d0 100644
--- a/hadrian/src/Rules.hs
+++ b/hadrian/src/Rules.hs
@@ -6,6 +6,7 @@ import qualified Hadrian.Oracles.Cabal.Rules
import qualified Hadrian.Oracles.DirectoryContents
import qualified Hadrian.Oracles.Path
import qualified Hadrian.Oracles.TextFile
+import Hadrian.Haskell.Cabal.Type
import Expression
import qualified Oracles.ModuleFiles
@@ -55,10 +56,16 @@ toolArgsTarget = do
need [ root <//> dir -/- "CmmParse.hs" ]
need [ root <//> dir -/- "CmmLex.hs" ]
+ let context = vanillaContext Stage0 compiler
+ cSrcs' <- interpretInContext (vanillaContext Stage0 compiler)
+ (getContextData cSrcs)
+ cObjs <- mapM (objectPath context) cSrcs'
+ need cObjs
+
-- Find out the arguments that are needed to load a module into the
-- session
arg_list <- interpret fake_target getArgs
- liftIO $ putStrLn (intercalate " " arg_list)
+ liftIO $ putStrLn (intercalate " " (arg_list ++ cObjs))
allStages :: [Stage]
allStages = [minBound .. maxBound]
diff --git a/hadrian/src/Settings/Builders/Ghc.hs b/hadrian/src/Settings/Builders/Ghc.hs
index 81fc9d183a..076b925cfc 100644
--- a/hadrian/src/Settings/Builders/Ghc.hs
+++ b/hadrian/src/Settings/Builders/Ghc.hs
@@ -40,7 +40,7 @@ compileC = builder (Ghc CompileCWithGhc) ? do
let ccArgs = [ getContextData ccOpts
, getStagedSettingList ConfCcArgs
, cIncludeArgs
- , Dynamic `wayUnit` way ? pure [ "-fPIC", "-DDYNAMIC" ] ]
+ , pure [ "-fPIC", "-DDYNAMIC" ] ]
mconcat [ arg "-Wall"
, ghcLinkArgs
, commonGhcArgs
diff --git a/utils/genprimopcode/ParserM.hs b/utils/genprimopcode/ParserM.hs
index 61fce96aca..ada6291ca3 100644
--- a/utils/genprimopcode/ParserM.hs
+++ b/utils/genprimopcode/ParserM.hs
@@ -42,10 +42,10 @@ instance Monad ParserM where
Left err ->
Left err
return a = ParserM $ \i s -> Right (i, s, a)
- fail err = ParserM $ \_ _ -> Left err
+ --fail err = ParserM $ \_ _ -> Left err
---instance MonadFail ParserM where
--- fail err = ParserM $ \_ _ -> Left err
+instance MonadFail ParserM where
+ fail err = ParserM $ \_ _ -> Left err
run_parser :: ParserM a -> (String -> Either String a)
run_parser (ParserM f)