diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2020-05-19 16:04:57 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-06-13 02:13:03 -0400 |
commit | fca2d25ff76d442d0825847643ed7448492e0e55 (patch) | |
tree | 3138fb3fb6d56f66ec39e7dcefb6ec2d6fe180df /compiler/GHC/Driver | |
parent | 8408d521a67e2af4012d886d6a7e2af02ce42add (diff) | |
download | haskell-fca2d25ff76d442d0825847643ed7448492e0e55.tar.gz |
DynFlags: add UnitConfig datatype
Avoid directly querying flags from DynFlags to build the UnitState.
Instead go via UnitConfig so that we could reuse this to make another
UnitState for plugins.
Diffstat (limited to 'compiler/GHC/Driver')
-rw-r--r-- | compiler/GHC/Driver/Session.hs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/compiler/GHC/Driver/Session.hs b/compiler/GHC/Driver/Session.hs index d363eb2410..16de0ee89a 100644 --- a/compiler/GHC/Driver/Session.hs +++ b/compiler/GHC/Driver/Session.hs @@ -1005,14 +1005,14 @@ tablesNextToCode = platformMisc_tablesNextToCode . platformMisc -- | The directory for this version of ghc in the user's app directory -- (typically something like @~/.ghc/x86_64-linux-7.6.3@) -- -versionedAppDir :: DynFlags -> MaybeT IO FilePath -versionedAppDir dflags = do +versionedAppDir :: String -> PlatformMini -> MaybeT IO FilePath +versionedAppDir appname platform = do -- Make sure we handle the case the HOME isn't set (see #11678) - appdir <- tryMaybeT $ getAppUserDataDirectory (programName dflags) - return $ appdir </> versionedFilePath dflags + appdir <- tryMaybeT $ getAppUserDataDirectory appname + return $ appdir </> versionedFilePath platform -versionedFilePath :: DynFlags -> FilePath -versionedFilePath dflags = uniqueSubdir $ platformMini $ targetPlatform dflags +versionedFilePath :: PlatformMini -> FilePath +versionedFilePath platform = uniqueSubdir platform -- | The target code type of the compilation (if any). -- |