From 58b960d2af0ebfc37104ec68a4df377a074951dd Mon Sep 17 00:00:00 2001 From: Sylvain Henry Date: Mon, 19 Jul 2021 16:52:06 +0200 Subject: 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. --- compiler/GHC/StgToCmm.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/GHC/StgToCmm.hs') diff --git a/compiler/GHC/StgToCmm.hs b/compiler/GHC/StgToCmm.hs index 5373e3d07f..546c270f76 100644 --- a/compiler/GHC/StgToCmm.hs +++ b/compiler/GHC/StgToCmm.hs @@ -206,7 +206,7 @@ cgTopBinding logger tmpfs dflags = \case (lit,decl) = if not isNCG || asString then mkByteStringCLit label str else mkFileEmbedLit label $ unsafePerformIO $ do - bFile <- newTempName logger tmpfs dflags TFL_CurrentModule ".dat" + bFile <- newTempName logger tmpfs (tmpDir dflags) TFL_CurrentModule ".dat" BS.writeFile bFile str return bFile emitDecl decl -- cgit v1.2.1