on master help sign in
Up-(actually down-)grade to ghc-lib-8.8.0.20190610 (#1576)
44b366eShayne Fletcher
src/Development/IDE/Compat.hs+2−13
@@ -6,18 +6,11 @@
6-- | Attempt at hiding the GHC version differences we can.
6-- | Attempt at hiding the GHC version differences we can.
7module Development.IDE.Compat(
7module Development.IDE.Compat(
8 HieFile(..),
8 HieFile(..),
9− HieFileResult(..),
10 mkHieFile,
9 mkHieFile,
11 writeHieFile,
10 writeHieFile,
12 readHieFile
11 readHieFile
13 ) where
12 ) where
14
13
15−#ifndef GHC_STABLE
16−import HieBin
17−import HieAst
18−import HieTypes
19−#else
20−
21import GHC
14import GHC
22import GhcPlugins
15import GhcPlugins
23import NameCache
16import NameCache
@@ -31,11 +24,7 @@ mkHieFile _ _ _ = return (HieFile () [])
31writeHieFile :: FilePath -> HieFile -> IO ()
24writeHieFile :: FilePath -> HieFile -> IO ()
32writeHieFile _ _ = return ()
25writeHieFile _ _ = return ()
33
26
34−readHieFile :: NameCache -> FilePath -> IO (HieFileResult, ())
27+readHieFile :: NameCache -> FilePath -> IO (HieFile, ())
35−readHieFile _ _ = return (HieFileResult $ HieFile () [], ())
28+readHieFile _ _ = return (HieFile () [], ())
36
29
37data HieFile = HieFile {hie_module :: (), hie_exports :: [AvailInfo]}
30data HieFile = HieFile {hie_module :: (), hie_exports :: [AvailInfo]}
38−
39−data HieFileResult = HieFileResult {hie_file_result :: HieFile}
40−
41−#endif
src/Development/IDE/Functions/CPP.hs−3
@@ -50,9 +50,6 @@ doCpp dflags raw input_fn output_fn = do
50
50
51 let cpp_prog args | raw = SysTools.runCpp dflags args
51 let cpp_prog args | raw = SysTools.runCpp dflags args
52 | otherwise = SysTools.runCc
52 | otherwise = SysTools.runCc
53−#ifndef GHC_STABLE
54− Nothing
55−#endif
56 dflags (SysTools.Option "-E" : args)
53 dflags (SysTools.Option "-E" : args)
57
54
58 let target_defs = [] {-
55 let target_defs = [] {-
src/Development/IDE/Functions/Compile.hs−6
@@ -394,14 +394,8 @@ parseFileContents preprocessor filename contents = do
394 return (contents, dflags)
394 return (contents, dflags)
395
395
396 case unP Parser.parseModule (mkPState dflags contents loc) of
396 case unP Parser.parseModule (mkPState dflags contents loc) of
397−#ifdef GHC_STABLE
398 PFailed _ locErr msgErr ->
397 PFailed _ locErr msgErr ->
399 Ex.throwE $ mkErrorDoc dflags locErr msgErr
398 Ex.throwE $ mkErrorDoc dflags locErr msgErr
400−#else
401− PFailed s ->
402− -- A fatal parse error was encountered.
403− Ex.throwE $ toDiagnostics dflags $ snd $ getMessages s dflags
404−#endif
405 POk pst rdr_module ->
399 POk pst rdr_module ->
406 let hpm_annotations =
400 let hpm_annotations =
407 (Map.fromListWith (++) $ annotations pst,
401 (Map.fromListWith (++) $ annotations pst,
src/Development/IDE/State/Rules.hs+1−1
@@ -306,7 +306,7 @@ getHieFileRule =
306 defineNoFile $ \(GetHieFile f) -> do
306 defineNoFile $ \(GetHieFile f) -> do
307 u <- liftIO $ mkSplitUniqSupply 'a'
307 u <- liftIO $ mkSplitUniqSupply 'a'
308 let nameCache = initNameCache u []
308 let nameCache = initNameCache u []
309− liftIO $ fmap (hie_file_result . fst) $ readHieFile nameCache f
309+ liftIO $ fmap fst $ readHieFile nameCache f
310
310
311-- | A rule that wires per-file rules together
311-- | A rule that wires per-file rules together
312mainRule :: Rules ()
312mainRule :: Rules ()
src/Development/IDE/UtilGHC.hs−19
@@ -26,9 +26,6 @@ import Data.IORef
26import Control.Exception
26import Control.Exception
27import FileCleanup
27import FileCleanup
28import Platform
28import Platform
29−#ifndef GHC_STABLE
30−import ToolSettings
31−#endif
32
29
33----------------------------------------------------------------------
30----------------------------------------------------------------------
34-- GHC setup
31-- GHC setup
@@ -73,25 +70,9 @@ fakeDynFlags = defaultDynFlags settings ([], [])
73 settings = Settings
70 settings = Settings
74 { sTargetPlatform = platform
71 { sTargetPlatform = platform
75 , sPlatformConstants = platformConstants
72 , sPlatformConstants = platformConstants
76−#ifdef GHC_STABLE
77 , sProgramName = "ghc"
73 , sProgramName = "ghc"
78 , sProjectVersion = cProjectVersion
74 , sProjectVersion = cProjectVersion
79 , sOpt_P_fingerprint = fingerprint0
75 , 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− }
94−#endif
95 }
76 }
96 platform = Platform
77 platform = Platform
97 { platformWordSize=8
78 { platformWordSize=8