diff --git a/src/Development/IDE/Compat.hs b/src/Development/IDE/Compat.hs index d5e4da25..de2396a7 100644 --- a/src/Development/IDE/Compat.hs +++ b/src/Development/IDE/Compat.hs @@ -6,18 +6,11 @@ -- | Attempt at hiding the GHC version differences we can. module Development.IDE.Compat( HieFile(..), - HieFileResult(..), mkHieFile, writeHieFile, readHieFile ) where -#ifndef GHC_STABLE -import HieBin -import HieAst -import HieTypes -#else - import GHC import GhcPlugins import NameCache @@ -31,11 +24,7 @@ mkHieFile _ _ _ = return (HieFile () []) writeHieFile :: FilePath -> HieFile -> IO () writeHieFile _ _ = return () -readHieFile :: NameCache -> FilePath -> IO (HieFileResult, ()) -readHieFile _ _ = return (HieFileResult $ HieFile () [], ()) +readHieFile :: NameCache -> FilePath -> IO (HieFile, ()) +readHieFile _ _ = return (HieFile () [], ()) data HieFile = HieFile {hie_module :: (), hie_exports :: [AvailInfo]} - -data HieFileResult = HieFileResult {hie_file_result :: HieFile} - -#endif diff --git a/src/Development/IDE/Functions/CPP.hs b/src/Development/IDE/Functions/CPP.hs index d8bc036b..77592af9 100644 --- a/src/Development/IDE/Functions/CPP.hs +++ b/src/Development/IDE/Functions/CPP.hs @@ -50,9 +50,6 @@ doCpp dflags raw input_fn output_fn = do let cpp_prog args | raw = SysTools.runCpp dflags args | otherwise = SysTools.runCc -#ifndef GHC_STABLE - Nothing -#endif dflags (SysTools.Option "-E" : args) let target_defs = [] {- diff --git a/src/Development/IDE/Functions/Compile.hs b/src/Development/IDE/Functions/Compile.hs index 7cfdca05..695ae3fd 100644 --- a/src/Development/IDE/Functions/Compile.hs +++ b/src/Development/IDE/Functions/Compile.hs @@ -394,14 +394,8 @@ parseFileContents preprocessor filename contents = do return (contents, dflags) case unP Parser.parseModule (mkPState dflags contents loc) of -#ifdef GHC_STABLE PFailed _ locErr msgErr -> Ex.throwE $ mkErrorDoc dflags locErr msgErr -#else - PFailed s -> - -- A fatal parse error was encountered. - Ex.throwE $ toDiagnostics dflags $ snd $ getMessages s dflags -#endif POk pst rdr_module -> let hpm_annotations = (Map.fromListWith (++) $ annotations pst, diff --git a/src/Development/IDE/State/Rules.hs b/src/Development/IDE/State/Rules.hs index 626aac53..e41aca18 100644 --- a/src/Development/IDE/State/Rules.hs +++ b/src/Development/IDE/State/Rules.hs @@ -306,7 +306,7 @@ getHieFileRule = defineNoFile $ \(GetHieFile f) -> do u <- liftIO $ mkSplitUniqSupply 'a' let nameCache = initNameCache u [] - liftIO $ fmap (hie_file_result . fst) $ readHieFile nameCache f + liftIO $ fmap fst $ readHieFile nameCache f -- | A rule that wires per-file rules together mainRule :: Rules () diff --git a/src/Development/IDE/UtilGHC.hs b/src/Development/IDE/UtilGHC.hs index 30318ef4..84a93170 100644 --- a/src/Development/IDE/UtilGHC.hs +++ b/src/Development/IDE/UtilGHC.hs @@ -26,9 +26,6 @@ import Data.IORef import Control.Exception import FileCleanup import Platform -#ifndef GHC_STABLE -import ToolSettings -#endif ---------------------------------------------------------------------- -- GHC setup @@ -73,25 +70,9 @@ fakeDynFlags = defaultDynFlags settings ([], []) settings = Settings { sTargetPlatform = platform , sPlatformConstants = platformConstants -#ifdef GHC_STABLE , sProgramName = "ghc" , sProjectVersion = cProjectVersion , sOpt_P_fingerprint = fingerprint0 -#else - , sGhcNameVersion = GhcNameVersion - { ghcNameVersion_programName = "ghc" - , ghcNameVersion_projectVersion = cProjectVersion - } - , sFileSettings = FileSettings - { -- fileSettings_tmpDir = "." - } - , sPlatformMisc = PlatformMisc - { platformMisc_integerLibraryType = IntegerSimple - } - , sToolSettings = ToolSettings - { toolSettings_opt_P_fingerprint = fingerprint0 - } -#endif } platform = Platform { platformWordSize=8