summaryrefslogtreecommitdiff
path: root/compiler/GHC/Driver/Pipeline.hs
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2021-07-19 16:52:06 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-07-19 19:38:59 -0400
commit58b960d2af0ebfc37104ec68a4df377a074951dd (patch)
treef0fc5bf672f76ec4f032a07d8d292fb1a6eaddb1 /compiler/GHC/Driver/Pipeline.hs
parent535123e4f6505a148ccaa536c21282a87c42669c (diff)
downloadhaskell-58b960d2af0ebfc37104ec68a4df377a074951dd.tar.gz
Make TmpFs independent of DynFlags
This is small step towards #19877. We want to make the Loader/Linker interface more abstract to be easily reused (i.e. don't pass it DynFlags) but the system linker uses TmpFs which required a DynFlags value to get its temp directory. We explicitly pass the temp directory now. Similarly TmpFs was consulting the DynFlags to decide whether to clean or: this is now done by the caller in the driver code.
Diffstat (limited to 'compiler/GHC/Driver/Pipeline.hs')
-rw-r--r--compiler/GHC/Driver/Pipeline.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/GHC/Driver/Pipeline.hs b/compiler/GHC/Driver/Pipeline.hs
index cdd22b1388..26d2213a01 100644
--- a/compiler/GHC/Driver/Pipeline.hs
+++ b/compiler/GHC/Driver/Pipeline.hs
@@ -176,7 +176,7 @@ preprocess hsc_env input_fn mb_input_buf mb_phase =
Just input_buf -> do
fn <- newTempName (hsc_logger hsc_env)
(hsc_tmpfs hsc_env)
- (hsc_dflags hsc_env)
+ (tmpDir (hsc_dflags hsc_env))
TFL_CurrentModule
("buf_" ++ src_suffix pipe_env)
hdl <- openBinaryFile fn WriteMode
@@ -600,7 +600,7 @@ compileEmptyStub dflags hsc_env basename location mod_name = do
-- and https://github.com/haskell/cabal/issues/2257
let logger = hsc_logger hsc_env
let tmpfs = hsc_tmpfs hsc_env
- empty_stub <- newTempName logger tmpfs dflags TFL_CurrentModule "c"
+ empty_stub <- newTempName logger tmpfs (tmpDir dflags) TFL_CurrentModule "c"
let home_unit = hsc_home_unit hsc_env
src = text "int" <+> ppr (mkHomeModule home_unit mod_name) <+> text "= 0;"
writeFile empty_stub (showSDoc dflags (pprCode CStyle src))