@@ -57,7 +57,7 @@ import LoadIface (loadModuleInterface)
57
57
58
58
import Lexer
59
59
import qualified Parser
60
- #if MIN_GHC_API_VERSION (8,10,0)
60
+ #if MIN_VERSION_ghc (8,10,0)
61
61
import Control.DeepSeq (force , rnf )
62
62
#else
63
63
import Control.DeepSeq (rnf )
@@ -81,7 +81,7 @@ import MkIface
81
81
import StringBuffer as SB
82
82
import TcIface (typecheckIface )
83
83
import TcRnMonad hiding (newUnique )
84
- #if MIN_GHC_API_VERSION (9,0,1)
84
+ #if MIN_VERSION_ghc (9,0,1)
85
85
import GHC.Builtin.Names
86
86
import GHC.Iface.Recomp
87
87
import GHC.Tc.Gen.Splice
@@ -241,7 +241,7 @@ mkHiFileResultNoCompile session tcm = do
241
241
tcGblEnv = tmrTypechecked tcm
242
242
details <- makeSimpleDetails hsc_env_tmp tcGblEnv
243
243
sf <- finalSafeMode (ms_hspp_opts ms) tcGblEnv
244
- #if MIN_GHC_API_VERSION (8,10,0)
244
+ #if MIN_VERSION_ghc (8,10,0)
245
245
iface <- mkIfaceTc hsc_env_tmp sf details tcGblEnv
246
246
#else
247
247
(iface, _) <- mkIfaceTc hsc_env_tmp Nothing sf details tcGblEnv
@@ -275,10 +275,10 @@ mkHiFileResultCompile session' tcm simplified_guts ltype = catchErrs $ do
275
275
(guts, details) <- tidyProgram session simplified_guts
276
276
(diags, linkable) <- genLinkable session ms guts
277
277
pure (linkable, details, diags)
278
- #if MIN_GHC_API_VERSION (9,0,1)
278
+ #if MIN_VERSION_ghc (9,0,1)
279
279
let ! partial_iface = force (mkPartialIface session details simplified_guts)
280
280
final_iface <- mkFullIface session partial_iface Nothing
281
- #elif MIN_GHC_API_VERSION (8,10,0)
281
+ #elif MIN_VERSION_ghc (8,10,0)
282
282
let ! partial_iface = force (mkPartialIface session details simplified_guts)
283
283
final_iface <- mkFullIface session partial_iface
284
284
#else
@@ -340,18 +340,18 @@ generateObjectCode session summary guts = do
340
340
(warnings, dot_o_fp) <-
341
341
withWarnings " object" $ \ _tweak -> do
342
342
let summary' = _tweak summary
343
- #if MIN_GHC_API_VERSION (8,10,0)
343
+ #if MIN_VERSION_ghc (8,10,0)
344
344
target = defaultObjectTarget $ hsc_dflags session
345
345
#else
346
346
target = defaultObjectTarget $ targetPlatform $ hsc_dflags session
347
347
#endif
348
348
session' = session { hsc_dflags = updOptLevel 0 $ (ms_hspp_opts summary') { outputFile = Just dot_o , hscTarget = target}}
349
- #if MIN_GHC_API_VERSION (9,0,1)
349
+ #if MIN_VERSION_ghc (9,0,1)
350
350
(outputFilename, _mStub, _foreign_files, _cinfos) <- hscGenHardCode session' guts
351
351
#else
352
352
(outputFilename, _mStub, _foreign_files) <- hscGenHardCode session' guts
353
353
#endif
354
- #if MIN_GHC_API_VERSION (8,10,0)
354
+ #if MIN_VERSION_ghc (8,10,0)
355
355
(ms_location summary')
356
356
#else
357
357
summary'
@@ -374,7 +374,7 @@ generateByteCode hscEnv summary guts = do
374
374
let summary' = _tweak summary
375
375
session = hscEnv { hsc_dflags = ms_hspp_opts summary' }
376
376
hscInteractive session guts
377
- #if MIN_GHC_API_VERSION (8,10,0)
377
+ #if MIN_VERSION_ghc (8,10,0)
378
378
(ms_location summary')
379
379
#else
380
380
summary'
@@ -433,7 +433,7 @@ unnecessaryDeprecationWarningFlags
433
433
, Opt_WarnUnusedMatches
434
434
, Opt_WarnUnusedTypePatterns
435
435
, Opt_WarnUnusedForalls
436
- #if MIN_GHC_API_VERSION (8,10,0)
436
+ #if MIN_VERSION_ghc (8,10,0)
437
437
, Opt_WarnUnusedRecordWildcards
438
438
#endif
439
439
, Opt_WarnInaccessibleCode
@@ -478,7 +478,7 @@ generateHieAsts hscEnv tcm =
478
478
-- don't export an interface which allows for additional information to be added to hie files.
479
479
let fake_splice_binds = listToBag (map (mkVarBind unitDataConId) (spliceExpresions $ tmrTopLevelSplices tcm))
480
480
real_binds = tcg_binds $ tmrTypechecked tcm
481
- #if MIN_GHC_API_VERSION (9,0,1)
481
+ #if MIN_VERSION_ghc (9,0,1)
482
482
-- TODO: Use some proper values here!
483
483
evBinds = emptyBag @ EvBind :: Bag EvBind
484
484
clsInsts = [] :: [ClsInst ]
@@ -760,7 +760,7 @@ getModSummaryFromImports env fp modTime contents = do
760
760
msrModSummary =
761
761
ModSummary
762
762
{ ms_mod = modl
763
- #if MIN_GHC_API_VERSION (8,8,0)
763
+ #if MIN_VERSION_ghc (8,8,0)
764
764
, ms_hie_date = Nothing
765
765
#endif
766
766
, ms_hs_date = modTime
@@ -800,15 +800,15 @@ parseHeader
800
800
=> DynFlags -- ^ flags to use
801
801
-> FilePath -- ^ the filename (for source locations)
802
802
-> SB. StringBuffer -- ^ Haskell module source text (full Unicode is supported)
803
- #if MIN_GHC_API_VERSION (9,0,1)
803
+ #if MIN_VERSION_ghc (9,0,1)
804
804
-> ExceptT [FileDiagnostic ] m ([FileDiagnostic ], Located (HsModule ))
805
805
#else
806
806
-> ExceptT [FileDiagnostic ] m ([FileDiagnostic ], Located (HsModule GhcPs ))
807
807
#endif
808
808
parseHeader dflags filename contents = do
809
809
let loc = mkRealSrcLoc (mkFastString filename) 1 1
810
810
case unP Parser. parseHeader (mkPState dflags contents loc) of
811
- #if MIN_GHC_API_VERSION (8,10,0)
811
+ #if MIN_VERSION_ghc (8,10,0)
812
812
PFailed pst ->
813
813
throwE $ diagFromErrMsgs " parser" dflags $ getErrorMessages pst dflags
814
814
#else
@@ -846,7 +846,7 @@ parseFileContents env customPreprocessor filename ms = do
846
846
dflags = ms_hspp_opts ms
847
847
contents = fromJust $ ms_hspp_buf ms
848
848
case unP Parser. parseModule (mkPState dflags contents loc) of
849
- #if MIN_GHC_API_VERSION (8,10,0)
849
+ #if MIN_VERSION_ghc (8,10,0)
850
850
PFailed pst -> throwE $ diagFromErrMsgs " parser" dflags $ getErrorMessages pst dflags
851
851
#else
852
852
PFailed _ locErr msgErr ->
@@ -855,7 +855,7 @@ parseFileContents env customPreprocessor filename ms = do
855
855
POk pst rdr_module ->
856
856
let hpm_annotations :: ApiAnns
857
857
hpm_annotations =
858
- #if MIN_GHC_API_VERSION (9,0,1)
858
+ #if MIN_VERSION_ghc (9,0,1)
859
859
-- Copied from GHC.Driver.Main
860
860
ApiAnns {
861
861
apiAnnItems = Map. fromListWith (++) $ annotations pst,
0 commit comments