@@ -104,7 +104,6 @@ import System.FilePath
104
104
import System.IO.Extra (fixIO , newTempFileWithin )
105
105
import Unsafe.Coerce
106
106
107
- #if MIN_VERSION_ghc(9,0,1)
108
107
import GHC.Tc.Gen.Splice
109
108
110
109
#if MIN_VERSION_ghc(9,2,1)
@@ -115,11 +114,6 @@ import GHC.Types.TypeEnv
115
114
import GHC.Driver.Types
116
115
#endif
117
116
118
- #else
119
- import HscTypes
120
- import TcSplice
121
- #endif
122
-
123
117
#if MIN_VERSION_ghc(9,2,0)
124
118
import GHC (Anchor (anchor ),
125
119
EpaComment (EpaComment ),
@@ -470,7 +464,6 @@ mkHiFileResultCompile se session' tcm simplified_guts = catchErrs $ do
470
464
(guts, details) <- tidyProgram tidy_opts simplified_guts
471
465
pure (details, Just guts)
472
466
473
- #if MIN_VERSION_ghc(9,0,1)
474
467
let ! partial_iface = force $ mkPartialIface session details
475
468
#if MIN_VERSION_ghc(9,3,0)
476
469
ms
@@ -482,10 +475,6 @@ mkHiFileResultCompile se session' tcm simplified_guts = catchErrs $ do
482
475
Nothing
483
476
#endif
484
477
485
- #else
486
- let ! partial_iface = force (mkPartialIface session details simplified_guts)
487
- final_iface' <- mkFullIface session partial_iface
488
- #endif
489
478
let final_iface = final_iface' {mi_globals = Nothing } -- See Note [Clearing mi_globals after generating an iface]
490
479
491
480
-- Write the core file now
@@ -626,10 +615,8 @@ generateObjectCode session summary guts = do
626
615
session' = hscSetFlags newFlags session
627
616
#if MIN_VERSION_ghc(9,4,2)
628
617
(outputFilename, _mStub, _foreign_files, _cinfos, _stgcinfos) <- hscGenHardCode session' guts
629
- #elif MIN_VERSION_ghc(9,0,1)
630
- (outputFilename, _mStub, _foreign_files, _cinfos) <- hscGenHardCode session' guts
631
618
#else
632
- (outputFilename, _mStub, _foreign_files) <- hscGenHardCode session' guts
619
+ (outputFilename, _mStub, _foreign_files, _cinfos ) <- hscGenHardCode session' guts
633
620
#endif
634
621
(ms_location summary)
635
622
fp
@@ -775,7 +762,6 @@ generateHieAsts hscEnv tcm =
775
762
-- don't export an interface which allows for additional information to be added to hie files.
776
763
let fake_splice_binds = Util. listToBag (map (mkVarBind unitDataConId) (spliceExpressions $ tmrTopLevelSplices tcm))
777
764
real_binds = tcg_binds $ tmrTypechecked tcm
778
- #if MIN_VERSION_ghc(9,0,1)
779
765
ts = tmrTypechecked tcm :: TcGblEnv
780
766
top_ev_binds = tcg_ev_binds ts :: Util. Bag EvBind
781
767
insts = tcg_insts ts :: [ClsInst ]
@@ -787,19 +773,14 @@ generateHieAsts hscEnv tcm =
787
773
Just <$>
788
774
#endif
789
775
GHC. enrichHie (fake_splice_binds `Util.unionBags` real_binds) (tmrRenamed tcm) top_ev_binds insts tcs
790
- #else
791
- Just <$> GHC. enrichHie (fake_splice_binds `Util.unionBags` real_binds) (tmrRenamed tcm)
792
- #endif
793
776
where
794
777
dflags = hsc_dflags hscEnv
795
- #if MIN_VERSION_ghc(9,0,0)
796
778
run ts =
797
779
#if MIN_VERSION_ghc(9,2,0) && !MIN_VERSION_ghc(9,3,0)
798
780
fmap (join . snd ) . liftIO . initDs hscEnv ts
799
781
#else
800
782
id
801
783
#endif
802
- #endif
803
784
804
785
spliceExpressions :: Splices -> [LHsExpr GhcTc ]
805
786
spliceExpressions Splices {.. } =
@@ -1218,11 +1199,7 @@ parseHeader
1218
1199
=> DynFlags -- ^ flags to use
1219
1200
-> FilePath -- ^ the filename (for source locations)
1220
1201
-> Util. StringBuffer -- ^ Haskell module source text (full Unicode is supported)
1221
- #if MIN_VERSION_ghc(9,0,1)
1222
1202
-> ExceptT [FileDiagnostic ] m ([FileDiagnostic ], Located (HsModule ))
1223
- #else
1224
- -> ExceptT [FileDiagnostic ] m ([FileDiagnostic ], Located (HsModule GhcPs ))
1225
- #endif
1226
1203
parseHeader dflags filename contents = do
1227
1204
let loc = mkRealSrcLoc (Util. mkFastString filename) 1 1
1228
1205
case unP Compat. parseHeader (initParserState (initParserOpts dflags) contents loc) of
0 commit comments