summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2021-02-12 15:38:58 -0500
committerBen Gamari <ben@smart-cactus.org>2021-02-12 15:38:58 -0500
commitaa3ba9cc2deae5f341e2534386158aff652aaaa1 (patch)
tree5880e3c15c289bca2b2b0804148de648423d144d
parent15a190b2bc94882e5fe53dea1cb5fea168df25d2 (diff)
downloadhaskell-wip/drop-ghc-in-ghci.tar.gz
Drop GHC_LOADED_IN_GHCIwip/drop-ghc-in-ghci
This previously supported the ghc-in-ghci script which has been since dropped. Hadrian's ghci support does not need this macro (which disabled uses of UnboxedTuples) since it uses `-fno-code` rather than produce bytecode.
-rw-r--r--compiler/GHC/CmmToAsm.hs11
-rw-r--r--compiler/GHC/CmmToAsm/Reg/Linear/State.hs12
-rw-r--r--compiler/GHC/Types/Unique/Supply.hs13
-rw-r--r--ghc/Main.hs13
4 files changed, 0 insertions, 49 deletions
diff --git a/compiler/GHC/CmmToAsm.hs b/compiler/GHC/CmmToAsm.hs
index daf75a1720..0cbadad821 100644
--- a/compiler/GHC/CmmToAsm.hs
+++ b/compiler/GHC/CmmToAsm.hs
@@ -10,11 +10,7 @@
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FlexibleContexts #-}
-
-
-#if !defined(GHC_LOADED_INTO_GHCI)
{-# LANGUAGE UnboxedTuples #-}
-#endif
{-# OPTIONS_GHC -Wno-incomplete-record-updates #-}
@@ -973,18 +969,11 @@ cmmToCmm config (CmmProc info lbl live graph)
do blocks' <- mapM cmmBlockConFold (toBlockList graph)
return $ CmmProc info lbl live (ofBlockList (g_entry graph) blocks')
--- Avoids using unboxed tuples when loading into GHCi
-#if !defined(GHC_LOADED_INTO_GHCI)
-
type OptMResult a = (# a, [CLabel] #)
pattern OptMResult :: a -> b -> (# a, b #)
pattern OptMResult x y = (# x, y #)
{-# COMPLETE OptMResult #-}
-#else
-
-data OptMResult a = OptMResult !a ![CLabel] deriving (Functor)
-#endif
newtype CmmOptM a = CmmOptM (NCGConfig -> [CLabel] -> OptMResult a)
deriving (Functor)
diff --git a/compiler/GHC/CmmToAsm/Reg/Linear/State.hs b/compiler/GHC/CmmToAsm/Reg/Linear/State.hs
index ab05ab632a..b36270f3bc 100644
--- a/compiler/GHC/CmmToAsm/Reg/Linear/State.hs
+++ b/compiler/GHC/CmmToAsm/Reg/Linear/State.hs
@@ -1,9 +1,6 @@
{-# LANGUAGE CPP, PatternSynonyms, DeriveFunctor #-}
{-# LANGUAGE ScopedTypeVariables #-}
-
-#if !defined(GHC_LOADED_INTO_GHCI)
{-# LANGUAGE UnboxedTuples #-}
-#endif
-- | State monad for the linear register allocator.
@@ -56,20 +53,11 @@ import GHC.Types.Unique.Supply
import Control.Monad (ap)
--- Avoids using unboxed tuples when loading into GHCi
-#if !defined(GHC_LOADED_INTO_GHCI)
-
type RA_Result freeRegs a = (# RA_State freeRegs, a #)
pattern RA_Result :: a -> b -> (# a, b #)
pattern RA_Result a b = (# a, b #)
{-# COMPLETE RA_Result #-}
-#else
-
-data RA_Result freeRegs a = RA_Result {-# UNPACK #-} !(RA_State freeRegs) !a
- deriving (Functor)
-
-#endif
-- | The register allocator monad type.
newtype RegM freeRegs a
diff --git a/compiler/GHC/Types/Unique/Supply.hs b/compiler/GHC/Types/Unique/Supply.hs
index 0a10fde9b3..7d6c4914e2 100644
--- a/compiler/GHC/Types/Unique/Supply.hs
+++ b/compiler/GHC/Types/Unique/Supply.hs
@@ -8,10 +8,7 @@
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE BangPatterns #-}
-
-#if !defined(GHC_LOADED_INTO_GHCI)
{-# LANGUAGE UnboxedTuples #-}
-#endif
module GHC.Types.Unique.Supply (
-- * Main data type
@@ -292,22 +289,12 @@ takeUniqFromSupply (MkSplitUniqSupply n s1 _) = (mkUniqueGrimily n, s1)
************************************************************************
-}
--- Avoids using unboxed tuples when loading into GHCi
-#if !defined(GHC_LOADED_INTO_GHCI)
-
type UniqResult result = (# result, UniqSupply #)
pattern UniqResult :: a -> b -> (# a, b #)
pattern UniqResult x y = (# x, y #)
{-# COMPLETE UniqResult #-}
-#else
-
-data UniqResult result = UniqResult !result {-# UNPACK #-} !UniqSupply
- deriving (Functor)
-
-#endif
-
-- | A monad which just gives the ability to obtain 'Unique's
newtype UniqSM result = USM { unUSM :: UniqSupply -> UniqResult result }
deriving (Functor)
diff --git a/ghc/Main.hs b/ghc/Main.hs
index 12acd5a479..457b006e21 100644
--- a/ghc/Main.hs
+++ b/ghc/Main.hs
@@ -890,18 +890,5 @@ people since we're linking GHC dynamically, but most things themselves
link statically.
-}
--- If GHC_LOADED_INTO_GHCI is not set when GHC is loaded into GHCi, then
--- running it causes an error like this:
---
--- Loading temp shared object failed:
--- /tmp/ghc13836_0/libghc_1872.so: undefined symbol: initGCStatistics
---
--- Skipping the foreign call fixes this problem, and the outer GHCi
--- should have already made this call anyway.
-#if defined(GHC_LOADED_INTO_GHCI)
-initGCStatistics :: IO ()
-initGCStatistics = return ()
-#else
foreign import ccall safe "initGCStatistics"
initGCStatistics :: IO ()
-#endif