on master help sign in
Ghc lib 0.20190531 (#1486)
3769dd4Shayne Fletcher
src/Development/IDE/UtilGHC.hs+36−18
@@ -22,10 +22,13 @@ import Fingerprint
22import GHC
22import GHC
23import GhcMonad
23import GhcMonad
24import GhcPlugins
24import GhcPlugins
25−import Platform
26import Data.IORef
25import Data.IORef
27import Control.Exception
26import Control.Exception
28import FileCleanup
27import FileCleanup
28+import Platform
29+#ifndef GHC_STABLE
30+import ToolSettings
31+#endif
29
32
30----------------------------------------------------------------------
33----------------------------------------------------------------------
31-- GHC setup
34-- GHC setup
@@ -62,25 +65,40 @@ runGhcEnv env act = do
62 cleanTempFiles dflags
65 cleanTempFiles dflags
63 cleanTempDirs dflags
66 cleanTempDirs dflags
64
67
65−
66−-- Fake DynFlags which are mostly undefined, but define enough to do a little bit
68+-- Fake DynFlags which are mostly undefined, but define enough to do a
69+-- little bit.
67fakeDynFlags :: DynFlags
70fakeDynFlags :: DynFlags
68fakeDynFlags = defaultDynFlags settings ([], [])
71fakeDynFlags = defaultDynFlags settings ([], [])
69 where
72 where
70 settings = Settings
73 settings = Settings
71− {sTargetPlatform = Platform
74+ { sTargetPlatform = platform
72− {platformWordSize = 8
73− ,platformOS = OSUnknown
74− ,platformUnregisterised = True
75− }
76− ,sPlatformConstants = PlatformConstants
75+ , sPlatformConstants = platformConstants
77− {pc_DYNAMIC_BY_DEFAULT = False
78− ,pc_WORD_SIZE = 8
79− }
80−#ifndef GHC_STABLE
76+#ifdef GHC_STABLE
81− ,sIntegerLibraryType = IntegerSimple
77+ , sProgramName = "ghc"
78+ , sProjectVersion = cProjectVersion
79+ , sOpt_P_fingerprint = fingerprint0
80+#else
81+ , sGhcNameVersion = GhcNameVersion
82+ { ghcNameVersion_programName = "ghc"
83+ , ghcNameVersion_projectVersion = cProjectVersion
84+ }
85+ , sFileSettings = FileSettings
86+ { -- fileSettings_tmpDir = "."
87+ }
88+ , sPlatformMisc = PlatformMisc
89+ { platformMisc_integerLibraryType = IntegerSimple
90+ }
91+ , sToolSettings = ToolSettings
92+ { toolSettings_opt_P_fingerprint = fingerprint0
93+ }
82#endif
94#endif
83− ,sProjectVersion = cProjectVersion
95+ }
84− ,sProgramName = "ghc"
96+ platform = Platform
85− ,sOpt_P_fingerprint = fingerprint0
97+ { platformWordSize=8
98+ , platformOS=OSUnknown
99+ , platformUnregisterised=True
100+ }
101+ platformConstants = PlatformConstants
102+ { pc_DYNAMIC_BY_DEFAULT=False
103+ , pc_WORD_SIZE=8
86− }
104+ }