@@ -50,7 +50,7 @@ module Development.IDE.Core.Rules(
50
50
getHieAstsRule ,
51
51
getBindingsRule ,
52
52
needsCompilationRule ,
53
- computeLinkableType ,
53
+ computeLinkableTypeForDynFlags ,
54
54
generateCoreRule ,
55
55
getImportMapRule ,
56
56
regenerateHiFile ,
@@ -1015,33 +1015,33 @@ needsCompilationRule file = do
1015
1015
pure $ computeLinkableType ms modsums (map join needsComps)
1016
1016
1017
1017
pure (Just $ encodeLinkableType res, Just res)
1018
-
1019
- -- | Compute the linkable type required for the input module
1020
- computeLinkableType
1021
- :: ModSummary -- ^ module
1022
- -> [Maybe ModSummary ] -- ^ direct dependencies
1023
- -> [Maybe LinkableType ] -- ^ linkable requirements for the direct dependencies
1024
- -> Maybe LinkableType
1025
- computeLinkableType this deps xs
1026
- | Just ObjectLinkable `elem` xs = Just ObjectLinkable -- If any dependent needs object code, so do we
1027
- | Just BCOLinkable `elem` xs = Just this_type -- If any dependent needs bytecode, then we need to be compiled
1028
- | any (maybe False uses_th_qq) deps = Just this_type -- If any dependent needs TH, then we need to be compiled
1029
- | otherwise = Nothing -- If none of these conditions are satisfied, we don't need to compile
1030
- where
1031
- uses_th_qq (ms_hspp_opts -> dflags) =
1032
- xopt LangExt. TemplateHaskell dflags || xopt LangExt. QuasiQuotes dflags
1033
-
1034
- unboxed_tuples_or_sums (ms_hspp_opts -> d) =
1035
- xopt LangExt. UnboxedTuples d || xopt LangExt. UnboxedSums d
1036
- -- How should we compile this module? (assuming we do in fact need to compile it)
1037
- -- Depends on whether it uses unboxed tuples or sums
1038
- this_type
1018
+ where
1019
+ uses_th_qq (ms_hspp_opts -> dflags) =
1020
+ xopt LangExt. TemplateHaskell dflags || xopt LangExt. QuasiQuotes dflags
1021
+
1022
+ computeLinkableType :: ModSummary -> [Maybe ModSummary ] -> [Maybe LinkableType ] -> Maybe LinkableType
1023
+ computeLinkableType this deps xs
1024
+ | Just ObjectLinkable `elem` xs = Just ObjectLinkable -- If any dependent needs object code, so do we
1025
+ | Just BCOLinkable `elem` xs = Just this_type -- If any dependent needs bytecode, then we need to be compiled
1026
+ | any (maybe False uses_th_qq) deps = Just this_type -- If any dependent needs TH, then we need to be compiled
1027
+ | otherwise = Nothing -- If none of these conditions are satisfied, we don't need to compile
1028
+ where
1029
+ this_type = computeLinkableTypeForDynFlags (ms_hspp_opts this)
1030
+
1031
+ -- | How should we compile this module?
1032
+ -- (assuming we do in fact need to compile it).
1033
+ -- Depends on whether it uses unboxed tuples or sums
1034
+ computeLinkableTypeForDynFlags :: DynFlags -> LinkableType
1035
+ computeLinkableTypeForDynFlags d
1039
1036
#if defined(GHC_PATCHED_UNBOXED_BYTECODE)
1040
1037
= BCOLinkable
1041
1038
#else
1042
- | unboxed_tuples_or_sums this = ObjectLinkable
1043
- | otherwise = BCOLinkable
1039
+ | unboxed_tuples_or_sums = ObjectLinkable
1040
+ | otherwise = BCOLinkable
1044
1041
#endif
1042
+ where
1043
+ unboxed_tuples_or_sums =
1044
+ xopt LangExt. UnboxedTuples d || xopt LangExt. UnboxedSums d
1045
1045
1046
1046
-- | Tracks which linkables are current, so we don't need to unload them
1047
1047
newtype CompiledLinkables = CompiledLinkables { getCompiledLinkables :: Var (ModuleEnv UTCTime ) }
0 commit comments