summaryrefslogtreecommitdiff
path: root/compiler/GHC/Unit/Module
diff options
context:
space:
mode:
authorDivam <dfordivam@gmail.com>2021-04-19 13:49:30 +0900
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-05-25 05:50:51 -0400
commitf243acf4d7322a15e9eb6e432c490a4d6db741df (patch)
treef01d9ab4799043931488fa3c97a0ce75a3e4c7c1 /compiler/GHC/Unit/Module
parenta3665a7aa5db8a77809b8e2246b8cd7eee86935c (diff)
downloadhaskell-f243acf4d7322a15e9eb6e432c490a4d6db741df.tar.gz
Refactor driver code; de-duplicate and split APIs (#14095, !5555)
This commit does some de-duplication of logic between the one-shot and --make modes, and splitting of some of the APIs so that its easier to do the fine-grained parallelism implementation. This is the first part of the implementation plan as described in #14095 * compileOne now uses the runPhase pipeline for most of the work. The Interpreter backend handling has been moved to the runPhase. * hscIncrementalCompile has been broken down into multiple APIs. * haddock submodule bump: Rename of variables in html-test ref: This is caused by a change in ModDetails in case of NoBackend. Now the initModDetails is used to recreate the ModDetails from interface and in-memory ModDetails is not used.
Diffstat (limited to 'compiler/GHC/Unit/Module')
-rw-r--r--compiler/GHC/Unit/Module/Status.hs24
1 files changed, 13 insertions, 11 deletions
diff --git a/compiler/GHC/Unit/Module/Status.hs b/compiler/GHC/Unit/Module/Status.hs
index 52938154b4..e4273de94b 100644
--- a/compiler/GHC/Unit/Module/Status.hs
+++ b/compiler/GHC/Unit/Module/Status.hs
@@ -1,5 +1,5 @@
module GHC.Unit.Module.Status
- ( HscStatus (..)
+ ( HscBackendAction(..), HscRecompStatus (..)
)
where
@@ -8,20 +8,22 @@ import GHC.Prelude
import GHC.Unit
import GHC.Unit.Module.ModGuts
import GHC.Unit.Module.ModIface
-import GHC.Unit.Module.ModDetails
import GHC.Utils.Fingerprint
--- | Status of a module compilation to machine code
-data HscStatus
- -- | Nothing to do.
- = HscNotGeneratingCode ModIface ModDetails
+-- | Status of a module in incremental compilation
+data HscRecompStatus
-- | Nothing to do because code already exists.
- | HscUpToDate ModIface ModDetails
- -- | Update boot file result.
- | HscUpdateBoot ModIface ModDetails
- -- | Generate signature file (backpack)
- | HscUpdateSig ModIface ModDetails
+ = HscUpToDate ModIface
+ -- | Recompilation of module, or update of interface is required. Optionally
+ -- pass the old interface hash to avoid updating the existing interface when
+ -- it has not changed.
+ | HscRecompNeeded (Maybe Fingerprint)
+
+-- | Action to perform in backend compilation
+data HscBackendAction
+ -- | Update the boot and signature file results.
+ = HscUpdate ModIface
-- | Recompile this module.
| HscRecomp
{ hscs_guts :: CgGuts