summaryrefslogtreecommitdiff
path: root/compiler/GHC/Driver/Backend.hs
diff options
context:
space:
mode:
authorFinley McIlwaine <finleymcilwaine@gmail.com>2023-05-17 13:43:54 -0600
committerFinley McIlwaine <finleymcilwaine@gmail.com>2023-05-17 13:43:54 -0600
commitbc57ee2686dfe011a631bec9f64cb86f03545d3d (patch)
treec3727116a88ebd3cc71c32f0c3321f142493f36b /compiler/GHC/Driver/Backend.hs
parent2972fd66f91cb51426a1df86b8166a067015e231 (diff)
downloadhaskell-wip/haddock-mem-fixes.tar.gz
Memory usage fixes for Haddockwip/haddock-mem-fixes
- Do not include `mi_globals` in the `NoBackend` backend. It was only included for Haddock, but Haddock does not actually need it. This causes a 200MB reduction in max residency when generating haddocks on the Agda codebase (roughly 1GB to 800MB). - Strictly evaluate some SrcSpans in mkDoc{Next,Prev} to avoid thunks - Strictly evaluate names in rnHsDoc to avoid retaining entire GlobalRdrEnv - Update Haddock submodule
Diffstat (limited to 'compiler/GHC/Driver/Backend.hs')
-rw-r--r--compiler/GHC/Driver/Backend.hs7
1 files changed, 2 insertions, 5 deletions
diff --git a/compiler/GHC/Driver/Backend.hs b/compiler/GHC/Driver/Backend.hs
index e59f0a51f7..ab3cf3ce8d 100644
--- a/compiler/GHC/Driver/Backend.hs
+++ b/compiler/GHC/Driver/Backend.hs
@@ -551,17 +551,14 @@ backendRespectsSpecialise (Named NoBackend) = False
-- | This back end wants the `mi_globals` field of a
-- `ModIface` to be populated (with the top-level bindings
--- of the original source). True for the interpreter, and
--- also true for "no backend", which is used by Haddock.
--- (After typechecking a module, Haddock wants access to
--- the module's `GlobalRdrEnv`.)
+-- of the original source). Only true for the interpreter.
backendWantsGlobalBindings :: Backend -> Bool
backendWantsGlobalBindings (Named NCG) = False
backendWantsGlobalBindings (Named LLVM) = False
backendWantsGlobalBindings (Named ViaC) = False
backendWantsGlobalBindings (Named JavaScript) = False
+backendWantsGlobalBindings (Named NoBackend) = False
backendWantsGlobalBindings (Named Interpreter) = True
-backendWantsGlobalBindings (Named NoBackend) = True
-- | The back end targets a technology that implements
-- `switch` natively. (For example, LLVM or C.) Therefore