summaryrefslogtreecommitdiff
path: root/compiler/main/DynFlags.hs
diff options
context:
space:
mode:
authorAustin Seipp <austin@well-typed.com>2014-01-15 18:56:44 -0600
committerAustin Seipp <austin@well-typed.com>2014-01-15 19:15:28 -0600
commit3428f76e50508be4cbc85c8f72b0ad1dc784b0d4 (patch)
treed90949a56258db3d027a9678de75c0eae47f077d /compiler/main/DynFlags.hs
parent20a25b56c5cbc83add6b9611706363109edbfbc2 (diff)
downloadhaskell-3428f76e50508be4cbc85c8f72b0ad1dc784b0d4.tar.gz
Cache compiler info in DynFlags
Signed-off-by: Austin Seipp <austin@well-typed.com>
Diffstat (limited to 'compiler/main/DynFlags.hs')
-rw-r--r--compiler/main/DynFlags.hs26
1 files changed, 20 insertions, 6 deletions
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index f720db04d1..35e9c7e226 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -138,8 +138,9 @@ module DynFlags (
isAvx512fEnabled,
isAvx512pfEnabled,
- -- * Linker information
+ -- * Linker/compiler information
LinkerInfo(..),
+ CompilerInfo(..),
) where
#include "HsVersions.h"
@@ -792,7 +793,10 @@ data DynFlags = DynFlags {
avx512pf :: Bool, -- Enable AVX-512 PreFetch Instructions.
-- | Run-time linker information (what options we need, etc.)
- rtldFlags :: IORef (Maybe LinkerInfo)
+ rtldInfo :: IORef (Maybe LinkerInfo),
+
+ -- | Run-time compiler information
+ rtccInfo :: IORef (Maybe CompilerInfo)
}
class HasDynFlags m where
@@ -1270,7 +1274,8 @@ initDynFlags dflags = do
refFilesToNotIntermediateClean <- newIORef []
refGeneratedDumps <- newIORef Set.empty
refLlvmVersion <- newIORef 28
- refRtldFlags <- newIORef Nothing
+ refRtldInfo <- newIORef Nothing
+ refRtccInfo <- newIORef Nothing
wrapperNum <- newIORef emptyModuleEnv
canUseUnicodeQuotes <- do let enc = localeEncoding
str = "‛’"
@@ -1288,7 +1293,8 @@ initDynFlags dflags = do
llvmVersion = refLlvmVersion,
nextWrapperNum = wrapperNum,
useUnicodeQuotes = canUseUnicodeQuotes,
- rtldFlags = refRtldFlags
+ rtldInfo = refRtldInfo,
+ rtccInfo = refRtccInfo
}
-- | The normal 'DynFlags'. Note that they is not suitable for use in this form
@@ -1438,7 +1444,8 @@ defaultDynFlags mySettings =
avx512er = False,
avx512f = False,
avx512pf = False,
- rtldFlags = panic "defaultDynFlags: no rtldFlags"
+ rtldInfo = panic "defaultDynFlags: no rtldInfo",
+ rtccInfo = panic "defaultDynFlags: no rtccInfo"
}
defaultWays :: Settings -> [Way]
@@ -3722,7 +3729,7 @@ isAvx512pfEnabled :: DynFlags -> Bool
isAvx512pfEnabled dflags = avx512pf dflags
-- -----------------------------------------------------------------------------
--- Linker information
+-- Linker/compiler information
-- LinkerInfo contains any extra options needed by the system linker.
data LinkerInfo
@@ -3733,6 +3740,13 @@ data LinkerInfo
| UnknownLD
deriving Eq
+-- CompilerInfo tells us which C compiler we're using
+data CompilerInfo
+ = GCC
+ | Clang
+ | UnknownCC
+ deriving Eq
+
-- -----------------------------------------------------------------------------
-- RTS hooks