Commit f7cc4313 authored by Sylvain Henry's avatar Sylvain Henry Committed by Marge Bot

Replace HscTarget with Backend

They both have the same role and Backend name is more explicit.

Metric Decrease:
    T3064

Update Haddock submodule
parent 735f9d6b
Pipeline #22544 canceled with stages
......@@ -27,8 +27,8 @@ module GHC (
needsTemplateHaskellOrQQ,
-- * Flags and settings
DynFlags(..), GeneralFlag(..), Severity(..), HscTarget(..), gopt,
GhcMode(..), GhcLink(..), defaultObjectTarget,
DynFlags(..), GeneralFlag(..), Severity(..), Backend(..), gopt,
GhcMode(..), GhcLink(..),
parseDynamicFlags,
getSessionDynFlags, setSessionDynFlags,
getProgramDynFlags, setProgramDynFlags, setLogAction,
......@@ -302,6 +302,7 @@ import GHC.Runtime.Interpreter.Types
import GHCi.RemoteTypes
import GHC.Core.Ppr.TyThing ( pprFamInst )
import GHC.Driver.Backend
import GHC.Driver.Main
import GHC.Driver.Make
import GHC.Driver.Hooks
......@@ -1012,7 +1013,7 @@ desugarModule tcm = do
--
-- A module must be loaded before dependent modules can be typechecked. This
-- always includes generating a 'ModIface' and, depending on the
-- @DynFlags@\'s 'GHC.Driver.Session.hscTarget', may also include code generation.
-- @DynFlags@\'s 'GHC.Driver.Session.backend', may also include code generation.
--
-- This function will always cause recompilation and will always overwrite
-- previous compilation results (potentially files on disk).
......
......@@ -129,6 +129,7 @@ import GHC.Types.CostCentre
import GHC.Utils.Outputable
import GHC.Data.FastString
import GHC.Driver.Session
import GHC.Driver.Backend
import GHC.Platform
import GHC.Types.Unique.Set
import GHC.Utils.Misc
......@@ -1255,7 +1256,7 @@ pprCLabel dflags = \case
where
platform = targetPlatform dflags
useNCG = hscTarget dflags == HscAsm
useNCG = backend dflags == NCG
maybe_underscore :: SDoc -> SDoc
maybe_underscore doc =
......
......@@ -24,6 +24,7 @@ import GHC.Cmm.Dataflow.Collections
import GHC.Types.Unique.Supply
import GHC.Driver.Session
import GHC.Driver.Backend
import GHC.Utils.Error
import GHC.Driver.Types
import Control.Monad
......@@ -171,7 +172,7 @@ cpsTop hsc_env proc =
-- tablesNextToCode is off. The latter is because we have no
-- label to put on info tables for basic blocks that are not
-- the entry point.
splitting_proc_points = hscTarget dflags /= HscAsm
splitting_proc_points = backend dflags /= NCG
|| not (platformTablesNextToCode platform)
|| -- Note [inconsistent-pic-reg]
usingInconsistentPicReg
......
......@@ -8,14 +8,14 @@ module GHC.Cmm.Switch (
switchTargetsToList, eqSwitchTargetWith,
SwitchPlan(..),
targetSupportsSwitch,
backendSupportsSwitch,
createSwitchPlan,
) where
import GHC.Prelude
import GHC.Utils.Outputable
import GHC.Driver.Session
import GHC.Driver.Backend
import GHC.Cmm.Dataflow.Label (Label)
import Data.Maybe
......@@ -316,12 +316,12 @@ and slowed down all other cases making it not worthwhile.
-}
-- | Does the target support switch out of the box? Then leave this to the
-- target!
targetSupportsSwitch :: HscTarget -> Bool
targetSupportsSwitch HscC = True
targetSupportsSwitch HscLlvm = True
targetSupportsSwitch _ = False
-- | Does the backend support switch out of the box? Then leave this to the
-- backend!
backendSupportsSwitch :: Backend -> Bool
backendSupportsSwitch ViaC = True
backendSupportsSwitch LLVM = True
backendSupportsSwitch _ = False
-- | This function creates a SwitchPlan from a SwitchTargets value, breaking it
-- down into smaller pieces suitable for code generation.
......
......@@ -35,7 +35,7 @@ import GHC.Utils.Monad (concatMapM)
cmmImplementSwitchPlans :: DynFlags -> CmmGraph -> UniqSM CmmGraph
cmmImplementSwitchPlans dflags g
-- Switch generation done by backend (LLVM/C)
| targetSupportsSwitch (hscTarget dflags) = return g
| backendSupportsSwitch (backend dflags) = return g
| otherwise = do
blocks' <- concatMapM (visitSwitches (targetPlatform dflags)) (toBlockList g)
return $ ofBlockList (g_entry g) blocks'
......
......@@ -5,18 +5,82 @@ module GHC.Driver.Backend
( Backend (..)
, platformDefaultBackend
, platformNcgSupported
, backendProducesObject
, backendRetainsAllBindings
)
where
import GHC.Prelude
import GHC.Platform
-- | Backend
-- | Code generation backends.
--
-- GHC supports several code generation backends serving different purposes
-- (producing machine code, producing ByteCode for the interpreter) and
-- supporting different platforms.
--
data Backend
= NCG -- ^ Native code generator backend
| LLVM -- ^ LLVM backend
| ViaC -- ^ Via-C backend
| Interpreter -- ^ Interpreter
= NCG -- ^ Native code generator backend.
--
-- Compiles Cmm code into textual assembler, then relies on
-- an external assembler toolchain to produce machine code.
--
-- Only supports a few platforms (X86, PowerPC, SPARC).
--
-- See "GHC.CmmToAsm".
| LLVM -- ^ LLVM backend.
--
-- Compiles Cmm code into LLVM textual IR, then relies on
-- LLVM toolchain to produce machine code.
--
-- It relies on LLVM support for the calling convention used
-- by the NCG backend to produce code objects ABI compatible
-- with it (see "cc 10" or "ghccc" calling convention in
-- https://llvm.org/docs/LangRef.html#calling-conventions).
--
-- Support a few platforms (X86, AArch64, s390x, ARM).
--
-- See "GHC.CmmToLlvm"
| ViaC -- ^ Via-C backend.
--
-- Compiles Cmm code into C code, then relies on a C compiler
-- to produce machine code.
--
-- It produces code objects that are *not* ABI compatible
-- with those produced by NCG and LLVM backends.
--
-- Produced code is expected to be less efficient than the
-- one produced by NCG and LLVM backends because STG
-- registers are not pinned into real registers. On the
-- other hand, it supports more target platforms (those
-- having a valid C toolchain).
--
-- See "GHC.CmmToC"
| Interpreter -- ^ ByteCode interpreter.
--
-- Produce ByteCode objects (BCO, see "GHC.ByteCode") that
-- can be interpreted. It is used by GHCi.
--
-- Currently some extensions are not supported (unboxed
-- tuples/sums, foreign primops).
--
-- See "GHC.CoreToByteCode"
| NoBackend -- ^ No code generated.
--
-- Use this to disable code generation. It is particularly
-- useful when GHC is used as a library for other purpose
-- than generating code (e.g. to generate documentation with
-- Haddock) or when the user requested it (via -fno-code) for
-- some reason.
deriving (Eq,Ord,Show,Read)
-- | Default backend to use for the given platform.
......@@ -41,3 +105,27 @@ platformNcgSupported platform = if
ArchPPC_64 {} -> True
ArchSPARC -> True
_ -> False
-- | Will this backend produce an object file on the disk?
backendProducesObject :: Backend -> Bool
backendProducesObject ViaC = True
backendProducesObject NCG = True
backendProducesObject LLVM = True
backendProducesObject Interpreter = False
backendProducesObject NoBackend = False
-- | Does this backend retain *all* top-level bindings for a module,
-- rather than just the exported bindings, in the TypeEnv and compiled
-- code (if any)?
--
-- Interpreter backend does this, so that GHCi can call functions inside a
-- module.
--
-- When no backend is used we also do it, so that Haddock can get access to the
-- GlobalRdrEnv for a module after typechecking it.
backendRetainsAllBindings :: Backend -> Bool
backendRetainsAllBindings Interpreter = True
backendRetainsAllBindings NoBackend = True
backendRetainsAllBindings ViaC = False
backendRetainsAllBindings NCG = False
backendRetainsAllBindings LLVM = False
......@@ -162,15 +162,15 @@ withBkpSession cid insts deps session_type do_this = do
(case session_type of
-- Make sure to write interfaces when we are type-checking
-- indefinite packages.
TcSession | hscTarget dflags /= HscNothing
TcSession | backend dflags /= NoBackend
-> flip gopt_set Opt_WriteInterface
| otherwise -> id
CompSession -> id
ExeSession -> id) $
dflags {
hscTarget = case session_type of
TcSession -> HscNothing
_ -> hscTarget dflags,
backend = case session_type of
TcSession -> NoBackend
_ -> backend dflags,
homeUnitInstantiations = insts,
-- if we don't have any instantiation, don't
-- fill `homeUnitInstanceOfId` as it makes no
......@@ -505,8 +505,7 @@ mkBackpackMsg = do
showMsg msg reason =
backpackProgressMsg level dflags $
showModuleIndex mod_index ++
msg ++ showModMsg dflags (hscTarget dflags)
(recompileRequired recomp) mod_summary
msg ++ showModMsg dflags (recompileRequired recomp) mod_summary
++ reason
in case recomp of
MustCompile -> showMsg "Compiling " ""
......
......@@ -23,6 +23,7 @@ import GHC.CmmToLlvm ( llvmCodeGen )
import GHC.Types.Unique.Supply ( mkSplitUniqSupply )
import GHC.Driver.Finder ( mkStubPaths )
import GHC.Driver.Backend
import GHC.CmmToC ( writeC )
import GHC.Cmm.Lint ( cmmLint )
import GHC.Cmm ( RawCmmGroup )
......@@ -94,13 +95,13 @@ codeOutput dflags this_mod filenm location foreign_stubs foreign_fps pkg_deps
}
; stubs_exist <- outputForeignStubs dflags this_mod location foreign_stubs
; a <- case hscTarget dflags of
HscAsm -> outputAsm dflags this_mod location filenm
linted_cmm_stream
HscC -> outputC dflags filenm linted_cmm_stream pkg_deps
HscLlvm -> outputLlvm dflags filenm linted_cmm_stream
HscInterpreted -> panic "codeOutput: HscInterpreted"
HscNothing -> panic "codeOutput: HscNothing"
; a <- case backend dflags of
NCG -> outputAsm dflags this_mod location filenm
linted_cmm_stream
ViaC -> outputC dflags filenm linted_cmm_stream pkg_deps
LLVM -> outputLlvm dflags filenm linted_cmm_stream
Interpreter -> panic "codeOutput: Interpreter"
NoBackend -> panic "codeOutput: NoBackend"
; return (filenm, stubs_exist, foreign_fps, a)
}
......
......@@ -149,6 +149,7 @@ import GHC.Runtime.Loader ( initializePlugins )
import GHC.StgToCmm.Types (CgInfos (..), ModuleLFInfos)
import GHC.Driver.Session
import GHC.Driver.Backend
import GHC.Utils.Error
import GHC.Utils.Outputable
......@@ -784,7 +785,7 @@ finish :: ModSummary
finish summary tc_result mb_old_hash = do
hsc_env <- getHscEnv
let dflags = hsc_dflags hsc_env
target = hscTarget dflags
bcknd = backend dflags
hsc_src = ms_hsc_src summary
-- Desugar, if appropriate
......@@ -802,7 +803,7 @@ finish summary tc_result mb_old_hash = do
-- interface file.
case mb_desugar of
-- Just cause we desugared doesn't mean we are generating code, see above.
Just desugared_guts | target /= HscNothing -> do
Just desugared_guts | bcknd /= NoBackend -> do
plugins <- liftIO $ readIORef (tcg_th_coreplugins tc_result)
simplified_guts <- hscSimplify' plugins desugared_guts
......@@ -830,11 +831,12 @@ finish summary tc_result mb_old_hash = do
liftIO $ hscMaybeWriteIface dflags iface mb_old_iface_hash (ms_location summary)
return $ case (target, hsc_src) of
(HscNothing, _) -> HscNotGeneratingCode iface details
(_, HsBootFile) -> HscUpdateBoot iface details
(_, HsigFile) -> HscUpdateSig iface details
_ -> panic "finish"
return $ case bcknd of
NoBackend -> HscNotGeneratingCode iface details
_ -> case hsc_src of
HsBootFile -> HscUpdateBoot iface details
HsigFile -> HscUpdateSig iface details
_ -> panic "finish"
{-
Note [Writing interface files]
......@@ -853,10 +855,10 @@ hscMaybeWriteIface, but only once per compilation (twice with dynamic-too).
hscMaybeWriteIface :: DynFlags -> ModIface -> Maybe Fingerprint -> ModLocation -> IO ()
hscMaybeWriteIface dflags iface old_iface location = do
let force_write_interface = gopt Opt_WriteInterface dflags
write_interface = case hscTarget dflags of
HscNothing -> False
HscInterpreted -> False
_ -> True
write_interface = case backend dflags of
NoBackend -> False
Interpreter -> False
_ -> True
no_change = old_iface == Just (mi_iface_hash (mi_final_exts iface))
when (write_interface || force_write_interface) $
......@@ -901,8 +903,7 @@ batchMsg hsc_env mod_index recomp mod_summary =
showMsg msg reason =
compilationProgressMsg dflags $
(showModuleIndex mod_index ++
msg ++ showModMsg dflags (hscTarget dflags)
(recompileRequired recomp) mod_summary)
msg ++ showModMsg dflags (recompileRequired recomp) mod_summary)
++ reason
--------------------------------------------------------------
......
......@@ -40,6 +40,7 @@ import qualified GHC.Runtime.Linker as Linker
import GHC.Driver.Phases
import GHC.Driver.Pipeline
import GHC.Driver.Session
import GHC.Driver.Backend
import GHC.Utils.Error
import GHC.Driver.Finder
import GHC.Driver.Monad
......@@ -274,7 +275,7 @@ data LoadHowMuch
--
-- This function implements the core of GHC's @--make@ mode. It preprocesses,
-- compiles and loads the specified modules, avoiding re-compilation wherever
-- possible. Depending on the target (see 'GHC.Driver.Session.hscTarget') compiling
-- possible. Depending on the backend (see 'DynFlags.backend' field) compiling
-- and loading may result in files being created on disk.
--
-- Calls the 'defaultWarnErrLogger' after each compiling each module, whether
......@@ -1516,7 +1517,7 @@ upsweep mHscMessage old_hpt stable_mods cleanup sccs = do
-- Add any necessary entries to the static pointer
-- table. See Note [Grand plan for static forms] in
-- GHC.Iface.Tidy.StaticPtrTable.
when (hscTarget (hsc_dflags hsc_env4) == HscInterpreted) $
when (backend (hsc_dflags hsc_env4) == Interpreter) $
liftIO $ hscAddSptEntries hsc_env4
[ spt
| Just linkable <- pure $ hm_linkable mod_info
......@@ -1575,24 +1576,25 @@ upsweep_mod hsc_env mHscMessage old_hpt (stable_obj, stable_bco) summary mod_ind
-- We're using the dflags for this module now, obtained by
-- applying any options in its LANGUAGE & OPTIONS_GHC pragmas.
dflags = ms_hspp_opts summary
prevailing_target = hscTarget (hsc_dflags hsc_env)
local_target = hscTarget dflags
prevailing_backend = backend (hsc_dflags hsc_env)
local_backend = backend dflags
-- If OPTIONS_GHC contains -fasm or -fllvm, be careful that
-- we don't do anything dodgy: these should only work to change
-- from -fllvm to -fasm and vice-versa, or away from -fno-code,
-- otherwise we could end up trying to link object code to byte
-- code.
target = if prevailing_target /= local_target
&& (not (isObjectTarget prevailing_target)
|| not (isObjectTarget local_target))
&& not (prevailing_target == HscNothing)
&& not (prevailing_target == HscInterpreted)
then prevailing_target
else local_target
-- store the corrected hscTarget into the summary
summary' = summary{ ms_hspp_opts = dflags { hscTarget = target } }
bcknd = case (prevailing_backend,local_backend) of
(LLVM,NCG) -> NCG
(NCG,LLVM) -> LLVM
(NoBackend,b)
| backendProducesObject b -> b
(Interpreter,b)
| backendProducesObject b -> b
_ -> prevailing_backend
-- store the corrected backend into the summary
summary' = summary{ ms_hspp_opts = dflags { backend = bcknd } }
-- The old interface is ok if
-- a) we're compiling a source file, and the old HPT
......@@ -1623,9 +1625,9 @@ upsweep_mod hsc_env mHscMessage old_hpt (stable_obj, stable_bco) summary mod_ind
compileOne' Nothing mHscMessage hsc_env summary' mod_index nmods
Nothing mb_linkable src_modified
-- With the HscNothing target we create empty linkables to avoid
-- recompilation. We have to detect these to recompile anyway if
-- the target changed since the last compile.
-- With NoBackend we create empty linkables to avoid recompilation.
-- We have to detect these to recompile anyway if the backend changed
-- since the last compile.
is_fake_linkable
| Just hmi <- old_hmi, Just l <- hm_linkable hmi =
null (linkableUnlinked l)
......@@ -1658,8 +1660,8 @@ upsweep_mod hsc_env mHscMessage old_hpt (stable_obj, stable_bco) summary mod_ind
-- object is stable, but we need to load the interface
-- off disk to make a HMI.
| not (isObjectTarget target), is_stable_bco,
(target /= HscNothing) `implies` not is_fake_linkable ->
| not (backendProducesObject bcknd), is_stable_bco,
(bcknd /= NoBackend) `implies` not is_fake_linkable ->
ASSERT(isJust old_hmi) -- must be in the old_hpt
let Just hmi = old_hmi in do
liftIO $ debugTraceMsg (hsc_dflags hsc_env) 5
......@@ -1667,11 +1669,11 @@ upsweep_mod hsc_env mHscMessage old_hpt (stable_obj, stable_bco) summary mod_ind
return hmi
-- BCO is stable: nothing to do
| not (isObjectTarget target),
| not (backendProducesObject bcknd),
Just hmi <- old_hmi,
Just l <- hm_linkable hmi,
not (isObjectLinkable l),
(target /= HscNothing) `implies` not is_fake_linkable,
(bcknd /= NoBackend) `implies` not is_fake_linkable,
linkableTime l >= ms_hs_date summary -> do
liftIO $ debugTraceMsg (hsc_dflags hsc_env) 5
(text "compiling non-stable BCO mod:" <+> ppr this_mod_name)
......@@ -1688,7 +1690,7 @@ upsweep_mod hsc_env mHscMessage old_hpt (stable_obj, stable_bco) summary mod_ind
-- separately and generated a new interface, that we must
-- read from the disk.
--
| isObjectTarget target,
| backendProducesObject bcknd,
Just obj_date <- mb_obj_date,
obj_date >= hs_date -> do
case old_hmi of
......@@ -1728,7 +1730,7 @@ possible.
When GHC is invoked with -fno-code no object files or linked output will be
generated. As many errors and warnings as possible will be generated, as if
-fno-code had not been passed. The session DynFlags will have
hscTarget == HscNothing.
backend == NoBackend.
-fwrite-interface
~~~~~~~~~~~~~~~~
......@@ -2109,15 +2111,11 @@ downsweep hsc_env old_summaries excl_mods allow_dup_roots
-- for dependencies of modules that have -XTemplateHaskell,
-- otherwise those modules will fail to compile.
-- See Note [-fno-code mode] #8025
map1 <- if hscTarget dflags == HscNothing
then enableCodeGenForTH
(defaultObjectTarget dflags)
map0
else if hscTarget dflags == HscInterpreted
then enableCodeGenForUnboxedTuplesOrSums
(defaultObjectTarget dflags)
map0
else return map0
let default_backend = platformDefaultBackend (targetPlatform dflags)
map1 <- case backend dflags of
NoBackend -> enableCodeGenForTH default_backend map0
Interpreter -> enableCodeGenForUnboxedTuplesOrSums default_backend map0
_ -> return map0
if null errs
then pure $ concat $ nodeMapElts map1
else pure $ map Left errs
......@@ -2200,7 +2198,7 @@ downsweep hsc_env old_summaries excl_mods allow_dup_roots
-- the specified target, disable optimization and change the .hi
-- and .o file locations to be temporary files.
-- See Note [-fno-code mode]
enableCodeGenForTH :: HscTarget
enableCodeGenForTH :: Backend
-> NodeMap [Either ErrorMessages ModSummary]
-> IO (NodeMap [Either ErrorMessages ModSummary])
enableCodeGenForTH =
......@@ -2208,7 +2206,7 @@ enableCodeGenForTH =
where
condition = isTemplateHaskellOrQQNonBoot
should_modify (ModSummary { ms_hspp_opts = dflags }) =
hscTarget dflags == HscNothing &&
backend dflags == NoBackend &&
-- Don't enable codegen for TH on indefinite packages; we
-- can't compile anything anyway! See #16219.
homeUnitIsDefinite dflags
......@@ -2220,7 +2218,7 @@ enableCodeGenForTH =
--
-- This is used in order to load code that uses unboxed tuples
-- or sums into GHCi while still allowing some code to be interpreted.
enableCodeGenForUnboxedTuplesOrSums :: HscTarget
enableCodeGenForUnboxedTuplesOrSums :: Backend
-> NodeMap [Either ErrorMessages ModSummary]
-> IO (NodeMap [Either ErrorMessages ModSummary])
enableCodeGenForUnboxedTuplesOrSums =
......@@ -2233,7 +2231,7 @@ enableCodeGenForUnboxedTuplesOrSums =
unboxed_tuples_or_sums d =
xopt LangExt.UnboxedTuples d || xopt LangExt.UnboxedSums d
should_modify (ModSummary { ms_hspp_opts = dflags }) =
hscTarget dflags == HscInterpreted
backend dflags == Interpreter
-- | Helper used to implement 'enableCodeGenForTH' and
-- 'enableCodeGenForUnboxedTuples'. In particular, this enables
......@@ -2246,10 +2244,10 @@ enableCodeGenWhen
-> (ModSummary -> Bool)
-> TempFileLifetime
-> TempFileLifetime
-> HscTarget
-> Backend
-> NodeMap [Either ErrorMessages ModSummary]
-> IO (NodeMap [Either ErrorMessages ModSummary])
enableCodeGenWhen condition should_modify staticLife dynLife target nodemap =
enableCodeGenWhen condition should_modify staticLife dynLife bcknd nodemap =
traverse (traverse (traverse enable_code_gen)) nodemap
where
enable_code_gen ms
......@@ -2282,7 +2280,7 @@ enableCodeGenWhen condition should_modify staticLife dynLife target nodemap =
ms
{ ms_location =
ms_location {ml_hi_file = hi_file, ml_obj_file = o_file}
, ms_hspp_opts = updOptLevel 0 $ dflags {hscTarget = target}
, ms_hspp_opts = updOptLevel 0 $ dflags {backend = bcknd}
}
| otherwise = return ms
......@@ -2433,7 +2431,7 @@ checkSummaryTimestamp
not (gopt Opt_ForceRecomp (hsc_dflags hsc_env)) = do
-- update the object-file timestamp
obj_timestamp <-
if isObjectTarget (hscTarget (hsc_dflags hsc_env))
if backendProducesObject (backend (hsc_dflags hsc_env))
|| obj_allowed -- bug #1205
then liftIO $ getObjTimestamp location is_boot
else return Nothing
......@@ -2609,7 +2607,7 @@ makeNewModSummary hsc_env MakeNewModSummary{..} = do
-- when the user asks to load a source file by name, we only
-- use an object file if -fobject-code is on. See #1205.
obj_timestamp <- liftIO $
if isObjectTarget (hscTarget dflags)
if backendProducesObject (backend dflags)
|| nms_obj_allowed -- bug #1205
then getObjTimestamp nms_location nms_is_boot
else return Nothing
......
......@@ -53,6 +53,7 @@ import GHC.Utils.Outputable
import GHC.Unit.Module
import GHC.Utils.Error
import GHC.Driver.Session
import GHC.Driver.Backend
import GHC.Utils.Panic
import GHC.Utils.Misc
import GHC.Data.StringBuffer ( hGetStringBuffer, hPutStringBuffer )
......@@ -183,25 +184,25 @@ compileOne' m_tc_result mHscMessage
-- hscIncrementalCompile)
let hsc_env' = hsc_env{ hsc_dflags = plugin_dflags }
case (status, hsc_lang) of
case (status, bcknd) of
(HscUpToDate iface hmi_details, _) ->
-- TODO recomp014 triggers this assert. What's going on?!
-- ASSERT( isJust mb_old_linkable || isNoLink (ghcLink dflags) )
return $! HomeModInfo iface hmi_details mb_old_linkable
(HscNotGeneratingCode iface hmi_details, HscNothing) ->
(HscNotGeneratingCode iface hmi_details, NoBackend) ->
let mb_linkable = if isHsBootOrSig src_flavour
then Nothing
-- TODO: Questionable.
else Just (LM (ms_hs_date summary) this_mod [])
in return $! HomeModInfo iface hmi_details mb_linkable
(HscNotGeneratingCode _ _, _) -> panic "compileOne HscNotGeneratingCode"
(_, HscNothing) -> panic "compileOne HscNothing"
(HscUpdateBoot iface hmi_details, HscInterpreted) -> do
(_, NoBackend) -> panic "compileOne NoBackend"
(HscUpdateBoot iface hmi_details, Interpreter) -> do
return $! HomeModInfo iface hmi_details Nothing
(HscUpdateBoot iface hmi_details, _) -> do
touchObjectFile dflags object_filename
return $! HomeModInfo iface hmi_details Nothing
(HscUpdateSig iface hmi_details, HscInterpreted) -> do
(HscUpdateSig iface hmi_details, Interpreter) -> do
let !linkable = LM (ms_hs_date summary) this_mod []
return $! HomeModInfo iface hmi_details (Just linkable)
(HscUpdateSig iface hmi_details, _) -> do
......@@ -229,7 +230,7 @@ compileOne' m_tc_result mHscMessage
hscs_mod_details = hmi_details,
hscs_partial_iface = partial_iface,
hscs_old_iface_hash = mb_old_iface_hash,
hscs_iface_dflags = iface_dflags }, HscInterpreted) -> do
hscs_iface_dflags = iface_dflags }, Interpreter) -> do