summaryrefslogtreecommitdiff
path: root/compiler/GHC/Driver/Pipeline.hs
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2022-05-02 10:56:37 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-05-10 20:46:16 -0400
commitdcac383312cb4f2425eb412e72f632d6b484077b (patch)
tree72159cde91225c4b011e2024a48a7e0050943bd7 /compiler/GHC/Driver/Pipeline.hs
parentdf2e3373d534521d261e7b4fceee382c30974c0c (diff)
downloadhaskell-dcac383312cb4f2425eb412e72f632d6b484077b.tar.gz
driver: Make -no-keep-o-files -no-keep-hi-files work in --make mode
It seems like it was just an oversight to use the incorrect DynFlags (global rather than local) when implementing these two options. Using the local flags allows users to request these intermediate files get cleaned up, which works fine in --make mode because 1. Interface files are stored in memory 2. Object files are only cleaned at the end of session (after link) Fixes #21349
Diffstat (limited to 'compiler/GHC/Driver/Pipeline.hs')
-rw-r--r--compiler/GHC/Driver/Pipeline.hs13
1 files changed, 6 insertions, 7 deletions
diff --git a/compiler/GHC/Driver/Pipeline.hs b/compiler/GHC/Driver/Pipeline.hs
index 02ca6a4b57..89a4329745 100644
--- a/compiler/GHC/Driver/Pipeline.hs
+++ b/compiler/GHC/Driver/Pipeline.hs
@@ -229,13 +229,12 @@ compileOne' mHscMessage
debugTraceMsg logger 2 (text "compile: input file" <+> text input_fnpp)
- let flags = hsc_dflags hsc_env0
- in do unless (gopt Opt_KeepHiFiles flags) $
- addFilesToClean tmpfs TFL_CurrentModule $
- [ml_hi_file $ ms_location summary]
- unless (gopt Opt_KeepOFiles flags) $
- addFilesToClean tmpfs TFL_GhcSession $
- [ml_obj_file $ ms_location summary]
+ unless (gopt Opt_KeepHiFiles lcl_dflags) $
+ addFilesToClean tmpfs TFL_CurrentModule $
+ [ml_hi_file $ ms_location summary]
+ unless (gopt Opt_KeepOFiles lcl_dflags) $
+ addFilesToClean tmpfs TFL_GhcSession $
+ [ml_obj_file $ ms_location summary]
plugin_hsc_env <- initializePlugins hsc_env
let pipe_env = mkPipeEnv NoStop input_fn pipelineOutput