[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 7 commits: ghc-experimental: expose GHC.RTS.Flags, GHC.Stats
Marge Bot (@marge-bot)
gitlab at gitlab.haskell.org
Tue Nov 26 21:39:25 UTC 2024
Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC
Commits:
53f978c0 by doyougnu at 2024-11-26T16:07:26-05:00
ghc-experimental: expose GHC.RTS.Flags, GHC.Stats
See this CLC proposal:
- https://github.com/haskell/core-libraries-committee/issues/289
and this CLC proposal for background:
- https://github.com/haskell/core-libraries-committee/issues/288
Metric Decrease:
MultiLayerModulesTH_OneShot
- - - - -
e70d4140 by Wang Xin at 2024-11-26T16:08:10-05:00
Add -mcmodel=medium moduleflag to generated LLVM IR on LoongArch platform
With the Medium code model, the jump range of the generated jump
instruction is larger than that of the Small code model. It's a
temporary fix of the problem descriped in https://gitlab.haskell
.org/ghc/ghc/-/issues/25495. This commit requires that the LLVM
used contains the code of commit 9dd1d451d9719aa91b3bdd59c0c6679
83e1baf05, i.e., version 8.0 and later. Actually we should not
rely on LLVM, so the only way to solve this problem is to implement
the LoongArch backend.
Add new type for codemodel
- - - - -
fc8e58c5 by Andreas Klebinger at 2024-11-26T16:39:01-05:00
Cmm constant folding: Narrow results to operations bitwidth.
When constant folding ensure the result is still within bounds
for the given type by explicitly narrowing the results.
Not doing so results in a lot of spurious assembler warnings
especially when testing primops.
- - - - -
14cdea0d by Ben Gamari at 2024-11-26T16:39:02-05:00
ghc-toolchain: Introduce basic flag validation
We verify that required flags (currently `--output` and `--triple`) are
provided. The implementation is truly awful, but so is getopt.
Begins to address #25500.
- - - - -
869d8805 by Ben Gamari at 2024-11-26T16:39:03-05:00
configure: Implement ld override whitelist
Bring `configure` into alignment with `ghc-toolchain`, ensuring that the
ld-override logic will only take effect on Linux and Windows.
Fixes #25501.
- - - - -
04320b03 by Ben Gamari at 2024-11-26T16:39:03-05:00
rts: Allow ExecPage to allocate anywhere in address space
Currently the ExecPage facility has two users:
* GHCi, for constructing info tables, and
* the adjustor allocation path
Despite neither of these have any spatial locality constraints ExecPage
was using the linker's `mmapAnonForLinker`, which tries hard to ensure
that mappings end up nearby the executable image. This makes adjustor
allocation needlessly subject to fragmentation concerns.
We now instead return less constrained mappings, improving the
robustness of the mechanism.
Addresses #25503.
- - - - -
3e679889 by Ben Gamari at 2024-11-26T16:39:04-05:00
base: Fix incorrect mentions of GHC.Internal.Numeric
These were incorrectly changed by the automated refactoring of the
`ghc-internal` migration.
Fixes #25521.
- - - - -
23 changed files:
- compiler/GHC/Builtin/Names.hs
- compiler/GHC/Cmm/Opt.hs
- compiler/GHC/CmmToLlvm.hs
- docs/users_guide/9.14.1-notes.rst
- libraries/base/src/Data/Char.hs
- libraries/base/src/Data/Semigroup.hs
- libraries/base/src/Prelude.hs
- libraries/ghc-experimental/ghc-experimental.cabal.in
- + libraries/ghc-experimental/src/GHC/RTS/Flags/Experimental.hs
- + libraries/ghc-experimental/src/GHC/Stats/Experimental.hs
- libraries/ghc-internal/src/GHC/Internal/Base.hs
- libraries/ghc-internal/src/GHC/Internal/Foreign/C/Types.hs
- libraries/ghc-internal/src/GHC/Internal/Read.hs
- libraries/ghc-internal/src/GHC/Internal/Real.hs
- m4/find_ld.m4
- rts/ExecPage.c
- rts/linker/MMap.c
- rts/linker/MMap.h
- + testsuite/tests/cmm/opt/T24556.cmm
- testsuite/tests/cmm/opt/all.T
- testsuite/tests/interface-stability/ghc-experimental-exports.stdout
- testsuite/tests/interface-stability/ghc-experimental-exports.stdout-mingw32
- utils/ghc-toolchain/exe/Main.hs
Changes:
=====================================
compiler/GHC/Builtin/Names.hs
=====================================
@@ -279,7 +279,7 @@ basicKnownKeyNames
-- Dynamic
toDynName,
- -- GHC.Internal.Numeric stuff
+ -- Numeric stuff
negateName, minusName, geName, eqName,
mkRationalBase2Name, mkRationalBase10Name,
=====================================
compiler/GHC/Cmm/Opt.hs
=====================================
@@ -49,6 +49,7 @@ constantFoldExprOpt e = wrapRecExpOpt f e
CmmMachOp op' args' -> fromMaybe (CmmMachOp op' args') <$> cmmMachOpFoldOptM cfg op' args'
e -> pure e
f (CmmRegOff r 0) = pure (CmmReg r)
+ f (CmmLit (CmmInt x rep)) = pure (CmmLit $ CmmInt (narrowU rep x) rep)
f e = pure e
constantFoldExpr :: Platform -> CmmExpr -> CmmExpr
@@ -88,7 +89,7 @@ cmmMachOpFoldM _ (MO_VF_Broadcast lg _w) exprs =
_ -> Nothing
cmmMachOpFoldM _ op [CmmLit (CmmInt x rep)]
= Just $! case op of
- MO_S_Neg _ -> CmmLit (CmmInt (-x) rep)
+ MO_S_Neg _ -> CmmLit (CmmInt (narrowS rep (-x)) rep)
MO_Not _ -> CmmLit (CmmInt (complement x) rep)
-- these are interesting: we must first narrow to the
@@ -164,9 +165,9 @@ cmmMachOpFoldM platform mop [CmmLit (CmmInt x xrep), CmmLit (CmmInt y _)]
MO_S_Lt _ -> Just $! CmmLit (CmmInt (if x_s < y_s then 1 else 0) (wordWidth platform))
MO_S_Le _ -> Just $! CmmLit (CmmInt (if x_s <= y_s then 1 else 0) (wordWidth platform))
- MO_Add r -> Just $! CmmLit (CmmInt (x + y) r)
- MO_Sub r -> Just $! CmmLit (CmmInt (x - y) r)
- MO_Mul r -> Just $! CmmLit (CmmInt (x * y) r)
+ MO_Add r -> Just $! CmmLit (CmmInt (narrowU r $ x + y) r)
+ MO_Sub r -> Just $! CmmLit (CmmInt (narrowS r $ x - y) r)
+ MO_Mul r -> Just $! CmmLit (CmmInt (narrowU r $ x * y) r)
MO_U_Quot r | y /= 0 -> Just $! CmmLit (CmmInt (x_u `quot` y_u) r)
MO_U_Rem r | y /= 0 -> Just $! CmmLit (CmmInt (x_u `rem` y_u) r)
MO_S_Quot r | y /= 0 -> Just $! CmmLit (CmmInt (x_s `quot` y_s) r)
@@ -176,7 +177,7 @@ cmmMachOpFoldM platform mop [CmmLit (CmmInt x xrep), CmmLit (CmmInt y _)]
MO_Or r -> Just $! CmmLit (CmmInt (x .|. y) r)
MO_Xor r -> Just $! CmmLit (CmmInt (x `xor` y) r)
- MO_Shl r -> Just $! CmmLit (CmmInt (x `shiftL` fromIntegral y) r)
+ MO_Shl r -> Just $! CmmLit (CmmInt (narrowU r $ x `shiftL` fromIntegral y) r)
MO_U_Shr r -> Just $! CmmLit (CmmInt (x_u `shiftR` fromIntegral y) r)
MO_S_Shr r -> Just $! CmmLit (CmmInt (x_s `shiftR` fromIntegral y) r)
=====================================
compiler/GHC/CmmToLlvm.hs
=====================================
@@ -221,7 +221,12 @@ cmmMetaLlvmPrelude = do
case platformArch platform of
ArchX86_64 | llvmCgAvxEnabled cfg -> [mkStackAlignmentMeta 32]
_ -> []
- module_flags_metas <- mkModuleFlagsMeta stack_alignment_metas
+ let codel_model_metas =
+ case platformArch platform of
+ -- FIXME: We should not rely on LLVM
+ ArchLoongArch64 -> [mkCodeModelMeta CMMedium]
+ _ -> []
+ module_flags_metas <- mkModuleFlagsMeta (stack_alignment_metas ++ codel_model_metas)
let metas = tbaa_metas ++ module_flags_metas
cfg <- getConfig
renderLlvm (ppLlvmMetas cfg metas)
@@ -244,6 +249,15 @@ mkStackAlignmentMeta :: Integer -> ModuleFlag
mkStackAlignmentMeta alignment =
ModuleFlag MFBError "override-stack-alignment" (MetaLit $ LMIntLit alignment i32)
+-- LLVM's @LLVM::CodeModel::Model@ enumeration
+data CodeModel = CMMedium
+
+-- Pass -mcmodel=medium option to LLVM on LoongArch64
+mkCodeModelMeta :: CodeModel -> ModuleFlag
+mkCodeModelMeta codemodel =
+ ModuleFlag MFBError "Code Model" (MetaLit $ LMIntLit n i32)
+ where
+ n = case codemodel of CMMedium -> 3 -- as of LLVM 8
-- -----------------------------------------------------------------------------
-- | Marks variables as used where necessary
=====================================
docs/users_guide/9.14.1-notes.rst
=====================================
@@ -58,6 +58,16 @@ Cmm
``ghc-experimental`` library
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+- ``ghc-experimental`` now exposes ``GHC.RTS.Flags`` and ``GHC.Stats`` as
+ ``GHC.RTS.Flags.Experimental`` and ``GHC.Stats.Experimental``. These are
+ *also* exposed in ``base``, however the ``base`` versions will be deprecated as
+ part of the split base project. See `CLC proposal 289
+ <https://github.com/haskell/core-libraries-committee/issues/289>`__.
+ Downstream consumers of these flags are encouraged to migrate to the
+ ``ghc-experimental`` versions.
+
+
+
``template-haskell`` library
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
=====================================
libraries/base/src/Data/Char.hs
=====================================
@@ -42,7 +42,7 @@ module Data.Char
, digitToInt
, intToDigit
- -- * GHC.Internal.Numeric representations
+ -- * Numeric representations
, ord
, chr
=====================================
libraries/base/src/Data/Semigroup.hs
=====================================
@@ -89,7 +89,7 @@ module Data.Semigroup (
, First(..)
, Last(..)
, WrappedMonoid(..)
- -- * Re-exported monoids from GHC.Internal.Data.Monoid
+ -- * Re-exported monoids
, Dual(..)
, Endo(..)
, All(..)
=====================================
libraries/base/src/Prelude.hs
=====================================
@@ -47,11 +47,11 @@ module Prelude (
-- ** Numbers
- -- *** GHC.Internal.Numeric types
+ -- *** Numeric types
Int, Integer, Float, Double,
Rational, Word,
- -- *** GHC.Internal.Numeric type classes
+ -- *** Numeric type classes
Num((+), (-), (*), negate, abs, signum, fromInteger),
Real(toRational),
Integral(quot, rem, div, mod, quotRem, divMod, toInteger),
@@ -63,7 +63,7 @@ module Prelude (
encodeFloat, exponent, significand, scaleFloat, isNaN,
isInfinite, isDenormalized, isIEEE, isNegativeZero, atan2),
- -- *** GHC.Internal.Numeric functions
+ -- *** Numeric functions
subtract, even, odd, gcd, lcm, (^), (^^),
fromIntegral, realToFrac,
=====================================
libraries/ghc-experimental/ghc-experimental.cabal.in
=====================================
@@ -35,6 +35,8 @@ library
GHC.Profiling.Eras
GHC.TypeLits.Experimental
GHC.TypeNats.Experimental
+ GHC.RTS.Flags.Experimental
+ GHC.Stats.Experimental
Prelude.Experimental
if arch(wasm32)
exposed-modules: GHC.Wasm.Prim
=====================================
libraries/ghc-experimental/src/GHC/RTS/Flags/Experimental.hs
=====================================
@@ -0,0 +1,54 @@
+-- |
+-- Module : GHC.RTS.Flags.Experimental
+-- Copyright : (c) The University of Glasgow, 1994-2000
+-- License : see libraries/ghc-experimental/LICENSE
+--
+-- Maintainer : ghc-devs at haskell.org
+-- Stability : internal
+-- Portability : non-portable (GHC extensions)
+--
+-- /The API of this module is unstable and is coupled to GHC's internals./ As
+-- such if you depend on it, you should expect to follow GHC's releases. This
+-- API could change without warning.
+--
+-- Descriptions of flags can be seen in
+-- <https://www.haskell.org/ghc/docs/latest/html/users_guide/runtime_control.html GHC User's Guide>,
+-- or by running RTS help message using @+RTS --help at .
+--
+--
+
+module GHC.RTS.Flags.Experimental
+ ( RtsTime
+ , RTSFlags (..)
+ , GiveGCStats (..)
+ , GCFlags (..)
+ , ConcFlags (..)
+ , MiscFlags (..)
+ , IoManagerFlag (..)
+ , DebugFlags (..)
+ , DoCostCentres (..)
+ , CCFlags (..)
+ , DoHeapProfile (..)
+ , ProfFlags (..)
+ , DoTrace (..)
+ , TraceFlags (..)
+ , TickyFlags (..)
+ , ParFlags (..)
+ , HpcFlags (..)
+ , {-# DEPRECATED "import GHC.IO.SubSystem (IoSubSystem (..))" #-}
+ IoSubSystem (..)
+ , getRTSFlags
+ , getGCFlags
+ , getConcFlags
+ , getMiscFlags
+ , getDebugFlags
+ , getCCFlags
+ , getProfFlags
+ , getTraceFlags
+ , getTickyFlags
+ , getParFlags
+ , getHpcFlags
+ ) where
+
+import GHC.Internal.RTS.Flags
+import GHC.Internal.IO.SubSystem (IoSubSystem(..))
=====================================
libraries/ghc-experimental/src/GHC/Stats/Experimental.hs
=====================================
@@ -0,0 +1,27 @@
+{-# LANGUAGE Safe #-}
+
+-- |
+-- Module : RTS.Stats.Experimental
+-- Copyright : (c) The University of Glasgow, 1994-2000
+-- License : see libraries/ghc-experimental/LICENSE
+--
+-- Maintainer : ghc-devs at haskell.org
+-- Stability : internal
+-- Portability : non-portable (GHC extensions)
+--
+-- This module provides access to internal garbage collection and
+-- memory usage statistics. These statistics are not available unless
+-- a program is run with the @-T@ RTS flag.
+--
+-- /The API of this module is unstable and is coupled to GHC's internals./ As
+-- such if you depend on it, you should expect to follow GHC's releases. This
+-- API could change without warning.
+
+module GHC.Stats.Experimental
+ ( -- * Runtime statistics
+ RTSStats(..), GCDetails(..), RtsTime
+ , getRTSStats
+ , getRTSStatsEnabled
+ ) where
+
+import GHC.Internal.Stats
=====================================
libraries/ghc-internal/src/GHC/Internal/Base.hs
=====================================
@@ -2355,7 +2355,7 @@ getTag :: forall {lev :: Levity} (a :: TYPE (BoxedRep lev))
getTag = dataToTag#
----------------------------------------------
--- GHC.Internal.Numeric primops
+-- Numeric primops
----------------------------------------------
-- Definitions of the boxed PrimOps; these will be
=====================================
libraries/ghc-internal/src/GHC/Internal/Foreign/C/Types.hs
=====================================
@@ -47,7 +47,7 @@ module GHC.Internal.Foreign.C.Types
, CLLong(..), CULLong(..), CBool(..)
, CIntPtr(..), CUIntPtr(..), CIntMax(..), CUIntMax(..)
- -- ** GHC.Internal.Numeric types
+ -- ** Numeric types
-- | These types are represented as @newtype at s of basic
-- foreign types, and are instances of
-- 'Prelude.Eq', 'Prelude.Ord', 'Prelude.Num', 'Prelude.Read',
=====================================
libraries/ghc-internal/src/GHC/Internal/Read.hs
=====================================
@@ -551,7 +551,7 @@ instance Read L.Lexeme where
readList = readListDefault
--------------------------------------------------------------
--- GHC.Internal.Numeric instances of Read
+-- Numeric instances of Read
--------------------------------------------------------------
readNumber :: Num a => (L.Lexeme -> ReadPrec a) -> ReadPrec a
=====================================
libraries/ghc-internal/src/GHC/Internal/Real.hs
=====================================
@@ -360,7 +360,7 @@ numericEnumFrom :: (Fractional a) => a -> [a]
{-# INLINE numericEnumFrom #-} -- See Note [Inline Enum method helpers] in GHC.Internal.Enum
numericEnumFrom n = go 0
where
- -- See Note [GHC.Internal.Numeric Stability of Enumerating Floating Numbers]
+ -- See Note [Numeric Stability of Enumerating Floating Numbers]
go !k = let !n' = n + k
in n' : go (k + 1)
@@ -369,7 +369,7 @@ numericEnumFromThen :: (Fractional a) => a -> a -> [a]
numericEnumFromThen n m = go 0
where
step = m - n
- -- See Note [GHC.Internal.Numeric Stability of Enumerating Floating Numbers]
+ -- See Note [Numeric Stability of Enumerating Floating Numbers]
go !k = let !n' = n + k * step
in n' : go (k + 1)
@@ -386,7 +386,7 @@ numericEnumFromThenTo e1 e2 !e3
!predicate | e2 >= e1 = (<= e3 + mid)
| otherwise = (>= e3 + mid)
-{- Note [GHC.Internal.Numeric Stability of Enumerating Floating Numbers]
+{- Note [Numeric Stability of Enumerating Floating Numbers]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When enumerate floating numbers, we could add the increment to the last number
at every run (as what we did previously):
=====================================
m4/find_ld.m4
=====================================
@@ -79,13 +79,16 @@ AC_DEFUN([FIND_LD],[
dnl See #21712.
AC_CHECK_TARGET_TOOL([LD], [ld])
;;
- *)
+ *-linux|*-mingw32)
if test "x$enable_ld_override" = "xyes"; then
find_ld
else
AC_CHECK_TARGET_TOOL([LD], [ld])
fi
;;
+ *)
+ AC_CHECK_TARGET_TOOL([LD], [ld])
+ ;;
esac
CHECK_LD_COPY_BUG([$1])
])
=====================================
rts/ExecPage.c
=====================================
@@ -10,7 +10,7 @@
#include "linker/MMap.h"
ExecPage *allocateExecPage(void) {
- ExecPage *page = (ExecPage *) mmapAnonForLinker(getPageSize());
+ ExecPage *page = (ExecPage *) mmapAnon(getPageSize());
return page;
}
=====================================
rts/linker/MMap.c
=====================================
@@ -207,6 +207,12 @@ memoryAccessToProt(MemoryAccess access)
}
}
+void *
+mmapAnon (size_t bytes)
+{
+ return VirtualAlloc(NULL, bytes, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
+}
+
//
// Returns NULL on failure.
//
@@ -410,6 +416,15 @@ mmapForLinker (size_t bytes, MemoryAccess access, uint32_t flags, int fd, int of
return result;
}
+/*
+ * Map read/write pages anywhere in memory. Returns NULL on failure.
+ */
+void *
+mmapAnon (size_t bytes)
+{
+ return mmapAnywhere(bytes, MEM_READ_WRITE_THEN_READ_EXECUTE, MAP_ANONYMOUS, -1, 0);
+}
+
/*
* Map read/write pages in low memory. Returns NULL on failure.
*/
=====================================
rts/linker/MMap.h
=====================================
@@ -64,7 +64,11 @@ typedef enum {
extern void *mmap_32bit_base;
-// Map read/write anonymous memory.
+// Map read/write anonymous memory anywhere in memory.
+void *mmapAnon(size_t bytes);
+
+// Map read/write anonymous memory, enforcing the constraint of
+// placing the mapping within 4GB of the executable image.
void *mmapAnonForLinker (size_t bytes);
// Change protection of previous mapping memory.
=====================================
testsuite/tests/cmm/opt/T24556.cmm
=====================================
@@ -0,0 +1,12 @@
+#include "Cmm.h"
+
+func(W_ buffer) {
+ I8[buffer] = %lobits8(255 + 45);
+ I8[buffer+(1)] = %lobits8(310 - 10);
+ I8[buffer+(2)] = %lobits8(30 * 10);
+ I8[buffer+(3)] = %lobits8(150 << 1);
+ // This one comes from test-primops
+ I64[buffer+(4)] = %zx64(((1 :: bits16) & ((1 :: bits16) & (((516 :: bits16) * (154 :: bits16)) + bits16[buffer + (0 :: W_)]))));
+ return(1);
+}
+
=====================================
testsuite/tests/cmm/opt/all.T
=====================================
@@ -3,3 +3,8 @@
test('T15188', cmm_src, makefile_test, [])
test('T18141', normal, compile, [''])
test('T20142', normal, compile, [''])
+
+# Cmm opt should not produce oversized literals in the assembly output.
+# We check this by telling the assembler to exit on warnings.
+test('T24556', [only_ways('optasm'), cmm_src], compile, ['-O -opta -Xassembler -opta --fatal-warnings'])
+
=====================================
testsuite/tests/interface-stability/ghc-experimental-exports.stdout
=====================================
@@ -6155,6 +6155,157 @@ module GHC.Profiling.Eras where
incrementUserEra :: GHC.Types.Word -> GHC.Types.IO GHC.Types.Word
setUserEra :: GHC.Types.Word -> GHC.Types.IO ()
+module GHC.RTS.Flags.Experimental where
+ -- Safety: None
+ type CCFlags :: *
+ data CCFlags = CCFlags {doCostCentres :: DoCostCentres, profilerTicks :: GHC.Types.Int, msecsPerTick :: GHC.Types.Int}
+ type ConcFlags :: *
+ data ConcFlags = ConcFlags {ctxtSwitchTime :: RtsTime, ctxtSwitchTicks :: GHC.Types.Int}
+ type DebugFlags :: *
+ data DebugFlags = DebugFlags {scheduler :: GHC.Types.Bool, interpreter :: GHC.Types.Bool, weak :: GHC.Types.Bool, gccafs :: GHC.Types.Bool, gc :: GHC.Types.Bool, nonmoving_gc :: GHC.Types.Bool, block_alloc :: GHC.Types.Bool, sanity :: GHC.Types.Bool, stable :: GHC.Types.Bool, prof :: GHC.Types.Bool, linker :: GHC.Types.Bool, apply :: GHC.Types.Bool, stm :: GHC.Types.Bool, squeeze :: GHC.Types.Bool, hpc :: GHC.Types.Bool, sparks :: GHC.Types.Bool}
+ type DoCostCentres :: *
+ data DoCostCentres = CostCentresNone | CostCentresSummary | CostCentresVerbose | CostCentresAll | CostCentresJSON
+ type DoHeapProfile :: *
+ data DoHeapProfile = NoHeapProfiling | HeapByCCS | HeapByMod | HeapByDescr | HeapByType | HeapByRetainer | HeapByLDV | HeapByClosureType | HeapByInfoTable | HeapByEra
+ type DoTrace :: *
+ data DoTrace = TraceNone | TraceEventLog | TraceStderr
+ type GCFlags :: *
+ data GCFlags
+ = GCFlags {statsFile :: GHC.Internal.Maybe.Maybe GHC.Internal.IO.FilePath,
+ giveStats :: GiveGCStats,
+ maxStkSize :: GHC.Internal.Word.Word32,
+ initialStkSize :: GHC.Internal.Word.Word32,
+ stkChunkSize :: GHC.Internal.Word.Word32,
+ stkChunkBufferSize :: GHC.Internal.Word.Word32,
+ maxHeapSize :: GHC.Internal.Word.Word32,
+ minAllocAreaSize :: GHC.Internal.Word.Word32,
+ largeAllocLim :: GHC.Internal.Word.Word32,
+ nurseryChunkSize :: GHC.Internal.Word.Word32,
+ minOldGenSize :: GHC.Internal.Word.Word32,
+ heapSizeSuggestion :: GHC.Internal.Word.Word32,
+ heapSizeSuggestionAuto :: GHC.Types.Bool,
+ oldGenFactor :: GHC.Types.Double,
+ returnDecayFactor :: GHC.Types.Double,
+ pcFreeHeap :: GHC.Types.Double,
+ generations :: GHC.Internal.Word.Word32,
+ squeezeUpdFrames :: GHC.Types.Bool,
+ compact :: GHC.Types.Bool,
+ compactThreshold :: GHC.Types.Double,
+ sweep :: GHC.Types.Bool,
+ ringBell :: GHC.Types.Bool,
+ idleGCDelayTime :: RtsTime,
+ doIdleGC :: GHC.Types.Bool,
+ heapBase :: GHC.Types.Word,
+ allocLimitGrace :: GHC.Types.Word,
+ numa :: GHC.Types.Bool,
+ numaMask :: GHC.Types.Word}
+ type GiveGCStats :: *
+ data GiveGCStats = NoGCStats | CollectGCStats | OneLineGCStats | SummaryGCStats | VerboseGCStats
+ type HpcFlags :: *
+ data HpcFlags = HpcFlags {readTixFile :: GHC.Types.Bool, writeTixFile :: GHC.Types.Bool}
+ type IoManagerFlag :: *
+ data IoManagerFlag = IoManagerFlagAuto | IoManagerFlagSelect | IoManagerFlagMIO | IoManagerFlagWinIO | IoManagerFlagWin32Legacy
+ type IoSubSystem :: *
+ data IoSubSystem = IoPOSIX | IoNative
+ type MiscFlags :: *
+ data MiscFlags = MiscFlags {tickInterval :: RtsTime, installSignalHandlers :: GHC.Types.Bool, installSEHHandlers :: GHC.Types.Bool, generateCrashDumpFile :: GHC.Types.Bool, generateStackTrace :: GHC.Types.Bool, machineReadable :: GHC.Types.Bool, disableDelayedOsMemoryReturn :: GHC.Types.Bool, internalCounters :: GHC.Types.Bool, linkerAlwaysPic :: GHC.Types.Bool, linkerMemBase :: GHC.Types.Word, ioManager :: IoManagerFlag, numIoWorkerThreads :: GHC.Internal.Word.Word32}
+ type ParFlags :: *
+ data ParFlags = ParFlags {nCapabilities :: GHC.Internal.Word.Word32, migrate :: GHC.Types.Bool, maxLocalSparks :: GHC.Internal.Word.Word32, parGcEnabled :: GHC.Types.Bool, parGcGen :: GHC.Internal.Word.Word32, parGcLoadBalancingEnabled :: GHC.Types.Bool, parGcLoadBalancingGen :: GHC.Internal.Word.Word32, parGcNoSyncWithIdle :: GHC.Internal.Word.Word32, parGcThreads :: GHC.Internal.Word.Word32, setAffinity :: GHC.Types.Bool}
+ type ProfFlags :: *
+ data ProfFlags
+ = ProfFlags {doHeapProfile :: DoHeapProfile,
+ heapProfileInterval :: RtsTime,
+ heapProfileIntervalTicks :: GHC.Types.Word,
+ startHeapProfileAtStartup :: GHC.Types.Bool,
+ startTimeProfileAtStartup :: GHC.Types.Bool,
+ showCCSOnException :: GHC.Types.Bool,
+ automaticEraIncrement :: GHC.Types.Bool,
+ maxRetainerSetSize :: GHC.Types.Word,
+ ccsLength :: GHC.Types.Word,
+ modSelector :: GHC.Internal.Maybe.Maybe GHC.Internal.Base.String,
+ descrSelector :: GHC.Internal.Maybe.Maybe GHC.Internal.Base.String,
+ typeSelector :: GHC.Internal.Maybe.Maybe GHC.Internal.Base.String,
+ ccSelector :: GHC.Internal.Maybe.Maybe GHC.Internal.Base.String,
+ ccsSelector :: GHC.Internal.Maybe.Maybe GHC.Internal.Base.String,
+ retainerSelector :: GHC.Internal.Maybe.Maybe GHC.Internal.Base.String,
+ bioSelector :: GHC.Internal.Maybe.Maybe GHC.Internal.Base.String,
+ eraSelector :: GHC.Types.Word}
+ type RTSFlags :: *
+ data RTSFlags = RTSFlags {gcFlags :: GCFlags, concurrentFlags :: ConcFlags, miscFlags :: MiscFlags, debugFlags :: DebugFlags, costCentreFlags :: CCFlags, profilingFlags :: ProfFlags, traceFlags :: TraceFlags, tickyFlags :: TickyFlags, parFlags :: ParFlags, hpcFlags :: HpcFlags}
+ type RtsTime :: *
+ type RtsTime = GHC.Internal.Word.Word64
+ type TickyFlags :: *
+ data TickyFlags = TickyFlags {showTickyStats :: GHC.Types.Bool, tickyFile :: GHC.Internal.Maybe.Maybe GHC.Internal.IO.FilePath}
+ type TraceFlags :: *
+ data TraceFlags = TraceFlags {tracing :: DoTrace, timestamp :: GHC.Types.Bool, traceScheduler :: GHC.Types.Bool, traceGc :: GHC.Types.Bool, traceNonmovingGc :: GHC.Types.Bool, sparksSampled :: GHC.Types.Bool, sparksFull :: GHC.Types.Bool, user :: GHC.Types.Bool}
+ getCCFlags :: GHC.Types.IO CCFlags
+ getConcFlags :: GHC.Types.IO ConcFlags
+ getDebugFlags :: GHC.Types.IO DebugFlags
+ getGCFlags :: GHC.Types.IO GCFlags
+ getHpcFlags :: GHC.Types.IO HpcFlags
+ getMiscFlags :: GHC.Types.IO MiscFlags
+ getParFlags :: GHC.Types.IO ParFlags
+ getProfFlags :: GHC.Types.IO ProfFlags
+ getRTSFlags :: GHC.Types.IO RTSFlags
+ getTickyFlags :: GHC.Types.IO TickyFlags
+ getTraceFlags :: GHC.Types.IO TraceFlags
+
+module GHC.Stats.Experimental where
+ -- Safety: Safe
+ type GCDetails :: *
+ data GCDetails
+ = GCDetails {gcdetails_gen :: GHC.Internal.Word.Word32,
+ gcdetails_threads :: GHC.Internal.Word.Word32,
+ gcdetails_allocated_bytes :: GHC.Internal.Word.Word64,
+ gcdetails_live_bytes :: GHC.Internal.Word.Word64,
+ gcdetails_large_objects_bytes :: GHC.Internal.Word.Word64,
+ gcdetails_compact_bytes :: GHC.Internal.Word.Word64,
+ gcdetails_slop_bytes :: GHC.Internal.Word.Word64,
+ gcdetails_mem_in_use_bytes :: GHC.Internal.Word.Word64,
+ gcdetails_copied_bytes :: GHC.Internal.Word.Word64,
+ gcdetails_par_max_copied_bytes :: GHC.Internal.Word.Word64,
+ gcdetails_par_balanced_copied_bytes :: GHC.Internal.Word.Word64,
+ gcdetails_block_fragmentation_bytes :: GHC.Internal.Word.Word64,
+ gcdetails_sync_elapsed_ns :: RtsTime,
+ gcdetails_cpu_ns :: RtsTime,
+ gcdetails_elapsed_ns :: RtsTime,
+ gcdetails_nonmoving_gc_sync_cpu_ns :: RtsTime,
+ gcdetails_nonmoving_gc_sync_elapsed_ns :: RtsTime}
+ type RTSStats :: *
+ data RTSStats
+ = RTSStats {gcs :: GHC.Internal.Word.Word32,
+ major_gcs :: GHC.Internal.Word.Word32,
+ allocated_bytes :: GHC.Internal.Word.Word64,
+ max_live_bytes :: GHC.Internal.Word.Word64,
+ max_large_objects_bytes :: GHC.Internal.Word.Word64,
+ max_compact_bytes :: GHC.Internal.Word.Word64,
+ max_slop_bytes :: GHC.Internal.Word.Word64,
+ max_mem_in_use_bytes :: GHC.Internal.Word.Word64,
+ cumulative_live_bytes :: GHC.Internal.Word.Word64,
+ copied_bytes :: GHC.Internal.Word.Word64,
+ par_copied_bytes :: GHC.Internal.Word.Word64,
+ cumulative_par_max_copied_bytes :: GHC.Internal.Word.Word64,
+ cumulative_par_balanced_copied_bytes :: GHC.Internal.Word.Word64,
+ init_cpu_ns :: RtsTime,
+ init_elapsed_ns :: RtsTime,
+ mutator_cpu_ns :: RtsTime,
+ mutator_elapsed_ns :: RtsTime,
+ gc_cpu_ns :: RtsTime,
+ gc_elapsed_ns :: RtsTime,
+ cpu_ns :: RtsTime,
+ elapsed_ns :: RtsTime,
+ nonmoving_gc_sync_cpu_ns :: RtsTime,
+ nonmoving_gc_sync_elapsed_ns :: RtsTime,
+ nonmoving_gc_sync_max_elapsed_ns :: RtsTime,
+ nonmoving_gc_cpu_ns :: RtsTime,
+ nonmoving_gc_elapsed_ns :: RtsTime,
+ nonmoving_gc_max_elapsed_ns :: RtsTime,
+ gc :: GCDetails}
+ type RtsTime :: *
+ type RtsTime = GHC.Internal.Int.Int64
+ getRTSStats :: GHC.Types.IO RTSStats
+ getRTSStatsEnabled :: GHC.Types.IO GHC.Types.Bool
+
module GHC.TypeLits.Experimental where
-- Safety: Safe-Inferred
appendSSymbol :: forall (a :: GHC.Types.Symbol) (b :: GHC.Types.Symbol). GHC.Internal.TypeLits.SSymbol a -> GHC.Internal.TypeLits.SSymbol b -> GHC.Internal.TypeLits.SSymbol (GHC.Internal.TypeLits.AppendSymbol a b)
@@ -10558,9 +10709,31 @@ instance forall a. GHC.Internal.Data.String.IsString a => GHC.Internal.Data.Stri
instance forall a. (a ~ GHC.Types.Char) => GHC.Internal.Data.String.IsString [a] -- Defined in ‘GHC.Internal.Data.String’
instance forall a. GHC.Internal.Enum.Bounded a => GHC.Internal.Enum.Bounded (GHC.Internal.Data.Ord.Down a) -- Defined in ‘GHC.Internal.Data.Ord’
instance forall a. (GHC.Internal.Enum.Enum a, GHC.Internal.Enum.Bounded a, GHC.Classes.Eq a) => GHC.Internal.Enum.Enum (GHC.Internal.Data.Ord.Down a) -- Defined in ‘GHC.Internal.Data.Ord’
+instance GHC.Internal.Enum.Enum GHC.Internal.RTS.Flags.DoCostCentres -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Enum.Enum GHC.Internal.RTS.Flags.DoHeapProfile -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Enum.Enum GHC.Internal.RTS.Flags.DoTrace -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Enum.Enum GHC.Internal.RTS.Flags.GiveGCStats -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Enum.Enum GHC.Internal.RTS.Flags.IoManagerFlag -- Defined in ‘GHC.Internal.RTS.Flags’
instance forall a. GHC.Internal.Float.Floating a => GHC.Internal.Float.Floating (GHC.Internal.Data.Ord.Down a) -- Defined in ‘GHC.Internal.Data.Ord’
instance forall a. GHC.Internal.Float.RealFloat a => GHC.Internal.Float.RealFloat (GHC.Internal.Data.Ord.Down a) -- Defined in ‘GHC.Internal.Data.Ord’
instance forall a. GHC.Internal.Foreign.Storable.Storable a => GHC.Internal.Foreign.Storable.Storable (GHC.Internal.Data.Ord.Down a) -- Defined in ‘GHC.Internal.Data.Ord’
+instance GHC.Internal.Generics.Generic GHC.Internal.RTS.Flags.CCFlags -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Generics.Generic GHC.Internal.RTS.Flags.ConcFlags -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Generics.Generic GHC.Internal.RTS.Flags.DebugFlags -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Generics.Generic GHC.Internal.RTS.Flags.DoCostCentres -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Generics.Generic GHC.Internal.RTS.Flags.DoHeapProfile -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Generics.Generic GHC.Internal.RTS.Flags.DoTrace -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Generics.Generic GHC.Internal.RTS.Flags.GCFlags -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Generics.Generic GHC.Internal.RTS.Flags.GiveGCStats -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Generics.Generic GHC.Internal.RTS.Flags.HpcFlags -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Generics.Generic GHC.Internal.RTS.Flags.MiscFlags -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Generics.Generic GHC.Internal.RTS.Flags.ParFlags -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Generics.Generic GHC.Internal.RTS.Flags.ProfFlags -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Generics.Generic GHC.Internal.RTS.Flags.RTSFlags -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Generics.Generic GHC.Internal.RTS.Flags.TickyFlags -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Generics.Generic GHC.Internal.RTS.Flags.TraceFlags -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Generics.Generic GHC.Internal.Stats.GCDetails -- Defined in ‘GHC.Internal.Stats’
+instance GHC.Internal.Generics.Generic GHC.Internal.Stats.RTSStats -- Defined in ‘GHC.Internal.Stats’
instance GHC.Internal.IsList.IsList GHC.Internal.Stack.Types.CallStack -- Defined in ‘GHC.Internal.IsList’
instance forall a. GHC.Internal.IsList.IsList [a] -- Defined in ‘GHC.Internal.IsList’
instance forall a. GHC.Internal.IsList.IsList (GHC.Internal.Base.NonEmpty a) -- Defined in ‘GHC.Internal.IsList’
@@ -10569,6 +10742,8 @@ instance forall a. GHC.Internal.IsList.IsList (GHC.Internal.Functor.ZipList.ZipL
instance forall a. GHC.Internal.Ix.Ix a => GHC.Internal.Ix.Ix (GHC.Internal.Data.Ord.Down a) -- Defined in ‘GHC.Internal.Data.Ord’
instance forall a. GHC.Internal.Num.Num a => GHC.Internal.Num.Num (GHC.Internal.Data.Ord.Down a) -- Defined in ‘GHC.Internal.Data.Ord’
instance forall a. GHC.Internal.Read.Read a => GHC.Internal.Read.Read (GHC.Internal.Data.Ord.Down a) -- Defined in ‘GHC.Internal.Data.Ord’
+instance GHC.Internal.Read.Read GHC.Internal.Stats.GCDetails -- Defined in ‘GHC.Internal.Stats’
+instance GHC.Internal.Read.Read GHC.Internal.Stats.RTSStats -- Defined in ‘GHC.Internal.Stats’
instance forall a. GHC.Internal.Real.Fractional a => GHC.Internal.Real.Fractional (GHC.Internal.Data.Ord.Down a) -- Defined in ‘GHC.Internal.Data.Ord’
instance forall a. GHC.Internal.Real.Real a => GHC.Internal.Real.Real (GHC.Internal.Data.Ord.Down a) -- Defined in ‘GHC.Internal.Data.Ord’
instance forall a. GHC.Internal.Real.RealFrac a => GHC.Internal.Real.RealFrac (GHC.Internal.Data.Ord.Down a) -- Defined in ‘GHC.Internal.Data.Ord’
@@ -10576,6 +10751,24 @@ instance forall a. GHC.Internal.Show.Show a => GHC.Internal.Show.Show (GHC.Inter
instance forall a. GHC.Internal.Show.Show (GHC.Internal.Ptr.FunPtr a) -- Defined in ‘GHC.Internal.Ptr’
instance forall a. GHC.Internal.Show.Show (GHC.Internal.Ptr.Ptr a) -- Defined in ‘GHC.Internal.Ptr’
instance GHC.Internal.Show.Show GHC.Internal.IO.MaskingState -- Defined in ‘GHC.Internal.IO’
+instance GHC.Internal.Show.Show GHC.Internal.RTS.Flags.CCFlags -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Show.Show GHC.Internal.RTS.Flags.ConcFlags -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Show.Show GHC.Internal.RTS.Flags.DebugFlags -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Show.Show GHC.Internal.RTS.Flags.DoCostCentres -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Show.Show GHC.Internal.RTS.Flags.DoHeapProfile -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Show.Show GHC.Internal.RTS.Flags.DoTrace -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Show.Show GHC.Internal.RTS.Flags.GCFlags -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Show.Show GHC.Internal.RTS.Flags.GiveGCStats -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Show.Show GHC.Internal.RTS.Flags.HpcFlags -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Show.Show GHC.Internal.RTS.Flags.IoManagerFlag -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Show.Show GHC.Internal.RTS.Flags.MiscFlags -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Show.Show GHC.Internal.RTS.Flags.ParFlags -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Show.Show GHC.Internal.RTS.Flags.ProfFlags -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Show.Show GHC.Internal.RTS.Flags.RTSFlags -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Show.Show GHC.Internal.RTS.Flags.TickyFlags -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Show.Show GHC.Internal.RTS.Flags.TraceFlags -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Show.Show GHC.Internal.Stats.GCDetails -- Defined in ‘GHC.Internal.Stats’
+instance GHC.Internal.Show.Show GHC.Internal.Stats.RTSStats -- Defined in ‘GHC.Internal.Stats’
instance GHC.Classes.Eq GHC.Types.Bool -- Defined in ‘GHC.Classes’
instance GHC.Classes.Eq GHC.Types.Char -- Defined in ‘GHC.Classes’
instance GHC.Classes.Eq GHC.Types.Double -- Defined in ‘GHC.Classes’
@@ -10610,6 +10803,8 @@ instance forall a. GHC.Classes.Eq (GHC.Internal.Ptr.Ptr a) -- Defined in ‘GHC.
instance forall a. GHC.Classes.Eq a => GHC.Classes.Eq (GHC.Internal.Base.NonEmpty a) -- Defined in ‘GHC.Internal.Base’
instance GHC.Classes.Eq GHC.Internal.Base.Void -- Defined in ‘GHC.Internal.Base’
instance GHC.Classes.Eq GHC.Internal.IO.MaskingState -- Defined in ‘GHC.Internal.IO’
+instance GHC.Classes.Eq GHC.Internal.RTS.Flags.IoManagerFlag -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Classes.Eq GHC.Internal.IO.SubSystem.IoSubSystem -- Defined in ‘GHC.Internal.IO.SubSystem’
instance GHC.Classes.Ord GHC.Types.Bool -- Defined in ‘GHC.Classes’
instance GHC.Classes.Ord GHC.Types.Char -- Defined in ‘GHC.Classes’
instance GHC.Classes.Ord GHC.Types.Double -- Defined in ‘GHC.Classes’
=====================================
testsuite/tests/interface-stability/ghc-experimental-exports.stdout-mingw32
=====================================
@@ -6158,6 +6158,157 @@ module GHC.Profiling.Eras where
incrementUserEra :: GHC.Types.Word -> GHC.Types.IO GHC.Types.Word
setUserEra :: GHC.Types.Word -> GHC.Types.IO ()
+module GHC.RTS.Flags.Experimental where
+ -- Safety: None
+ type CCFlags :: *
+ data CCFlags = CCFlags {doCostCentres :: DoCostCentres, profilerTicks :: GHC.Types.Int, msecsPerTick :: GHC.Types.Int}
+ type ConcFlags :: *
+ data ConcFlags = ConcFlags {ctxtSwitchTime :: RtsTime, ctxtSwitchTicks :: GHC.Types.Int}
+ type DebugFlags :: *
+ data DebugFlags = DebugFlags {scheduler :: GHC.Types.Bool, interpreter :: GHC.Types.Bool, weak :: GHC.Types.Bool, gccafs :: GHC.Types.Bool, gc :: GHC.Types.Bool, nonmoving_gc :: GHC.Types.Bool, block_alloc :: GHC.Types.Bool, sanity :: GHC.Types.Bool, stable :: GHC.Types.Bool, prof :: GHC.Types.Bool, linker :: GHC.Types.Bool, apply :: GHC.Types.Bool, stm :: GHC.Types.Bool, squeeze :: GHC.Types.Bool, hpc :: GHC.Types.Bool, sparks :: GHC.Types.Bool}
+ type DoCostCentres :: *
+ data DoCostCentres = CostCentresNone | CostCentresSummary | CostCentresVerbose | CostCentresAll | CostCentresJSON
+ type DoHeapProfile :: *
+ data DoHeapProfile = NoHeapProfiling | HeapByCCS | HeapByMod | HeapByDescr | HeapByType | HeapByRetainer | HeapByLDV | HeapByClosureType | HeapByInfoTable | HeapByEra
+ type DoTrace :: *
+ data DoTrace = TraceNone | TraceEventLog | TraceStderr
+ type GCFlags :: *
+ data GCFlags
+ = GCFlags {statsFile :: GHC.Internal.Maybe.Maybe GHC.Internal.IO.FilePath,
+ giveStats :: GiveGCStats,
+ maxStkSize :: GHC.Internal.Word.Word32,
+ initialStkSize :: GHC.Internal.Word.Word32,
+ stkChunkSize :: GHC.Internal.Word.Word32,
+ stkChunkBufferSize :: GHC.Internal.Word.Word32,
+ maxHeapSize :: GHC.Internal.Word.Word32,
+ minAllocAreaSize :: GHC.Internal.Word.Word32,
+ largeAllocLim :: GHC.Internal.Word.Word32,
+ nurseryChunkSize :: GHC.Internal.Word.Word32,
+ minOldGenSize :: GHC.Internal.Word.Word32,
+ heapSizeSuggestion :: GHC.Internal.Word.Word32,
+ heapSizeSuggestionAuto :: GHC.Types.Bool,
+ oldGenFactor :: GHC.Types.Double,
+ returnDecayFactor :: GHC.Types.Double,
+ pcFreeHeap :: GHC.Types.Double,
+ generations :: GHC.Internal.Word.Word32,
+ squeezeUpdFrames :: GHC.Types.Bool,
+ compact :: GHC.Types.Bool,
+ compactThreshold :: GHC.Types.Double,
+ sweep :: GHC.Types.Bool,
+ ringBell :: GHC.Types.Bool,
+ idleGCDelayTime :: RtsTime,
+ doIdleGC :: GHC.Types.Bool,
+ heapBase :: GHC.Types.Word,
+ allocLimitGrace :: GHC.Types.Word,
+ numa :: GHC.Types.Bool,
+ numaMask :: GHC.Types.Word}
+ type GiveGCStats :: *
+ data GiveGCStats = NoGCStats | CollectGCStats | OneLineGCStats | SummaryGCStats | VerboseGCStats
+ type HpcFlags :: *
+ data HpcFlags = HpcFlags {readTixFile :: GHC.Types.Bool, writeTixFile :: GHC.Types.Bool}
+ type IoManagerFlag :: *
+ data IoManagerFlag = IoManagerFlagAuto | IoManagerFlagSelect | IoManagerFlagMIO | IoManagerFlagWinIO | IoManagerFlagWin32Legacy
+ type IoSubSystem :: *
+ data IoSubSystem = IoPOSIX | IoNative
+ type MiscFlags :: *
+ data MiscFlags = MiscFlags {tickInterval :: RtsTime, installSignalHandlers :: GHC.Types.Bool, installSEHHandlers :: GHC.Types.Bool, generateCrashDumpFile :: GHC.Types.Bool, generateStackTrace :: GHC.Types.Bool, machineReadable :: GHC.Types.Bool, disableDelayedOsMemoryReturn :: GHC.Types.Bool, internalCounters :: GHC.Types.Bool, linkerAlwaysPic :: GHC.Types.Bool, linkerMemBase :: GHC.Types.Word, ioManager :: IoManagerFlag, numIoWorkerThreads :: GHC.Internal.Word.Word32}
+ type ParFlags :: *
+ data ParFlags = ParFlags {nCapabilities :: GHC.Internal.Word.Word32, migrate :: GHC.Types.Bool, maxLocalSparks :: GHC.Internal.Word.Word32, parGcEnabled :: GHC.Types.Bool, parGcGen :: GHC.Internal.Word.Word32, parGcLoadBalancingEnabled :: GHC.Types.Bool, parGcLoadBalancingGen :: GHC.Internal.Word.Word32, parGcNoSyncWithIdle :: GHC.Internal.Word.Word32, parGcThreads :: GHC.Internal.Word.Word32, setAffinity :: GHC.Types.Bool}
+ type ProfFlags :: *
+ data ProfFlags
+ = ProfFlags {doHeapProfile :: DoHeapProfile,
+ heapProfileInterval :: RtsTime,
+ heapProfileIntervalTicks :: GHC.Types.Word,
+ startHeapProfileAtStartup :: GHC.Types.Bool,
+ startTimeProfileAtStartup :: GHC.Types.Bool,
+ showCCSOnException :: GHC.Types.Bool,
+ automaticEraIncrement :: GHC.Types.Bool,
+ maxRetainerSetSize :: GHC.Types.Word,
+ ccsLength :: GHC.Types.Word,
+ modSelector :: GHC.Internal.Maybe.Maybe GHC.Internal.Base.String,
+ descrSelector :: GHC.Internal.Maybe.Maybe GHC.Internal.Base.String,
+ typeSelector :: GHC.Internal.Maybe.Maybe GHC.Internal.Base.String,
+ ccSelector :: GHC.Internal.Maybe.Maybe GHC.Internal.Base.String,
+ ccsSelector :: GHC.Internal.Maybe.Maybe GHC.Internal.Base.String,
+ retainerSelector :: GHC.Internal.Maybe.Maybe GHC.Internal.Base.String,
+ bioSelector :: GHC.Internal.Maybe.Maybe GHC.Internal.Base.String,
+ eraSelector :: GHC.Types.Word}
+ type RTSFlags :: *
+ data RTSFlags = RTSFlags {gcFlags :: GCFlags, concurrentFlags :: ConcFlags, miscFlags :: MiscFlags, debugFlags :: DebugFlags, costCentreFlags :: CCFlags, profilingFlags :: ProfFlags, traceFlags :: TraceFlags, tickyFlags :: TickyFlags, parFlags :: ParFlags, hpcFlags :: HpcFlags}
+ type RtsTime :: *
+ type RtsTime = GHC.Internal.Word.Word64
+ type TickyFlags :: *
+ data TickyFlags = TickyFlags {showTickyStats :: GHC.Types.Bool, tickyFile :: GHC.Internal.Maybe.Maybe GHC.Internal.IO.FilePath}
+ type TraceFlags :: *
+ data TraceFlags = TraceFlags {tracing :: DoTrace, timestamp :: GHC.Types.Bool, traceScheduler :: GHC.Types.Bool, traceGc :: GHC.Types.Bool, traceNonmovingGc :: GHC.Types.Bool, sparksSampled :: GHC.Types.Bool, sparksFull :: GHC.Types.Bool, user :: GHC.Types.Bool}
+ getCCFlags :: GHC.Types.IO CCFlags
+ getConcFlags :: GHC.Types.IO ConcFlags
+ getDebugFlags :: GHC.Types.IO DebugFlags
+ getGCFlags :: GHC.Types.IO GCFlags
+ getHpcFlags :: GHC.Types.IO HpcFlags
+ getMiscFlags :: GHC.Types.IO MiscFlags
+ getParFlags :: GHC.Types.IO ParFlags
+ getProfFlags :: GHC.Types.IO ProfFlags
+ getRTSFlags :: GHC.Types.IO RTSFlags
+ getTickyFlags :: GHC.Types.IO TickyFlags
+ getTraceFlags :: GHC.Types.IO TraceFlags
+
+module GHC.Stats.Experimental where
+ -- Safety: Safe
+ type GCDetails :: *
+ data GCDetails
+ = GCDetails {gcdetails_gen :: GHC.Internal.Word.Word32,
+ gcdetails_threads :: GHC.Internal.Word.Word32,
+ gcdetails_allocated_bytes :: GHC.Internal.Word.Word64,
+ gcdetails_live_bytes :: GHC.Internal.Word.Word64,
+ gcdetails_large_objects_bytes :: GHC.Internal.Word.Word64,
+ gcdetails_compact_bytes :: GHC.Internal.Word.Word64,
+ gcdetails_slop_bytes :: GHC.Internal.Word.Word64,
+ gcdetails_mem_in_use_bytes :: GHC.Internal.Word.Word64,
+ gcdetails_copied_bytes :: GHC.Internal.Word.Word64,
+ gcdetails_par_max_copied_bytes :: GHC.Internal.Word.Word64,
+ gcdetails_par_balanced_copied_bytes :: GHC.Internal.Word.Word64,
+ gcdetails_block_fragmentation_bytes :: GHC.Internal.Word.Word64,
+ gcdetails_sync_elapsed_ns :: RtsTime,
+ gcdetails_cpu_ns :: RtsTime,
+ gcdetails_elapsed_ns :: RtsTime,
+ gcdetails_nonmoving_gc_sync_cpu_ns :: RtsTime,
+ gcdetails_nonmoving_gc_sync_elapsed_ns :: RtsTime}
+ type RTSStats :: *
+ data RTSStats
+ = RTSStats {gcs :: GHC.Internal.Word.Word32,
+ major_gcs :: GHC.Internal.Word.Word32,
+ allocated_bytes :: GHC.Internal.Word.Word64,
+ max_live_bytes :: GHC.Internal.Word.Word64,
+ max_large_objects_bytes :: GHC.Internal.Word.Word64,
+ max_compact_bytes :: GHC.Internal.Word.Word64,
+ max_slop_bytes :: GHC.Internal.Word.Word64,
+ max_mem_in_use_bytes :: GHC.Internal.Word.Word64,
+ cumulative_live_bytes :: GHC.Internal.Word.Word64,
+ copied_bytes :: GHC.Internal.Word.Word64,
+ par_copied_bytes :: GHC.Internal.Word.Word64,
+ cumulative_par_max_copied_bytes :: GHC.Internal.Word.Word64,
+ cumulative_par_balanced_copied_bytes :: GHC.Internal.Word.Word64,
+ init_cpu_ns :: RtsTime,
+ init_elapsed_ns :: RtsTime,
+ mutator_cpu_ns :: RtsTime,
+ mutator_elapsed_ns :: RtsTime,
+ gc_cpu_ns :: RtsTime,
+ gc_elapsed_ns :: RtsTime,
+ cpu_ns :: RtsTime,
+ elapsed_ns :: RtsTime,
+ nonmoving_gc_sync_cpu_ns :: RtsTime,
+ nonmoving_gc_sync_elapsed_ns :: RtsTime,
+ nonmoving_gc_sync_max_elapsed_ns :: RtsTime,
+ nonmoving_gc_cpu_ns :: RtsTime,
+ nonmoving_gc_elapsed_ns :: RtsTime,
+ nonmoving_gc_max_elapsed_ns :: RtsTime,
+ gc :: GCDetails}
+ type RtsTime :: *
+ type RtsTime = GHC.Internal.Int.Int64
+ getRTSStats :: GHC.Types.IO RTSStats
+ getRTSStatsEnabled :: GHC.Types.IO GHC.Types.Bool
+
module GHC.TypeLits.Experimental where
-- Safety: Safe-Inferred
appendSSymbol :: forall (a :: GHC.Types.Symbol) (b :: GHC.Types.Symbol). GHC.Internal.TypeLits.SSymbol a -> GHC.Internal.TypeLits.SSymbol b -> GHC.Internal.TypeLits.SSymbol (GHC.Internal.TypeLits.AppendSymbol a b)
@@ -10561,9 +10712,31 @@ instance forall a. GHC.Internal.Data.String.IsString a => GHC.Internal.Data.Stri
instance forall a. (a ~ GHC.Types.Char) => GHC.Internal.Data.String.IsString [a] -- Defined in ‘GHC.Internal.Data.String’
instance forall a. GHC.Internal.Enum.Bounded a => GHC.Internal.Enum.Bounded (GHC.Internal.Data.Ord.Down a) -- Defined in ‘GHC.Internal.Data.Ord’
instance forall a. (GHC.Internal.Enum.Enum a, GHC.Internal.Enum.Bounded a, GHC.Classes.Eq a) => GHC.Internal.Enum.Enum (GHC.Internal.Data.Ord.Down a) -- Defined in ‘GHC.Internal.Data.Ord’
+instance GHC.Internal.Enum.Enum GHC.Internal.RTS.Flags.DoCostCentres -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Enum.Enum GHC.Internal.RTS.Flags.DoHeapProfile -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Enum.Enum GHC.Internal.RTS.Flags.DoTrace -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Enum.Enum GHC.Internal.RTS.Flags.GiveGCStats -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Enum.Enum GHC.Internal.RTS.Flags.IoManagerFlag -- Defined in ‘GHC.Internal.RTS.Flags’
instance forall a. GHC.Internal.Float.Floating a => GHC.Internal.Float.Floating (GHC.Internal.Data.Ord.Down a) -- Defined in ‘GHC.Internal.Data.Ord’
instance forall a. GHC.Internal.Float.RealFloat a => GHC.Internal.Float.RealFloat (GHC.Internal.Data.Ord.Down a) -- Defined in ‘GHC.Internal.Data.Ord’
instance forall a. GHC.Internal.Foreign.Storable.Storable a => GHC.Internal.Foreign.Storable.Storable (GHC.Internal.Data.Ord.Down a) -- Defined in ‘GHC.Internal.Data.Ord’
+instance GHC.Internal.Generics.Generic GHC.Internal.RTS.Flags.CCFlags -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Generics.Generic GHC.Internal.RTS.Flags.ConcFlags -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Generics.Generic GHC.Internal.RTS.Flags.DebugFlags -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Generics.Generic GHC.Internal.RTS.Flags.DoCostCentres -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Generics.Generic GHC.Internal.RTS.Flags.DoHeapProfile -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Generics.Generic GHC.Internal.RTS.Flags.DoTrace -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Generics.Generic GHC.Internal.RTS.Flags.GCFlags -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Generics.Generic GHC.Internal.RTS.Flags.GiveGCStats -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Generics.Generic GHC.Internal.RTS.Flags.HpcFlags -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Generics.Generic GHC.Internal.RTS.Flags.MiscFlags -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Generics.Generic GHC.Internal.RTS.Flags.ParFlags -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Generics.Generic GHC.Internal.RTS.Flags.ProfFlags -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Generics.Generic GHC.Internal.RTS.Flags.RTSFlags -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Generics.Generic GHC.Internal.RTS.Flags.TickyFlags -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Generics.Generic GHC.Internal.RTS.Flags.TraceFlags -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Generics.Generic GHC.Internal.Stats.GCDetails -- Defined in ‘GHC.Internal.Stats’
+instance GHC.Internal.Generics.Generic GHC.Internal.Stats.RTSStats -- Defined in ‘GHC.Internal.Stats’
instance GHC.Internal.IsList.IsList GHC.Internal.Stack.Types.CallStack -- Defined in ‘GHC.Internal.IsList’
instance forall a. GHC.Internal.IsList.IsList [a] -- Defined in ‘GHC.Internal.IsList’
instance forall a. GHC.Internal.IsList.IsList (GHC.Internal.Base.NonEmpty a) -- Defined in ‘GHC.Internal.IsList’
@@ -10572,6 +10745,8 @@ instance forall a. GHC.Internal.IsList.IsList (GHC.Internal.Functor.ZipList.ZipL
instance forall a. GHC.Internal.Ix.Ix a => GHC.Internal.Ix.Ix (GHC.Internal.Data.Ord.Down a) -- Defined in ‘GHC.Internal.Data.Ord’
instance forall a. GHC.Internal.Num.Num a => GHC.Internal.Num.Num (GHC.Internal.Data.Ord.Down a) -- Defined in ‘GHC.Internal.Data.Ord’
instance forall a. GHC.Internal.Read.Read a => GHC.Internal.Read.Read (GHC.Internal.Data.Ord.Down a) -- Defined in ‘GHC.Internal.Data.Ord’
+instance GHC.Internal.Read.Read GHC.Internal.Stats.GCDetails -- Defined in ‘GHC.Internal.Stats’
+instance GHC.Internal.Read.Read GHC.Internal.Stats.RTSStats -- Defined in ‘GHC.Internal.Stats’
instance forall a. GHC.Internal.Real.Fractional a => GHC.Internal.Real.Fractional (GHC.Internal.Data.Ord.Down a) -- Defined in ‘GHC.Internal.Data.Ord’
instance forall a. GHC.Internal.Real.Real a => GHC.Internal.Real.Real (GHC.Internal.Data.Ord.Down a) -- Defined in ‘GHC.Internal.Data.Ord’
instance forall a. GHC.Internal.Real.RealFrac a => GHC.Internal.Real.RealFrac (GHC.Internal.Data.Ord.Down a) -- Defined in ‘GHC.Internal.Data.Ord’
@@ -10579,6 +10754,24 @@ instance forall a. GHC.Internal.Show.Show a => GHC.Internal.Show.Show (GHC.Inter
instance forall a. GHC.Internal.Show.Show (GHC.Internal.Ptr.FunPtr a) -- Defined in ‘GHC.Internal.Ptr’
instance forall a. GHC.Internal.Show.Show (GHC.Internal.Ptr.Ptr a) -- Defined in ‘GHC.Internal.Ptr’
instance GHC.Internal.Show.Show GHC.Internal.IO.MaskingState -- Defined in ‘GHC.Internal.IO’
+instance GHC.Internal.Show.Show GHC.Internal.RTS.Flags.CCFlags -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Show.Show GHC.Internal.RTS.Flags.ConcFlags -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Show.Show GHC.Internal.RTS.Flags.DebugFlags -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Show.Show GHC.Internal.RTS.Flags.DoCostCentres -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Show.Show GHC.Internal.RTS.Flags.DoHeapProfile -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Show.Show GHC.Internal.RTS.Flags.DoTrace -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Show.Show GHC.Internal.RTS.Flags.GCFlags -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Show.Show GHC.Internal.RTS.Flags.GiveGCStats -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Show.Show GHC.Internal.RTS.Flags.HpcFlags -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Show.Show GHC.Internal.RTS.Flags.IoManagerFlag -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Show.Show GHC.Internal.RTS.Flags.MiscFlags -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Show.Show GHC.Internal.RTS.Flags.ParFlags -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Show.Show GHC.Internal.RTS.Flags.ProfFlags -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Show.Show GHC.Internal.RTS.Flags.RTSFlags -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Show.Show GHC.Internal.RTS.Flags.TickyFlags -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Show.Show GHC.Internal.RTS.Flags.TraceFlags -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Internal.Show.Show GHC.Internal.Stats.GCDetails -- Defined in ‘GHC.Internal.Stats’
+instance GHC.Internal.Show.Show GHC.Internal.Stats.RTSStats -- Defined in ‘GHC.Internal.Stats’
instance GHC.Classes.Eq GHC.Types.Bool -- Defined in ‘GHC.Classes’
instance GHC.Classes.Eq GHC.Types.Char -- Defined in ‘GHC.Classes’
instance GHC.Classes.Eq GHC.Types.Double -- Defined in ‘GHC.Classes’
@@ -10613,6 +10806,8 @@ instance forall a. GHC.Classes.Eq (GHC.Internal.Ptr.Ptr a) -- Defined in ‘GHC.
instance forall a. GHC.Classes.Eq a => GHC.Classes.Eq (GHC.Internal.Base.NonEmpty a) -- Defined in ‘GHC.Internal.Base’
instance GHC.Classes.Eq GHC.Internal.Base.Void -- Defined in ‘GHC.Internal.Base’
instance GHC.Classes.Eq GHC.Internal.IO.MaskingState -- Defined in ‘GHC.Internal.IO’
+instance GHC.Classes.Eq GHC.Internal.RTS.Flags.IoManagerFlag -- Defined in ‘GHC.Internal.RTS.Flags’
+instance GHC.Classes.Eq GHC.Internal.IO.SubSystem.IoSubSystem -- Defined in ‘GHC.Internal.IO.SubSystem’
instance GHC.Classes.Ord GHC.Types.Bool -- Defined in ‘GHC.Classes’
instance GHC.Classes.Ord GHC.Types.Char -- Defined in ‘GHC.Classes’
instance GHC.Classes.Ord GHC.Types.Double -- Defined in ‘GHC.Classes’
=====================================
utils/ghc-toolchain/exe/Main.hs
=====================================
@@ -35,11 +35,11 @@ import GHC.Toolchain.NormaliseTriple (normaliseTriple)
import Text.Read (readMaybe)
data Opts = Opts
- { optTriple :: String
+ { optTriple :: Maybe String
, optTargetPrefix :: Maybe String
, optLocallyExecutable :: Maybe Bool
, optLlvmTriple :: Maybe String
- , optOutput :: String
+ , optOutput :: Maybe String
, optCc :: ProgOpt
, optCxx :: ProgOpt
, optCpp :: ProgOpt
@@ -82,11 +82,11 @@ emptyFormatOpts = FormatOpts { formatOptInput = error "formatOpts: input"
emptyOpts :: Opts
emptyOpts = Opts
- { optTriple = ""
+ { optTriple = Nothing
, optTargetPrefix = Nothing
, optLocallyExecutable = Nothing
, optLlvmTriple = Nothing
- , optOutput = ""
+ , optOutput = Nothing
, optCc = po0
, optCxx = po0
, optCpp = po0
@@ -129,13 +129,13 @@ _optMergeObjs = Lens optMergeObjs (\x o -> o {optMergeObjs=x})
_optWindres = Lens optWindres (\x o -> o {optWindres=x})
_optLd = Lens optLd (\x o -> o {optLd= x})
-_optTriple :: Lens Opts String
+_optTriple :: Lens Opts (Maybe String)
_optTriple = Lens optTriple (\x o -> o {optTriple=x})
_optLlvmTriple :: Lens Opts (Maybe String)
_optLlvmTriple = Lens optLlvmTriple (\x o -> o {optLlvmTriple=x})
-_optOutput :: Lens Opts String
+_optOutput :: Lens Opts (Maybe String)
_optOutput = Lens optOutput (\x o -> o {optOutput=x})
_optTargetPrefix :: Lens Opts (Maybe String)
@@ -213,7 +213,7 @@ options =
, Option [] ["disable-" ++ optName] (NoArg (set lens (Just False))) ("Disable " ++ description)
]
- tripleOpt = Option ['t'] ["triple"] (ReqArg (set _optTriple) "TRIPLE") "Target triple"
+ tripleOpt = Option ['t'] ["triple"] (ReqArg (set _optTriple . Just) "TRIPLE") "Target triple"
llvmTripleOpt = Option [] ["llvm-triple"] (ReqArg (set _optLlvmTriple . Just) "LLVM-TRIPLE") "LLVM Target triple"
targetPrefixOpt = Option ['T'] ["target-prefix"] (ReqArg (set _optTargetPrefix . Just) "PREFIX")
@@ -233,7 +233,7 @@ options =
keepTempOpt = Option [] ["keep-temp"] (NoArg (set _optKeepTemp True))
"do not remove temporary files"
- outputOpt = Option ['o'] ["output"] (ReqArg (set _optOutput) "OUTPUT")
+ outputOpt = Option ['o'] ["output"] (ReqArg (set _optOutput . Just) "OUTPUT")
"The output path for the generated target toolchain configuration"
formatOpts :: [OptDescr (FormatOpts -> FormatOpts)]
@@ -244,6 +244,16 @@ formatOpts = [
"The target file to format")
]
+validateOpts :: Opts -> [String]
+validateOpts opts = mconcat
+ [ assertJust _optTriple "missing --triple flag"
+ , assertJust _optOutput "missing --output flag"
+ ]
+ where
+ assertJust :: Lens Opts (Maybe a) -> String -> [String]
+ assertJust lens msg =
+ [ msg | Nothing <- pure $ view lens opts ]
+
main :: IO ()
main = do
argv <- getArgs
@@ -273,14 +283,14 @@ doFormat args = do
doConfigure :: [String] -> IO ()
doConfigure args = do
- let (opts0, _nonopts, errs) = getOpt RequireOrder options args
+ let (opts0, _nonopts, parseErrs) = getOpt RequireOrder options args
let opts = foldr (.) id opts0 emptyOpts
- case errs of
+ case parseErrs ++ validateOpts opts of
[] -> do
let env = Env { verbosity = optVerbosity opts
, targetPrefix = case optTargetPrefix opts of
Just prefix -> Just prefix
- Nothing -> Just $ optTriple opts ++ "-"
+ Nothing -> Just $ fromMaybe (error "undefined triple") (optTriple opts) ++ "-"
, keepTemp = optKeepTemp opts
, canLocallyExecute = fromMaybe True (optLocallyExecutable opts)
, logContexts = []
@@ -289,7 +299,7 @@ doConfigure args = do
case r of
Left err -> print err >> exitWith (ExitFailure 2)
Right () -> return ()
- _ -> do
+ errs -> do
mapM_ putStrLn errs
putStrLn $ usageInfo "ghc-toolchain" options
exitWith (ExitFailure 1)
@@ -298,7 +308,7 @@ run :: Opts -> M ()
run opts = do
tgt <- mkTarget opts
logDebug $ "Final Target: " ++ show tgt
- let file = optOutput opts
+ let file = fromMaybe (error "undefined --output") (optOutput opts)
writeFile file (show tgt)
optional :: M a -> M (Maybe a)
@@ -390,7 +400,7 @@ ldOverrideWhitelist a =
mkTarget :: Opts -> M Target
mkTarget opts = do
- normalised_triple <- normaliseTriple (optTriple opts)
+ normalised_triple <- normaliseTriple (fromMaybe (error "missing --triple") (optTriple opts))
-- Use Llvm target if specified, otherwise use triple as llvm target
let tgtLlvmTarget = fromMaybe normalised_triple (optLlvmTriple opts)
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/8522f16f0e1de5601d1ca60b16b1e82f941f04bd...3e679889ad102edf634a82920c24f63e311643f5
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/8522f16f0e1de5601d1ca60b16b1e82f941f04bd...3e679889ad102edf634a82920c24f63e311643f5
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20241126/69160162/attachment-0001.html>
More information about the ghc-commits
mailing list