diff options
author | Ben Gamari <ben@smart-cactus.org> | 2021-02-12 15:38:58 -0500 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-02-14 03:35:44 -0500 |
commit | bc5cb5f900941085e5e22f3e8cafa4deea3b589c (patch) | |
tree | 2384fd8c7bc19375b4306aec3ad55769aba626a8 | |
parent | 72f230837ef166d4c931621b484471090d5338f6 (diff) | |
download | haskell-bc5cb5f900941085e5e22f3e8cafa4deea3b589c.tar.gz |
Drop GHC_LOADED_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.hs | 11 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/Reg/Linear/State.hs | 12 | ||||
-rw-r--r-- | compiler/GHC/Types/Unique/Supply.hs | 13 | ||||
-rw-r--r-- | ghc/Main.hs | 13 |
4 files changed, 0 insertions, 49 deletions
diff --git a/compiler/GHC/CmmToAsm.hs b/compiler/GHC/CmmToAsm.hs index d716686687..8201b14ab9 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 #-} @@ -979,18 +975,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 a916820015..2626d78924 100644 --- a/ghc/Main.hs +++ b/ghc/Main.hs @@ -893,18 +893,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 |