
[Git][ghc/ghc][wip/romes/step-out-5] WIP: Working on RESUME_STEP_OUT for case continuations [skip ci]
by Rodrigo Mesquita (@alt-romes) 24 Jun '25
by Rodrigo Mesquita (@alt-romes) 24 Jun '25
24 Jun '25
Rodrigo Mesquita pushed to branch wip/romes/step-out-5 at Glasgow Haskell Compiler / GHC
Commits:
d61e3fbc by Rodrigo Mesquita at 2025-06-24T22:57:30+01:00
WIP: Working on RESUME_STEP_OUT for case continuations [skip ci]
- - - - -
6 changed files:
- compiler/GHC/ByteCode/Asm.hs
- compiler/GHC/ByteCode/Instr.hs
- compiler/GHC/StgToByteCode.hs
- rts/Disassembler.c
- rts/Interpreter.c
- rts/include/rts/Bytecodes.h
Changes:
=====================================
compiler/GHC/ByteCode/Asm.hs
=====================================
@@ -856,7 +856,7 @@ assembleI platform i = case i of
, Op np
]
- BRK_ALTS active -> emit_ bci_BRK_ALTS [SmallOp active]
+ RESUME_STEP_OUT on prev next -> emit_ bci_RESUME_STEP_OUT [SmallOp on, SmallOp prev, SmallOp next]
#if MIN_VERSION_rts(1,0,3)
BCO_NAME name -> do np <- lit1 (BCONPtrStr name)
=====================================
compiler/GHC/ByteCode/Instr.hs
=====================================
@@ -8,10 +8,11 @@
-- | Bytecode instruction definitions
module GHC.ByteCode.Instr (
- BCInstr(..), ProtoBCO(..), bciStackUse, LocalLabel(..)
+ BCInstr(..), ProtoBCO(..), bciStackUse, bciSize, LocalLabel(..)
) where
import GHC.Prelude
+import GHC.Platform
import GHC.ByteCode.Types
import GHC.Cmm.Type (Width)
@@ -273,8 +274,10 @@ data BCInstr
(RemotePtr CostCentre)
-- An internal breakpoint for triggering a break on any case alternative
- -- See Note [Debugger: BRK_ALTS]
- | BRK_ALTS !Word16 {- enabled? -}
+ -- See Note [Debugger: RESUME_STEP_OUT]
+ | RESUME_STEP_OUT !Word16 {- enabled? -}
+ !Word16 {- offset to prev RESUME_STEP_OUT within same BCO -}
+ !Word16 {- offset to next RESUME_STEP_OUT within same BCO -}
#if MIN_VERSION_rts(1,0,3)
-- | A "meta"-instruction for recording the name of a BCO for debugging purposes.
@@ -471,7 +474,8 @@ instance Outputable BCInstr where
<+> text "<tick_module>" <+> text "<tick_module_unitid>" <+> ppr tickx
<+> text "<info_module>" <+> text "<info_module_unitid>" <+> ppr infox
<+> text "<cc>"
- ppr (BRK_ALTS active) = text "BRK_ALTS" <+> ppr active
+ ppr (RESUME_STEP_OUT on prev next)
+ = text "RESUME_STEP_OUT" <+> ppr on <+> ppr prev <+> ppr next
#if MIN_VERSION_rts(1,0,3)
ppr (BCO_NAME nm) = text "BCO_NAME" <+> text (show nm)
#endif
@@ -597,7 +601,7 @@ bciStackUse OP_INDEX_ADDR{} = 0
bciStackUse SWIZZLE{} = 0
bciStackUse BRK_FUN{} = 0
-bciStackUse BRK_ALTS{} = 0
+bciStackUse RESUME_STEP_OUT{} = 0
-- These insns actually reduce stack use, but we need the high-tide level,
-- so can't use this info. Not that it matters much.
@@ -608,3 +612,121 @@ bciStackUse PACK{} = 1 -- worst case is PACK 0 words
#if MIN_VERSION_rts(1,0,3)
bciStackUse BCO_NAME{} = 0
#endif
+
+-- | The size of a bytecode instruction's arguments in number of Word16 (the
+-- size of bytecode instructions)
+bciSize :: Platform -> BCInstr -> Word16
+bciSize p STKCHECK{} = wordSizeInBc p
+bciSize p PUSH_L{} = wordSizeInBc p
+bciSize p PUSH_LL{} = 2*wordSizeInBc p
+bciSize p PUSH_LLL{} = 3*wordSizeInBc p
+bciSize p PUSH8{} = wordSizeInBc p
+bciSize p PUSH16{} = wordSizeInBc p
+bciSize p PUSH32{} = wordSizeInBc p
+bciSize p PUSH8_W{} = wordSizeInBc p
+bciSize p PUSH16_W{} = wordSizeInBc p
+bciSize p PUSH32_W{} = wordSizeInBc p
+bciSize p PUSH_G{} = wordSizeInBc p
+bciSize p PUSH_PRIMOP{} = wordSizeInBc p
+bciSize p PUSH_BCO{} = wordSizeInBc p
+bciSize p PUSH_ALTS{} = wordSizeInBc p
+bciSize p PUSH_ALTS_TUPLE{} = 3*wordSizeInBc p
+bciSize _ (PUSH_PAD8) = 0
+bciSize _ (PUSH_PAD16) = 0
+bciSize _ (PUSH_PAD32) = 0
+bciSize p (PUSH_UBX8 _) = wordSizeInBc p
+bciSize p (PUSH_UBX16 _) = wordSizeInBc p
+bciSize p (PUSH_UBX32 _) = wordSizeInBc p
+bciSize p (PUSH_UBX{}) = 2*wordSizeInBc p
+bciSize p PUSH_ADDR{} = 1+wordSizeInBc p
+bciSize _ PUSH_APPLY_N{} = 0
+bciSize _ PUSH_APPLY_V{} = 0
+bciSize _ PUSH_APPLY_F{} = 0
+bciSize _ PUSH_APPLY_D{} = 0
+bciSize _ PUSH_APPLY_L{} = 0
+bciSize _ PUSH_APPLY_P{} = 0
+bciSize _ PUSH_APPLY_PP{} = 0
+bciSize _ PUSH_APPLY_PPP{} = 0
+bciSize _ PUSH_APPLY_PPPP{} = 0
+bciSize _ PUSH_APPLY_PPPPP{} = 0
+bciSize _ PUSH_APPLY_PPPPPP{} = 0
+bciSize p ALLOC_AP{} = wordSizeInBc p
+bciSize p ALLOC_AP_NOUPD{} = wordSizeInBc p
+bciSize p ALLOC_PAP{} = 2*wordSizeInBc p
+bciSize p (UNPACK _) = wordSizeInBc p
+bciSize _ LABEL{} = 0
+bciSize p TESTLT_I{} = 2*wordSizeInBc p
+bciSize p TESTEQ_I{} = 2*wordSizeInBc p
+bciSize p TESTLT_W{} = 2*wordSizeInBc p
+bciSize p TESTEQ_W{} = 2*wordSizeInBc p
+bciSize p TESTLT_I64{} = 2*wordSizeInBc p
+bciSize p TESTEQ_I64{} = 2*wordSizeInBc p
+bciSize p TESTLT_I32{} = 2*wordSizeInBc p
+bciSize p TESTEQ_I32{} = 2*wordSizeInBc p
+bciSize p TESTLT_I16{} = 2*wordSizeInBc p
+bciSize p TESTEQ_I16{} = 2*wordSizeInBc p
+bciSize p TESTLT_I8{} = 2*wordSizeInBc p
+bciSize p TESTEQ_I8{} = 2*wordSizeInBc p
+bciSize p TESTLT_W64{} = 2*wordSizeInBc p
+bciSize p TESTEQ_W64{} = 2*wordSizeInBc p
+bciSize p TESTLT_W32{} = 2*wordSizeInBc p
+bciSize p TESTEQ_W32{} = 2*wordSizeInBc p
+bciSize p TESTLT_W16{} = 2*wordSizeInBc p
+bciSize p TESTEQ_W16{} = 2*wordSizeInBc p
+bciSize p TESTLT_W8{} = 2*wordSizeInBc p
+bciSize p TESTEQ_W8{} = 2*wordSizeInBc p
+bciSize p TESTLT_F{} = 2*wordSizeInBc p
+bciSize p TESTEQ_F{} = 2*wordSizeInBc p
+bciSize p TESTLT_D{} = 2*wordSizeInBc p
+bciSize p TESTEQ_D{} = 2*wordSizeInBc p
+bciSize p TESTLT_P{} = 1+wordSizeInBc p
+bciSize p TESTEQ_P{} = 1+wordSizeInBc p
+bciSize _ CASEFAIL{} = 0
+bciSize p JMP{} = wordSizeInBc p
+bciSize _ ENTER{} = 0
+bciSize _ RETURN{} = 0
+bciSize _ RETURN_TUPLE{} = 0
+bciSize p CCALL{} = 1+2*wordSizeInBc p
+bciSize _ PRIMCALL{} = 0
+bciSize _ OP_ADD{} = 0
+bciSize _ OP_SUB{} = 0
+bciSize _ OP_AND{} = 0
+bciSize _ OP_XOR{} = 0
+bciSize _ OP_OR{} = 0
+bciSize _ OP_NOT{} = 0
+bciSize _ OP_NEG{} = 0
+bciSize _ OP_MUL{} = 0
+bciSize _ OP_SHL{} = 0
+bciSize _ OP_ASR{} = 0
+bciSize _ OP_LSR{} = 0
+
+bciSize _ OP_NEQ{} = 0
+bciSize _ OP_EQ{} = 0
+bciSize _ OP_S_LT{} = 0
+bciSize _ OP_S_GT{} = 0
+bciSize _ OP_S_LE{} = 0
+bciSize _ OP_S_GE{} = 0
+bciSize _ OP_U_LT{} = 0
+bciSize _ OP_U_GT{} = 0
+bciSize _ OP_U_LE{} = 0
+bciSize _ OP_U_GE{} = 0
+
+bciSize _ OP_INDEX_ADDR{} = 0
+
+bciSize p SWIZZLE{} = 2*wordSizeInBc p
+bciSize p BRK_FUN{} = 2+6*wordSizeInBc p
+bciSize _ RESUME_STEP_OUT{} = 3
+
+bciSize p SLIDE{} = 2*wordSizeInBc p
+bciSize p MKAP{} = 2*wordSizeInBc p
+bciSize p MKPAP{} = 2*wordSizeInBc p
+bciSize p PACK{} = 2*wordSizeInBc p
+#if MIN_VERSION_rts(1,0,3)
+bciSize p BCO_NAME{} = wordSizeInBc p
+#endif
+
+wordSizeInBc :: Platform -> Word16
+wordSizeInBc p =
+ case platformWordSize p of
+ PW4 -> 2
+ PW8 -> 4
=====================================
compiler/GHC/StgToByteCode.hs
=====================================
@@ -4,6 +4,7 @@
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE FlexibleContexts #-}
+{-# LANGUAGE ViewPatterns #-}
--
-- (c) The University of Glasgow 2002-2006
@@ -75,6 +76,7 @@ import Data.List ( genericReplicate, intersperse
, partition, scanl', sortBy, zip4, zip6 )
import Foreign hiding (shiftL, shiftR)
import Control.Monad
+import Control.Monad.Trans.State
import Data.Char
import GHC.Unit.Module
@@ -96,6 +98,7 @@ import Data.Either ( partitionEithers )
import GHC.Stg.Syntax
import qualified Data.IntSet as IntSet
import GHC.CoreToIface
+import Data.Bifunctor (Bifunctor(..))
-- -----------------------------------------------------------------------------
-- Generating byte code for a complete module
@@ -1367,6 +1370,43 @@ doCase d s p scrut bndr alts
bitmap = intsToReverseBitmap platform bitmap_size' pointers
+ -- See Note [Debugger: RESUME_STEP_OUT]
+ -- We could do this in a single pass, but it is easier to do two.
+ fillInResStepOutStubs instrs = fst $ runState (fillInBackwards =<< fillInForwards instrs) (0, True)
+
+ fillInForwards :: BCInstrList -> State (Word16, Bool) BCInstrList
+ fillInForwards instrs = do
+ put (0, True) -- reset
+ forM instrs $ \i -> do
+ (off, isFirst) <- get
+ case i of
+ RESUME_STEP_OUT o _ n -> do
+ -- Reset offset
+ put (0, False)
+ if isFirst
+ then return $ RESUME_STEP_OUT o 0 n
+ else return $ RESUME_STEP_OUT o off n
+ _ -> do
+ modify (first (+ (bciSize platform i + 1)))
+ return i
+
+ fillInBackwards :: BCInstrList -> State (Word16, Bool) BCInstrList
+ fillInBackwards instrs = reverseOL <$> do
+ put (0, True) -- reset
+ forM (reverseOL instrs) $ \i -> do
+ (off, isFirst) <- get
+ case i of
+ RESUME_STEP_OUT o p _ -> do
+ -- Reset offset
+ put (0, False)
+ if isFirst
+ then return $ RESUME_STEP_OUT o p 0
+ else return $ RESUME_STEP_OUT o p off
+ _ -> do
+ modify (first (+ (bciSize platform i + 1)))
+ return i
+
+
alt_stuff <- mapM codeAlt alts
alt_final0 <- mkMultiBranch maybe_ncons alt_stuff
@@ -1375,8 +1415,9 @@ doCase d s p scrut bndr alts
| otherwise = alt_final0
alt_final
| gopt Opt_InsertBreakpoints (hsc_dflags hsc_env)
- -- See Note [Debugger: BRK_ALTS]
- = BRK_ALTS 0 `consOL` alt_final1
+ -- See Note [Debugger: RESUME_STEP_OUT]
+ = {- TODO: ASSERT IN BYTECODE THINGS -}
+ fillInResStepOutStubs (RESUME_STEP_OUT 0 0 0 `consOL` alt_final1)
| otherwise = alt_final1
add_bco_name <- shouldAddBcoName
@@ -2402,13 +2443,13 @@ mkMultiBranch :: Maybe Int -- # datacons in tycon, if alg alt
-> BcM BCInstrList
mkMultiBranch maybe_ncons raw_ways = do
lbl_default <- getLabelBc
-
+ hsc_env <- getHscEnv
let
mkTree :: [(Discr, BCInstrList)] -> Discr -> Discr -> BcM BCInstrList
mkTree [] _range_lo _range_hi = return (unitOL (JMP lbl_default))
-- shouldn't happen?
- mkTree [val] range_lo range_hi
+ mkTree [(second insertStubResStepOut -> val)] range_lo range_hi
| range_lo == range_hi
= return (snd val)
| null defaults -- Note [CASEFAIL]
@@ -2417,7 +2458,8 @@ mkMultiBranch maybe_ncons raw_ways = do
`consOL` (snd val
`appOL` (LABEL lbl `consOL` unitOL CASEFAIL)))
| otherwise
- = return (testEQ (fst val) lbl_default `consOL` snd val)
+ = return (testEQ (fst val) lbl_default
+ `consOL` snd val)
-- Note [CASEFAIL]
-- ~~~~~~~~~~~~~~~
@@ -2448,8 +2490,22 @@ mkMultiBranch maybe_ncons raw_ways = do
the_default
= case defaults of
[] -> nilOL
- [(_, def)] -> LABEL lbl_default `consOL` def
+ [(_, def)] -> LABEL lbl_default `consOL` insertStubResStepOut def
_ -> panic "mkMultiBranch/the_default"
+
+ -- See Note [Debugger: RESUME_STEP_OUT]
+ insertStubResStepOut (SnocOL instrs i)
+ | not (gopt Opt_InsertBreakpoints (hsc_dflags hsc_env))
+ = instrs `snocOL` i -- do nothing
+ -- look through instrs which diverge control flow
+ | any id $ [True | ENTER <- [i]]
+ ++ [True | RETURN{} <- [i]]
+ ++ [True | PRIMCALL{} <- [i]]
+ = insertStubResStepOut instrs `snocOL` i
+ | otherwise
+ = instrs `snocOL` i `snocOL` RESUME_STEP_OUT 0 0 0
+ insertStubResStepOut NilOL = NilOL
+
instrs <- mkTree notd_ways init_lo init_hi
return (instrs `appOL` the_default)
where
=====================================
rts/Disassembler.c
=====================================
@@ -94,8 +94,11 @@ disInstr ( StgBCO *bco, int pc )
debugBelch("\n");
pc += 6;
break;
- case bci_BRK_ALTS:
- debugBelch ("BRK_ALTS %d\n", BCO_NEXT);
+ case bci_RESUME_STEP_OUT:
+ unsigned int active = BCO_NEXT;
+ unsigned int prev = BCO_NEXT;
+ unsigned int next = BCO_NEXT;
+ debugBelch ("RESUME_STEP_OUT on:%d prev_off:%d next_off:%d\n", active, prev, next);
break;
case bci_SWIZZLE: {
W_ stkoff = BCO_GET_LARGE_ARG;
=====================================
rts/Interpreter.c
=====================================
@@ -562,6 +562,85 @@ slow_spw(void *Sp, StgStack *cur_stack, StgWord offset_words){
}
}
+static void
+set_bco_RESUME_STEP_OUTs(StgWord16 *instrs, int bciPtr, int val) {
+ bciPtr++; // skip fst arg
+ StgWord16 to_prev = BCO_NEXT;
+ StgWord16 to_next = BCO_NEXT;
+
+ while (to_prev != 0) {
+ instrs[to_prev+1] = val;
+ to_prev = instrs[to_prev+2];
+ }
+ while (to_next != 0) {
+ instrs[to_next+1] = val;
+ to_next = instrs[to_next+3];
+ }
+}
+
+
+/* Traverse from the given stack pointer upwards until a continuation BCO with
+ * a breakpoint is found -- then enable that breakpoint.
+ * See Note [Debugger: Step-out]
+ */
+static void
+enable_break_on_continuation(Capability *cap, void *Sp) {
+
+ StgBCO* bco;
+ StgWord16* bco_instrs;
+ StgHalfWord type;
+
+ /* Traverse upwards until continuation BCO, or the end */
+ while ((type = get_itbl((StgClosure*)Sp)->type) != RET_BCO
+ && type != STOP_FRAME) {
+ Sp = SafeSpWP(stack_frame_sizeW((StgClosure *)Sp));
+ }
+
+ ASSERT(type == RET_BCO || type == STOP_FRAME);
+ if (type == RET_BCO) {
+
+ bco = (StgBCO*)(SpW(1)); // BCO is first arg of a RET_BCO
+ ASSERT(get_itbl((StgClosure*)bco)->type == BCO);
+ bco_instrs = (StgWord16*)(bco->instrs->payload);
+
+ /* A breakpoint instruction (BRK_FUN or BRK_ALTS) is always the first
+ * instruction in a BCO */
+ if ((bco_instrs[0] & 0xFF) == bci_BRK_FUN) {
+ int brk_array, tick_index;
+ StgArrBytes *breakPoints;
+ StgPtr* ptrs;
+
+ ptrs = (StgPtr*)(&bco->ptrs->payload[0]);
+ brk_array = bco_instrs[1];
+ tick_index = bco_instrs[6];
+
+ breakPoints = (StgArrBytes *) BCO_PTR(brk_array);
+ // ACTIVATE the breakpoint by tick index
+ ((StgInt*)breakPoints->payload)[tick_index] = 0;
+ }
+ // TODO: ASSERT IN STG2BC: All Case continuation BCOs start with a RESUME_STEP_OUT instruction that is never active but points to the remaining ones
+ else {
+ if ((bco_instrs[0] & 0xFF) == bci_RESUME_STEP_OUT) {
+
+ // Step-out will resume and trigger a specific breakpoint further up
+ // the stack when the case alternative is selected.
+ // See Note [Debugger: RESUME_STEP_OUT]
+ set_bco_RESUME_STEP_OUTs(bco_instrs, 1 /*start ix*/, 1 /* Enable them all */);
+ bco_instrs[1] = 0; /* and disable the first stub one again; this one is not meant to run, only find the others. */
+ }
+ else {
+ // Unlikely: This continuation BCO doesn't have a BRK_FUN nor is a case
+ // continuation BCO with RESUME_STEP_OUT.
+ // Keep looking for a frame to trigger a breakpoint in in the stack:
+ enable_break_on_continuation(cap, Sp);
+ }
+ }
+ }
+ else /* type == STOP_FRAME */ {
+ /* No continuation frame to further stop at: Nothing to do */
+ }
+}
+
// Compute the pointer tag for the constructor and tag the pointer;
// see Note [Data constructor dynamic tags] in GHC.StgToCmm.Closure.
//
@@ -618,62 +697,17 @@ interpretBCO (Capability* cap)
* See Note [Debugger: Step-out]
*/
if (cap->r.rCurrentTSO->flags & TSO_STOP_AFTER_RETURN) {
+ StgPtr frame;
- StgBCO* bco;
- StgWord16* bco_instrs;
- StgHalfWord type;
-
- /* Store the entry Sp; traverse the stack modifying Sp (using Sp macros);
- * restore Sp afterwards. */
- StgPtr restoreStackPointer = Sp;
-
- /* The first BCO on the stack is the one we are already stopped at.
- * Skip it. */
- Sp = SafeSpWP(stack_frame_sizeW((StgClosure *)Sp));
+ /* The first BCO on the stack as we re-enter the interpreter is the one
+ * we are already stopped at. Skip it. */
+ frame = SafeSpWP(stack_frame_sizeW((StgClosure *)Sp));
- /* Traverse upwards until continuation BCO, or the end */
- while ((type = get_itbl((StgClosure*)Sp)->type) != RET_BCO
- && type != STOP_FRAME) {
- Sp = SafeSpWP(stack_frame_sizeW((StgClosure *)Sp));
- }
-
- ASSERT(type == RET_BCO || type == STOP_FRAME);
- if (type == RET_BCO) {
-
- bco = (StgBCO*)(SpW(1)); // BCO is first arg of a RET_BCO
- ASSERT(get_itbl((StgClosure*)bco)->type == BCO);
- bco_instrs = (StgWord16*)(bco->instrs->payload);
-
- /* A breakpoint instruction (BRK_FUN or BRK_ALTS) is always the first
- * instruction in a BCO */
- if ((bco_instrs[0] & 0xFF) == bci_BRK_FUN) {
- int brk_array, tick_index;
- StgArrBytes *breakPoints;
- StgPtr* ptrs;
+ /* Enable the breakpoint in the first breakable continuation */
+ enable_break_on_continuation(cap, frame);
- ptrs = (StgPtr*)(&bco->ptrs->payload[0]);
- brk_array = bco_instrs[1];
- tick_index = bco_instrs[6];
-
- breakPoints = (StgArrBytes *) BCO_PTR(brk_array);
- // ACTIVATE the breakpoint by tick index
- ((StgInt*)breakPoints->payload)[tick_index] = 0;
- }
- else if ((bco_instrs[0] & 0xFF) == bci_BRK_ALTS) {
- // ACTIVATE BRK_ALTS by setting its only argument to ON
- bco_instrs[1] = 1;
- }
- // else: if there is no BRK instruction perhaps we should keep
- // traversing; that said, the continuation should always have a BRK
- }
- else /* type == STOP_FRAME */ {
- /* No continuation frame to further stop at: Nothing to do */
- }
-
- // Mark as done to not do it again
+ /* Mark as done to not do it again */
cap->r.rCurrentTSO->flags &= ~TSO_STOP_AFTER_RETURN;
-
- Sp = restoreStackPointer;
}
// ------------------------------------------------------------------------
@@ -1600,12 +1634,21 @@ run_BCO:
goto nextInsn;
}
- /* See Note [Debugger: BRK_ALTS] */
- case bci_BRK_ALTS:
+ /* See Note [Debugger: RESUME_STEP_OUT] */
+ case bci_RESUME_STEP_OUT:
{
- StgWord16 active = BCO_NEXT;
+ StgWord16 active = BCO_NEXT;
+ bciPtr++; /* arg2 */
+ bciPtr++; /* arg3 */
+
if (active) {
- cap->r.rCurrentTSO->flags |= TSO_STOP_NEXT_BREAKPOINT;
+ // Try to look for a continuation to activate a breakpoint on on
+ // the stack again.
+ enable_break_on_continuation(cap, Sp);
+
+ // Make sure the remaining RESUME_STEP_OUTs in this BCO are
+ // disabled since we took this one.
+ set_bco_RESUME_STEP_OUTs(instrs, bciPtr - 3 /* index */, 0 /* Disable them all */);
}
goto nextInsn;
=====================================
rts/include/rts/Bytecodes.h
=====================================
@@ -214,7 +214,7 @@
#define bci_OP_INDEX_ADDR_32 242
#define bci_OP_INDEX_ADDR_64 243
-#define bci_BRK_ALTS 244
+#define bci_RESUME_STEP_OUT 244
/* If you need to go past 255 then you will run into the flags */
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d61e3fbcd63385097026386de847498…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d61e3fbcd63385097026386de847498…
You're receiving this email because of your account on gitlab.haskell.org.
1
0

[Git][ghc/ghc][wip/fendor/no-load] Implement `-fno-load-initial-targets` flag
by Hannes Siebenhandl (@fendor) 24 Jun '25
by Hannes Siebenhandl (@fendor) 24 Jun '25
24 Jun '25
Hannes Siebenhandl pushed to branch wip/fendor/no-load at Glasgow Haskell Compiler / GHC
Commits:
64d5508e by fendor at 2025-06-24T22:12:12+02:00
Implement `-fno-load-initial-targets` flag
We add the new flag `-fno-load-initial-targets` which doesn't load all `Target`s
immediately but only computes the module graph for all `Target`s.
The user can then decide to load modules from that module graph using
the syntax:
ghci> :reload <Mod>
This will load everything in the module graph up to `Mod`.
The user can return to the initial state by using the builtin target
`none` to unload all modules.
ghci> :reload none
Is in principle identical to starting a new session with the
`-fno-load-initial-targets` flag.
The `-fno-load-initial-targets` flag allows for faster startup time of GHCi when a
user has lots of `Target`s.
We additionally extend the `:reload` command to accept multiple
`ModuleName`s. For example:
ghci> :reload <Mod1> <Mod2>
Loads all modules up to the modules `Mod1` and `Mod2`.
- - - - -
35 changed files:
- compiler/GHC/Driver/DynFlags.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/Make.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Unit/Module/Graph.hs
- docs/users_guide/ghci.rst
- ghc/GHCi/UI.hs
- ghc/GHCi/UI/Exception.hs
- + testsuite/tests/ghci/prog-mhu005/Makefile
- + testsuite/tests/ghci/prog-mhu005/a/A.hs
- + testsuite/tests/ghci/prog-mhu005/all.T
- + testsuite/tests/ghci/prog-mhu005/b/B.hs
- + testsuite/tests/ghci/prog-mhu005/prog-mhu005a.script
- + testsuite/tests/ghci/prog-mhu005/prog-mhu005a.stderr
- + testsuite/tests/ghci/prog-mhu005/prog-mhu005a.stdout
- + testsuite/tests/ghci/prog-mhu005/unitA
- + testsuite/tests/ghci/prog-mhu005/unitB
- + testsuite/tests/ghci/prog021/all.T
- − testsuite/tests/ghci/prog021/prog021.T
- testsuite/tests/ghci/prog021/prog021.script → testsuite/tests/ghci/prog021/prog021a.script
- testsuite/tests/ghci/prog021/prog021.stderr → testsuite/tests/ghci/prog021/prog021a.stderr
- testsuite/tests/ghci/prog021/prog021.stdout → testsuite/tests/ghci/prog021/prog021a.stdout
- + testsuite/tests/ghci/prog021/prog021b.script
- + testsuite/tests/ghci/prog021/prog021b.stderr
- + testsuite/tests/ghci/prog021/prog021b.stdout
- + testsuite/tests/ghci/prog022/A.hs
- + testsuite/tests/ghci/prog022/B.hs
- + testsuite/tests/ghci/prog022/Makefile
- + testsuite/tests/ghci/prog022/all.T
- + testsuite/tests/ghci/prog022/ghci.prog022a.script
- + testsuite/tests/ghci/prog022/ghci.prog022a.stderr
- + testsuite/tests/ghci/prog022/ghci.prog022a.stdout
- + testsuite/tests/ghci/prog022/ghci.prog022b.script
- + testsuite/tests/ghci/prog022/ghci.prog022b.stderr
- + testsuite/tests/ghci/prog022/ghci.prog022b.stdout
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/64d5508e22e6d718a5f6f5d722f525d…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/64d5508e22e6d718a5f6f5d722f525d…
You're receiving this email because of your account on gitlab.haskell.org.
1
0

24 Jun '25
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
e358e477 by Sylvain Henry at 2025-06-24T15:31:58-04:00
Bump stack resolver to use GHC 9.6.7
Cf #26139
- - - - -
2 changed files:
- hadrian/stack.yaml
- hadrian/stack.yaml.lock
Changes:
=====================================
hadrian/stack.yaml
=====================================
@@ -1,6 +1,6 @@
-# GHC's configure script reports that GHC versions 9.2 and greater are required
+# GHC's configure script reports that GHC versions 9.6 and greater are required
# to build GHC from source.
-resolver: lts-20.26 # GHC 9.2.8
+resolver: lts-22.44 # GHC 9.6.7
packages:
- '.'
=====================================
hadrian/stack.yaml.lock
=====================================
@@ -5,22 +5,57 @@
packages:
- completed:
- hackage: Cabal-3.10.1.0@sha256:6d11adf7847d9734e7b02785ff831b5a0d11536bfbcefd6634b2b08411c63c94,12316
+ hackage: Cabal-3.14.0.0@sha256:604ea78fd41acf5382d3578aad5e90d66065a823fca4207ed144ef209daf3c7f,13720
pantry-tree:
- sha256: 3d175ab2e29f17494599bf5844d0037d01fd04287ac5d50c5c788b0633a8ee6f
- size: 9223
+ sha256: 9bd496dbb7d0a1bc1e9147cedbede83003c86ceec66c06594fe292710618bc43
+ size: 12219
original:
- hackage: Cabal-3.10.1.0
+ hackage: Cabal-3.14.0.0
- completed:
- hackage: Cabal-syntax-3.10.1.0@sha256:bb835ebab577fd0f9c11dab96210dbb8d68ffc62652576f4b092563c345930e7,7434
+ hackage: Cabal-syntax-3.14.0.0@sha256:6cd7666c675c29981392d031a9ad402f578234b6195a304c886b84510b0c21cd,7380
pantry-tree:
- sha256: bb1e418f0eb0976bbf4f50491ef4f2b737121bb866e22d07cff1de91f199db7e
- size: 11052
+ sha256: 2aed3c4195554d93ed1e25c4bacdf8eb7f3e006622bbd17a2e27d4bd0de0cd32
+ size: 10977
original:
- hackage: Cabal-syntax-3.10.1.0
+ hackage: Cabal-syntax-3.14.0.0
+- completed:
+ hackage: directory-1.3.9.0@sha256:2490137bb7738bd79392959458ef5f276219ea5ba8a9a56d3e0b06315c1bb917,3307
+ pantry-tree:
+ sha256: cf35b0c2755674f913078c588c88fc169d928ce09f292c648af9f1dbc3167131
+ size: 3386
+ original:
+ hackage: directory-1.3.9.0
+- completed:
+ hackage: file-io-0.1.4@sha256:e3e1866eab82cb28f6a5f28507643da3987008b737e66a3c7398f39f16d824dc,3251
+ pantry-tree:
+ sha256: f5401e2f822eafa465b8c661303275ebcbfd6c0a34a9943379b8f580da64af03
+ size: 858
+ original:
+ hackage: file-io-0.1.4
+- completed:
+ hackage: filepath-1.4.300.2@sha256:24f794247fcb8d26388aaec87b8e3577649f462a744bb09f01e85a60a435d5ab,6128
+ pantry-tree:
+ sha256: 086c1298421eaf07ca46666938bcb750ccbdcf386410e7d597f76d313d3ce98c
+ size: 3998
+ original:
+ hackage: filepath-1.4.300.2
+- completed:
+ hackage: process-1.6.25.0@sha256:092ab61596e914d21983aa2e9206a74c4faa38a5a636446b5c954305821cb496,2749
+ pantry-tree:
+ sha256: bdab416d3c454ad716d4fab1ced490cc75330658c1c7c66a0b6f4b3e5125017b
+ size: 1790
+ original:
+ hackage: process-1.6.25.0
+- completed:
+ hackage: unix-2.8.5.1@sha256:3f702a252a313a7bcb56e3908a14e7f9f1b40e41b7bdc8ae8a9605a1a8686f06,9808
+ pantry-tree:
+ sha256: b961320db69795a16c4ef4eebb0a3e7ddbbbe506fa1e22dde95ee8d8501bfbe5
+ size: 5821
+ original:
+ hackage: unix-2.8.5.1
snapshots:
- completed:
- size: 650475
- url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/mast…
- sha256: 5a59b2a405b3aba3c00188453be172b85893cab8ebc352b1ef58b0eae5d248a2
- original: lts-20.26
+ sha256: 238fa745b64f91184f9aa518fe04bdde6552533d169b0da5256670df83a0f1a9
+ size: 721141
+ url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/mast…
+ original: lts-22.44
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e358e47756b455e167165950fb305b7…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e358e47756b455e167165950fb305b7…
You're receiving this email because of your account on gitlab.haskell.org.
1
0

24 Jun '25
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
4b748a99 by Teo Camarasu at 2025-06-24T15:31:07-04:00
template-haskell: improve changelog
stable -> more stable, just to clarify that this interface isn't fully stable.
errornously -> mistakenly: I typod this and also let's go for a simpler word
- - - - -
1 changed file:
- libraries/template-haskell/changelog.md
Changes:
=====================================
libraries/template-haskell/changelog.md
=====================================
@@ -12,9 +12,9 @@
`pragSpecInlED`.
* Remove the `Language.Haskell.TH.Lib.Internal` module. This module has long been deprecated, and exposes compiler internals.
- Users should use `Language.Haskell.TH.Lib` instead, which exposes a stable version of this API.
+ Users should use `Language.Haskell.TH.Lib` instead, which exposes a more stable version of this API.
- * Remove `addrToByteArrayName` and `addrToByteArray` from `Language.Haskell.TH.Syntax`. These were part of the implementation of the `Lift ByteArray` instance and were errornously exported because this module lacked an explicit export list. They have no usages on Hackage.
+ * Remove `addrToByteArrayName` and `addrToByteArray` from `Language.Haskell.TH.Syntax`. These were part of the implementation of the `Lift ByteArray` instance and were accidentally exported because this module lacked an explicit export list. They have no usages on Hackage.
## 2.23.0.0
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/4b748a9915835e00910c70300599ed6…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/4b748a9915835e00910c70300599ed6…
You're receiving this email because of your account on gitlab.haskell.org.
1
0

24 Jun '25
Cheng Shao pushed new branch wip/serialize-modbreaks at Glasgow Haskell Compiler / GHC
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/serialize-modbreaks
You're receiving this email because of your account on gitlab.haskell.org.
1
0

[Git][ghc/ghc][wip/az/ghc-cpp] 139 commits: Visible forall in GADTs (#25127)
by Alan Zimmerman (@alanz) 24 Jun '25
by Alan Zimmerman (@alanz) 24 Jun '25
24 Jun '25
Alan Zimmerman pushed to branch wip/az/ghc-cpp at Glasgow Haskell Compiler / GHC
Commits:
fbc0b92a by Vladislav Zavialov at 2025-06-22T04:25:16+03:00
Visible forall in GADTs (#25127)
Add support for visible dependent quantification `forall a -> t` in
types of data constructors, e.g.
data KindVal a where
K :: forall k.
forall (a::k) -> -- now allowed!
k ->
KindVal a
For details, see docs/users_guide/exts/required_type_arguments.rst,
which has gained a new subsection.
DataCon in compiler/GHC/Core/DataCon.hs
---------------------------------------
The main change in this patch is that DataCon, the Core representation
of a data constructor, now uses a different type to store user-written
type variable binders:
- dcUserTyVarBinders :: [InvisTVBinder]
+ dcUserTyVarBinders :: [TyVarBinder]
where
type TyVarBinder = VarBndr TyVar ForAllTyFlag
type InvisTVBinder = VarBndr TyVar Specificity
and
data Specificity = InferredSpec | SpecifiedSpec
data ForAllTyFlag = Invisible Specificity | Required
This change necessitates some boring, mechanical changes scattered
throughout the diff:
... is now used in place of ...
-----------------+---------------
TyVarBinder | InvisTVBinder
IfaceForAllBndr | IfaceForAllSpecBndr
Specified | SpecifiedSpec
Inferred | InferredSpec
mkForAllTys | mkInvisForAllTys
additionally,
tyVarSpecToBinders -- added or removed calls
ifaceForAllSpecToBndrs -- removed calls
Visibility casts in mkDataConRep
--------------------------------
Type abstractions in Core (/\a. e) always have type (forall a. t)
because coreTyLamForAllTyFlag = Specified. This is also true of data
constructor workers. So we may be faced with the following:
data con worker: (forall a. blah)
data con wrapper: (forall a -> blah)
In this case the wrapper must use a visibility cast (e |> ForAllCo ...)
with appropriately set fco_vis{L,R}. Relevant functions:
mkDataConRep in compiler/GHC/Types/Id/Make.hs
dataConUserTyVarBindersNeedWrapper in compiler/GHC/Core/DataCon.hs
mkForAllVisCos in compiler/GHC/Core/Coercion.hs
mkCoreTyLams in compiler/GHC/Core/Make.hs
mkWpForAllCast in compiler/GHC/Tc/Types/Evidence.hs
More specifically:
- dataConUserTyVarBindersNeedWrapper has been updated to answer "yes"
if there are visible foralls in the type of the data constructor.
- mkDataConRep now uses mkCoreTyLams to generate the big lambda
abstractions (/\a b c. e) in the data con wrapper.
- mkCoreTyLams is a variant of mkCoreLams that applies visibility casts
as needed. It similar in purpose to the pre-existing mkWpForAllCast,
so the common bits have been factored out into mkForAllVisCos.
ConDecl in compiler/Language/Haskell/Syntax/Decls.hs
----------------------------------------------------
The surface syntax representation of a data constructor declaration is
ConDecl. In accordance with the proposal, only GADT syntax is extended
with support for visible forall, so we are interested in ConDeclGADT.
ConDeclGADT's field con_bndrs has been renamed to con_outer_bndrs
and is now accompanied by con_inner_bndrs:
con_outer_bndrs :: XRec pass (HsOuterSigTyVarBndrs pass)
con_inner_bndrs :: [HsForAllTelescope pass]
Visible foralls always end up in con_inner_bndrs. The outer binders are
stored and processed separately to support implicit quantification and
the forall-or-nothing rule, a design established by HsSigType.
A side effect of this change is that even in absence of visible foralls,
GHC now permits multiple invisible foralls, e.g.
data T a where { MkT :: forall a b. forall c d. ... -> T a }
But of course, this is done in service of making at least some of these
foralls visible. The entire compiler front-end has been updated to deal
with con_inner_bndrs. See the following modified or added functions:
Parser:
mkGadtDecl in compiler/GHC/Parser/PostProcess.hs
splitLHsGadtTy in compiler/GHC/Hs/Type.hs
Pretty-printer:
pprConDecl in compiler/GHC/Hs/Decls.hs
pprHsForAllTelescope in compiler/GHC/Hs/Type.hs
Renamer:
rnConDecl in compiler/GHC/Rename/Module.hs
bindHsForAllTelescopes in compiler/GHC/Rename/HsType.hs
extractHsForAllTelescopes in compiler/GHC/Rename/HsType.hs
Type checker:
tcConDecl in compiler/GHC/Tc/TyCl.hs
tcGadtConTyVarBndrs in compiler/GHC/Tc/Gen/HsType.hs
Template Haskell
----------------
The TH AST is left unchanged for the moment to avoid breakage. An
attempt to quote or reify a data constructor declaration with visible
forall in its type will result an error:
data ThRejectionReason -- in GHC/HsToCore/Errors/Types.hs
= ...
| ThDataConVisibleForall -- new error constructor
However, as noted in the previous section, GHC now permits multiple
invisible foralls, and TH was updated accordingly. Updated code:
repC in compiler/GHC/HsToCore/Quote.hs
reifyDataCon in compiler/GHC/Tc/Gen/Splice.hs
ppr @Con in libraries/ghc-boot-th/GHC/Boot/TH/Ppr.hs
Pattern matching
----------------
Everything described above concerns data constructor declarations, but
what about their use sites? Now it is trickier to type check a pattern
match fn(Con a b c)=... because we can no longer assume that a,b,c are
all value arguments. Indeed, some or all of them may very well turn out
to be required type arguments.
To that end, see the changes to:
tcDataConPat in compiler/GHC/Tc/Gen/Pat.hs
splitConTyArgs in compiler/GHC/Tc/Gen/Pat.hs
and the new helpers split_con_ty_args, zip_pats_bndrs.
This is also the reason the TcRnTooManyTyArgsInConPattern error
constructor has been removed. The new code emits TcRnArityMismatch
or TcRnIllegalInvisibleTypePattern.
Summary
-------
DataCon, ConDecl, as well as all related functions have been updated to
support required type arguments in data constructors.
Test cases:
HieGadtConSigs GadtConSigs_th_dump1 GadtConSigs_th_pprint1
T25127_data T25127_data_inst T25127_infix
T25127_newtype T25127_fail_th_quote T25127_fail_arity
TyAppPat_Tricky
Co-authored-by: mniip <mniip(a)mniip.com>
- - - - -
ae003a3a by Teo Camarasu at 2025-06-23T05:21:48-04:00
linters: lint-whitespace: bump upper-bound for containers
The version of containers was bumped in https://gitlab.haskell.org/ghc/ghc/-/merge_requests/13989
- - - - -
9625de2b by Alan Zimmerman at 2025-06-23T18:33:24+01:00
GHC-CPP: first rough proof of concept
Processes
#define FOO
#ifdef FOO
x = 1
#endif
Into
[ITcppIgnored [L loc ITcppDefine]
,ITcppIgnored [L loc ITcppIfdef]
,ITvarid "x"
,ITequal
,ITinteger (IL {il_text = SourceText "1", il_neg = False, il_value = 1})
,ITcppIgnored [L loc ITcppEndif]
,ITeof]
In time, ITcppIgnored will be pushed into a comment
- - - - -
0c228b61 by Alan Zimmerman at 2025-06-23T18:33:24+01:00
Tidy up before re-visiting the continuation mechanic
- - - - -
7220c603 by Alan Zimmerman at 2025-06-23T18:33:24+01:00
Switch preprocessor to continuation passing style
Proof of concept, needs tidying up
- - - - -
55dcc836 by Alan Zimmerman at 2025-06-23T18:33:24+01:00
Small cleanup
- - - - -
da13d8b9 by Alan Zimmerman at 2025-06-23T18:33:24+01:00
Get rid of some cruft
- - - - -
d24ebdcd by Alan Zimmerman at 2025-06-23T18:33:24+01:00
Starting to integrate.
Need to get the pragma recognised and set
- - - - -
7cccb4fe by Alan Zimmerman at 2025-06-23T18:33:24+01:00
Make cppTokens extend to end of line, and process CPP comments
- - - - -
0cb0145d by Alan Zimmerman at 2025-06-23T18:33:24+01:00
Remove unused ITcppDefined
- - - - -
0e2c22e9 by Alan Zimmerman at 2025-06-23T18:33:24+01:00
Allow spaces between # and keyword for preprocessor directive
- - - - -
67dfc5f8 by Alan Zimmerman at 2025-06-23T18:33:24+01:00
Process CPP continuation lines
They are emited as separate ITcppContinue tokens.
Perhaps the processing should be more like a comment, and keep on
going to the end.
BUT, the last line needs to be slurped as a whole.
- - - - -
78c58755 by Alan Zimmerman at 2025-06-23T18:33:24+01:00
Accumulate CPP continuations, process when ready
Can be simplified further, we only need one CPP token
- - - - -
c6165a99 by Alan Zimmerman at 2025-06-23T18:33:24+01:00
Simplify Lexer interface. Only ITcpp
We transfer directive lines through it, then parse them from scratch
in the preprocessor.
- - - - -
5225dec2 by Alan Zimmerman at 2025-06-23T18:33:25+01:00
Deal with directive on last line, with no trailing \n
- - - - -
44717e01 by Alan Zimmerman at 2025-06-23T18:33:25+01:00
Start parsing and processing the directives
- - - - -
0696fe99 by Alan Zimmerman at 2025-06-23T18:33:25+01:00
Prepare for processing include files
- - - - -
e8486efd by Alan Zimmerman at 2025-06-23T18:33:25+01:00
Move PpState into PreProcess
And initParserState, initPragState too
- - - - -
239ec200 by Alan Zimmerman at 2025-06-23T18:33:25+01:00
Process nested include files
Also move PpState out of Lexer.x, so it is easy to evolve it in a ghci
session, loading utils/check-cpp/Main.hs
- - - - -
b036abde by Alan Zimmerman at 2025-06-23T18:33:25+01:00
Split into separate files
- - - - -
35d20b58 by Alan Zimmerman at 2025-06-23T18:33:25+01:00
Starting on expression parser.
But it hangs. Time for Text.Parsec.Expr
- - - - -
1316ac0f by Alan Zimmerman at 2025-06-23T18:33:25+01:00
Start integrating the ghc-cpp work
From https://github.com/alanz/ghc-cpp
- - - - -
90a72c90 by Alan Zimmerman at 2025-06-23T18:33:25+01:00
WIP
- - - - -
16ae009f by Alan Zimmerman at 2025-06-23T18:33:25+01:00
Fixup after rebase
- - - - -
ad48088b by Alan Zimmerman at 2025-06-23T18:33:25+01:00
WIP
- - - - -
fd4ca39b by Alan Zimmerman at 2025-06-23T18:33:25+01:00
Fixup after rebase, including all tests pass
- - - - -
17a746b4 by Alan Zimmerman at 2025-06-23T18:33:25+01:00
Change pragma usage to GHC_CPP from GhcCPP
- - - - -
023790f3 by Alan Zimmerman at 2025-06-23T18:33:25+01:00
Some comments
- - - - -
082a2f08 by Alan Zimmerman at 2025-06-23T18:33:25+01:00
Reformat
- - - - -
eb6ac737 by Alan Zimmerman at 2025-06-23T18:33:25+01:00
Delete unused file
- - - - -
8759e56f by Alan Zimmerman at 2025-06-23T18:33:25+01:00
Rename module Parse to ParsePP
- - - - -
42490e4f by Alan Zimmerman at 2025-06-23T18:33:25+01:00
Clarify naming in the parser
- - - - -
60891959 by Alan Zimmerman at 2025-06-23T18:33:25+01:00
WIP. Switching to alex/happy to be able to work in-tree
Since Parsec is not available
- - - - -
efb9029e by Alan Zimmerman at 2025-06-23T18:33:25+01:00
Layering is now correct
- GHC lexer, emits CPP tokens
- accumulated in Preprocessor state
- Lexed by CPP lexer, CPP command extracted, tokens concated with
spaces (to get rid of token pasting via comments)
- if directive lexed and parsed by CPP lexer/parser, and evaluated
- - - - -
f9040df6 by Alan Zimmerman at 2025-06-23T18:33:25+01:00
First example working
Loading Example1.hs into ghci, getting the right results
```
{-# LANGUAGE GHC_CPP #-}
module Example1 where
y = 3
x =
"hello"
"bye now"
foo = putStrLn x
```
- - - - -
a452cf9b by Alan Zimmerman at 2025-06-23T18:33:25+01:00
Rebase, and all tests pass except whitespace for generated parser
- - - - -
8ec90c01 by Alan Zimmerman at 2025-06-23T18:33:25+01:00
More plumbing. Ready for testing tomorrow.
- - - - -
02e48d73 by Alan Zimmerman at 2025-06-23T18:33:25+01:00
Proress. Renamed module State from Types
And at first blush it seems to handle preprocessor scopes properly.
- - - - -
3ddf8eb7 by Alan Zimmerman at 2025-06-23T18:33:25+01:00
Insert basic GHC version macros into parser
__GLASGOW_HASKELL__
__GLASGOW_HASKELL_FULL_VERSION__
__GLASGOW_HASKELL_PATCHLEVEL1__
__GLASGOW_HASKELL_PATCHLEVEL2__
- - - - -
e5caf95c by Alan Zimmerman at 2025-06-23T18:33:25+01:00
Re-sync check-cpp for easy ghci work
- - - - -
5864aad5 by Alan Zimmerman at 2025-06-23T18:33:25+01:00
Get rid of warnings
- - - - -
62a8a050 by Alan Zimmerman at 2025-06-23T18:33:25+01:00
Rework macro processing, in check-cpp
Macros kept at the top level, looked up via name, multiple arity
versions per name can be stored
- - - - -
48a4bc6c by Alan Zimmerman at 2025-06-23T18:33:25+01:00
WIP. Can crack arguments for #define
Next step it to crack out args in an expansion
- - - - -
02a00453 by Alan Zimmerman at 2025-06-23T18:33:25+01:00
WIP on arg parsing.
- - - - -
11be8320 by Alan Zimmerman at 2025-06-23T18:33:25+01:00
Progress. Still screwing up nested parens.
- - - - -
a8bfb2a9 by Alan Zimmerman at 2025-06-23T18:33:25+01:00
Seems to work, but has redundant code
- - - - -
623c5911 by Alan Zimmerman at 2025-06-23T18:33:25+01:00
Remove redundant code
- - - - -
8239ea99 by Alan Zimmerman at 2025-06-23T18:33:25+01:00
Reformat
- - - - -
7240e358 by Alan Zimmerman at 2025-06-23T18:33:25+01:00
Expand args, single pass
Still need to repeat until fixpoint
- - - - -
debfc2e8 by Alan Zimmerman at 2025-06-23T18:33:25+01:00
Fixed point expansion
- - - - -
cbfc797a by Alan Zimmerman at 2025-06-23T18:33:25+01:00
Sync the playground to compiler
- - - - -
56245469 by Alan Zimmerman at 2025-06-23T18:33:25+01:00
Working on dumping the GHC_CPP result
But We need to keep the BufSpan in a comment
- - - - -
35c012ff by Alan Zimmerman at 2025-06-23T18:33:25+01:00
Keep BufSpan in queued comments in GHC.Parser.Lexer
- - - - -
53cf2a2e by Alan Zimmerman at 2025-06-23T18:33:25+01:00
Getting close to being able to print the combined tokens
showing what is in and what is out
- - - - -
d148263f by Alan Zimmerman at 2025-06-23T18:33:26+01:00
First implementation of dumpGhcCpp.
Example output
First dumps all macros in the state, then the source, showing which
lines are in and which are out
------------------------------
- |#define FOO(A,B) A + B
- |#define FOO(A,B,C) A + B + C
- |#if FOO(1,FOO(3,4)) == 8
- |-- a comment
|x = 1
- |#else
- |x = 5
- |#endif
- - - - -
1a44cc0e by Alan Zimmerman at 2025-06-23T18:33:26+01:00
Clean up a bit
- - - - -
70d1268c by Alan Zimmerman at 2025-06-23T18:33:26+01:00
Add -ddump-ghc-cpp option and a test based on it
- - - - -
e5a07fa3 by Alan Zimmerman at 2025-06-23T18:33:26+01:00
Restore Lexer.x rules, we need them for continuation lines
- - - - -
29f7484d by Alan Zimmerman at 2025-06-23T18:33:26+01:00
Lexer.x: trying to sort out the span for continuations
- We need to match on \n at the end of the line
- We cannot simply back up for it
- - - - -
9e634da4 by Alan Zimmerman at 2025-06-23T18:33:26+01:00
Inserts predefined macros. But does not dump properly
Because the cpp tokens have a trailing newline
- - - - -
a438631a by Alan Zimmerman at 2025-06-23T18:33:26+01:00
Remove unnecessary LExer rules
We *need* the ones that explicitly match to the end of the line.
- - - - -
881cca4a by Alan Zimmerman at 2025-06-23T18:33:26+01:00
Generate correct span for ITcpp
Dump now works, except we do not render trailing `\` for continuation
lines. This is good enough for use in test output.
- - - - -
89947b39 by Alan Zimmerman at 2025-06-23T18:33:26+01:00
Reduce duplication in lexer
- - - - -
06ace60c by Alan Zimmerman at 2025-06-23T18:33:26+01:00
Tweaks
- - - - -
2c75ecc2 by Alan Zimmerman at 2025-06-23T18:33:26+01:00
Insert min_version predefined macros into state
The mechanism now works. Still need to flesh out the full set.
- - - - -
556589c8 by Alan Zimmerman at 2025-06-23T18:33:26+01:00
Trying my alternative pragma syntax.
It works, but dumpGhcCpp is broken, I suspect from the ITcpp token
span update.
- - - - -
1cf0c5fa by Alan Zimmerman at 2025-06-23T18:33:26+01:00
Pragma extraction now works, with both CPP and GHC_CPP
For the following
{-# LANGUAGE CPP #-}
#if __GLASGOW_HASKELL__ >= 913
{-# LANGUAGE GHC_CPP #-}
#endif
We will enable GHC_CPP only
- - - - -
ee84e1ba by Alan Zimmerman at 2025-06-23T18:33:26+01:00
Remove some tracing
- - - - -
a5ecb924 by Alan Zimmerman at 2025-06-23T18:33:26+01:00
Fix test exes for changes
- - - - -
b9f9e561 by Alan Zimmerman at 2025-06-23T18:33:26+01:00
For GHC_CPP tests, normalise config-time-based macros
- - - - -
3b4bb7d0 by Alan Zimmerman at 2025-06-23T18:33:26+01:00
WIP
- - - - -
51359193 by Alan Zimmerman at 2025-06-23T18:33:26+01:00
WIP again. What is wrong?
- - - - -
e25013ec by Alan Zimmerman at 2025-06-23T18:33:26+01:00
Revert to dynflags for normal not pragma lexing
- - - - -
edf5276b by Alan Zimmerman at 2025-06-23T18:33:26+01:00
Working on getting check-exact to work properly
- - - - -
f403c72e by Alan Zimmerman at 2025-06-23T18:33:26+01:00
Passes CppCommentPlacement test
- - - - -
fce7f837 by Alan Zimmerman at 2025-06-23T18:33:26+01:00
Starting on exact printing with GHC_CPP
While overriding normal CPP
- - - - -
1b7c033c by Alan Zimmerman at 2025-06-23T18:33:26+01:00
Correctly store CPP ignored tokens as comments
By populating the lexeme string in it, based on the bufpos
- - - - -
5e43cdea by Alan Zimmerman at 2025-06-23T18:33:26+01:00
WIP
- - - - -
c5c0b37f by Alan Zimmerman at 2025-06-23T18:33:26+01:00
Simplifying
- - - - -
679d4083 by Alan Zimmerman at 2025-06-23T18:33:26+01:00
Update the active state logic
- - - - -
a739e6dc by Alan Zimmerman at 2025-06-23T18:33:26+01:00
Work the new logic into the mainline code
- - - - -
4e329814 by Alan Zimmerman at 2025-06-23T18:33:26+01:00
Process `defined` operator
- - - - -
274e12ae by Alan Zimmerman at 2025-06-23T18:33:26+01:00
Manage lexer state while skipping tokens
There is very intricate layout-related state used when lexing. If a
CPP directive blanks out some tokens, store this state when the
blanking starts, and restore it when they are no longer being blanked.
- - - - -
104b8f1d by Alan Zimmerman at 2025-06-23T18:33:26+01:00
Track the last token buffer index, for ITCppIgnored
We need to attach the source being skipped in an ITCppIgnored token.
We cannot simply use its BufSpan as an index into the underlying
StringBuffer as it counts unicode chars, not bytes.
So we update the lexer state to store the starting StringBuffer
location for the last token, and use the already-stored length to
extract the correct portion of the StringBuffer being parsed.
- - - - -
b87d1014 by Alan Zimmerman at 2025-06-23T18:33:26+01:00
Process the ! operator in GHC_CPP expressions
- - - - -
9083f901 by Alan Zimmerman at 2025-06-23T18:33:26+01:00
Predefine a constant when GHC_CPP is being used.
- - - - -
b91f355f by Alan Zimmerman at 2025-06-23T18:33:26+01:00
WIP
- - - - -
de0b5aa2 by Alan Zimmerman at 2025-06-23T18:33:26+01:00
Skip lines directly in the lexer when required
- - - - -
e4fe6880 by Alan Zimmerman at 2025-06-23T18:33:26+01:00
Properly manage location when accepting tokens again
- - - - -
598371e3 by Alan Zimmerman at 2025-06-23T18:33:26+01:00
Seems to be working now, for Example9
- - - - -
19fe751b by Alan Zimmerman at 2025-06-23T18:33:26+01:00
Remove tracing
- - - - -
00ccbc1d by Alan Zimmerman at 2025-06-23T18:33:26+01:00
Fix parsing '*' in block comments
Instead of replacing them with '-'
- - - - -
f960dcec by Alan Zimmerman at 2025-06-23T18:33:26+01:00
Keep the trailing backslash in a ITcpp token
- - - - -
a490bd63 by Alan Zimmerman at 2025-06-23T18:33:26+01:00
Deal with only enabling one section of a group.
A group is an instance of a conditional introduced by
#if/#ifdef/#ifndef,
and ending at the final #endif, including intermediate #elsif sections
- - - - -
c99ff814 by Alan Zimmerman at 2025-06-23T18:33:26+01:00
Replace remaining identifiers with 0 when evaluating
As per the spec
- - - - -
a10efe09 by Alan Zimmerman at 2025-06-23T18:33:26+01:00
Snapshot before rebase
- - - - -
3d1a1b1b by Alan Zimmerman at 2025-06-23T18:33:26+01:00
Skip non-processed lines starting with #
- - - - -
d4fc27a9 by Alan Zimmerman at 2025-06-23T18:33:26+01:00
Export generateMacros so we can use it in ghc-exactprint
- - - - -
0f972a8a by Alan Zimmerman at 2025-06-23T18:33:26+01:00
Fix rebase
- - - - -
5287d2bd by Alan Zimmerman at 2025-06-23T18:33:26+01:00
Expose initParserStateWithMacrosString
- - - - -
a3f0e23c by Alan Zimmerman at 2025-06-23T18:33:26+01:00
Fix buggy lexer cppSkip
It was skipping all lines, not just ones prefixed by #
- - - - -
5f85b0e7 by Alan Zimmerman at 2025-06-23T18:33:27+01:00
Fix evaluation of && to use the correct operator
- - - - -
92ea7869 by Alan Zimmerman at 2025-06-23T18:33:27+01:00
Deal with closing #-} at the start of a line
- - - - -
9ad5ae59 by Alan Zimmerman at 2025-06-23T18:33:27+01:00
Add the MIN_VERSION_GLASGOW_HASKELL predefined macro
- - - - -
8d92338e by Alan Zimmerman at 2025-06-23T18:33:27+01:00
Include MIN_VERSION_GLASGOW_HASKELL in GhcCpp01.stderr
- - - - -
9e6d46a7 by Alan Zimmerman at 2025-06-23T18:33:27+01:00
Use a strict map for macro defines
- - - - -
e698e9ea by Alan Zimmerman at 2025-06-23T18:33:27+01:00
Process TIdentifierLParen
Which only matters at the start of #define
- - - - -
00facc82 by Alan Zimmerman at 2025-06-23T18:33:27+01:00
Do not provide TIdentifierLParen paren twice
- - - - -
e351fbed by Alan Zimmerman at 2025-06-23T18:33:27+01:00
Handle whitespace between identifier and '(' for directive only
- - - - -
30256b62 by Alan Zimmerman at 2025-06-23T18:33:27+01:00
Expose some Lexer bitmap manipulation helpers
- - - - -
63fdb781 by Alan Zimmerman at 2025-06-23T18:33:27+01:00
Deal with line pragmas as tokens
Blows up for dumpGhcCpp though
- - - - -
96b69aa1 by Alan Zimmerman at 2025-06-23T18:33:27+01:00
Allow strings delimited by a single quote too
- - - - -
6e62f419 by Alan Zimmerman at 2025-06-23T18:33:27+01:00
Allow leading whitespace on cpp directives
As per https://timsong-cpp.github.io/cppwp/n4140/cpp#1
- - - - -
97bf05e4 by Alan Zimmerman at 2025-06-23T18:33:27+01:00
Implement GHC_CPP undef
- - - - -
5c823128 by Alan Zimmerman at 2025-06-23T18:33:27+01:00
Sort out expansion of no-arg macros, in a context with args
And make the expansion bottom out, in the case of recursion
- - - - -
28c73f21 by Alan Zimmerman at 2025-06-23T18:33:27+01:00
Fix GhcCpp01 test
The LINE pragma stuff works in ghc-exactprint when specifically
setting flag to emit ITline_pragma tokens
- - - - -
16e291d6 by Alan Zimmerman at 2025-06-23T18:33:27+01:00
Process comments in CPP directives
- - - - -
5c31a66a by Alan Zimmerman at 2025-06-23T18:33:27+01:00
Correctly lex pragmas with finel #-} on a newline
- - - - -
af6c89b3 by Alan Zimmerman at 2025-06-23T18:33:27+01:00
Do not process CPP-style comments
- - - - -
ac6a6f2b by Alan Zimmerman at 2025-06-23T18:33:27+01:00
Allow cpp-style comments when GHC_CPP enabled
- - - - -
67266cd5 by Alan Zimmerman at 2025-06-23T18:33:27+01:00
Return other pragmas as cpp ignored when GHC_CPP active
- - - - -
162d77fd by Alan Zimmerman at 2025-06-23T18:33:27+01:00
Fix exactprinting default decl
- - - - -
17689987 by Alan Zimmerman at 2025-06-23T18:33:27+01:00
Reorganise getOptionsFromFile for use in ghc-exactprint
We want to be able to inject predefined macro definitions into the
parser preprocessor state for when we do a hackage roundtrip.
- - - - -
8ed49e2d by Alan Zimmerman at 2025-06-23T18:33:27+01:00
Tweak testing
- - - - -
54a3bd41 by Alan Zimmerman at 2025-06-23T18:33:27+01:00
Only allow unknown cpp pragmas with # in left margin
- - - - -
56c93232 by Alan Zimmerman at 2025-06-23T18:33:27+01:00
Require # against left margin for all GHC_CPP directives
- - - - -
eb6fd328 by Alan Zimmerman at 2025-06-23T18:33:27+01:00
Fix CPP directives appearing in pragmas
And add a test for error reporting for missing `#if`
- - - - -
94f2eca9 by Alan Zimmerman at 2025-06-23T18:33:27+01:00
Starting to report GHC_CPP errors using GHC machinery
- - - - -
04d4acfb by Alan Zimmerman at 2025-06-23T18:33:27+01:00
More GHC_CPP diagnostic results
- - - - -
c2e86d5d by Alan Zimmerman at 2025-06-23T18:33:27+01:00
WIP on converting error calls to GHC diagnostics in GHC_CPP
- - - - -
9cafc60c by Alan Zimmerman at 2025-06-23T18:33:27+01:00
Working on CPP diagnostic reporting
- - - - -
6c2b4b4c by Alan Zimmerman at 2025-06-23T18:33:27+01:00
Tweak some tests/lint warnings
- - - - -
69940b06 by Alan Zimmerman at 2025-06-23T18:33:27+01:00
More error reporting in Macro
- - - - -
2fef4fa7 by Alan Zimmerman at 2025-06-23T18:33:27+01:00
Some cleanups
- - - - -
6c6fb819 by Alan Zimmerman at 2025-06-23T18:33:27+01:00
Some cleanup
- - - - -
90d4eede by Alan Zimmerman at 2025-06-23T18:33:27+01:00
GHC_CPP: Working on improving error reporting
- - - - -
4175b3cc by Alan Zimmerman at 2025-06-23T18:33:27+01:00
Harvest some commonality
- - - - -
3d43d296 by Alan Zimmerman at 2025-06-23T18:33:27+01:00
Use PPM as Maybe inside PP
- - - - -
50267897 by Alan Zimmerman at 2025-06-23T18:33:27+01:00
Clean up a bit
- - - - -
162 changed files:
- compiler/GHC.hs
- compiler/GHC/Builtin/Types.hs
- compiler/GHC/Cmm/Lexer.x
- compiler/GHC/Cmm/Parser.y
- compiler/GHC/Cmm/Parser/Monad.hs
- compiler/GHC/Core/Coercion.hs
- compiler/GHC/Core/ConLike.hs
- compiler/GHC/Core/DataCon.hs
- compiler/GHC/Core/DataCon.hs-boot
- compiler/GHC/Core/Make.hs
- compiler/GHC/Core/PatSyn.hs
- compiler/GHC/Core/TyCo/Ppr.hs
- compiler/GHC/Core/TyCo/Rep.hs
- compiler/GHC/Driver/Backpack.hs
- compiler/GHC/Driver/Config/Parser.hs
- compiler/GHC/Driver/Downsweep.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/Main.hs
- compiler/GHC/Driver/Pipeline.hs
- compiler/GHC/Driver/Pipeline/Execute.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Hs/Decls.hs
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/Pat.hs
- compiler/GHC/Hs/Type.hs
- compiler/GHC/HsToCore/Errors/Ppr.hs
- compiler/GHC/HsToCore/Errors/Types.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/Iface/Decl.hs
- compiler/GHC/Iface/Ext/Ast.hs
- compiler/GHC/Iface/Syntax.hs
- compiler/GHC/Parser.hs-boot
- compiler/GHC/Parser.y
- compiler/GHC/Parser/Annotation.hs
- compiler/GHC/Parser/Errors/Ppr.hs
- compiler/GHC/Parser/Errors/Types.hs
- compiler/GHC/Parser/HaddockLex.x
- compiler/GHC/Parser/Header.hs
- compiler/GHC/Parser/Lexer.x
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Parser/PostProcess/Haddock.hs
- + compiler/GHC/Parser/PreProcess.hs
- + compiler/GHC/Parser/PreProcess/Eval.hs
- + compiler/GHC/Parser/PreProcess/Lexer.x
- + compiler/GHC/Parser/PreProcess/Macro.hs
- + compiler/GHC/Parser/PreProcess/ParsePP.hs
- + compiler/GHC/Parser/PreProcess/Parser.y
- + compiler/GHC/Parser/PreProcess/ParserM.hs
- + compiler/GHC/Parser/PreProcess/State.hs
- compiler/GHC/Parser/Utils.hs
- compiler/GHC/Rename/HsType.hs
- compiler/GHC/Rename/Module.hs
- compiler/GHC/SysTools/Cpp.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Gen/Head.hs
- compiler/GHC/Tc/Gen/HsType.hs
- compiler/GHC/Tc/Gen/Match.hs
- compiler/GHC/Tc/Gen/Pat.hs
- compiler/GHC/Tc/Gen/Splice.hs
- compiler/GHC/Tc/TyCl.hs
- compiler/GHC/Tc/TyCl/Build.hs
- compiler/GHC/Tc/TyCl/Utils.hs
- compiler/GHC/Tc/Types/Evidence.hs
- compiler/GHC/ThToHs.hs
- compiler/GHC/Types/Error/Codes.hs
- compiler/GHC/Types/Id/Make.hs
- compiler/GHC/Types/Var.hs-boot
- compiler/Language/Haskell/Syntax/Decls.hs
- compiler/Language/Haskell/Syntax/Pat.hs
- compiler/ghc.cabal.in
- docs/users_guide/9.14.1-notes.rst
- docs/users_guide/debugging.rst
- docs/users_guide/exts/gadt_syntax.rst
- docs/users_guide/exts/required_type_arguments.rst
- ghc/GHCi/UI.hs
- hadrian/src/Rules/SourceDist.hs
- hadrian/stack.yaml.lock
- libraries/ghc-boot-th/GHC/Boot/TH/Ppr.hs
- libraries/ghc-internal/src/GHC/Internal/LanguageExtensions.hs
- linters/lint-whitespace/lint-whitespace.cabal
- testsuite/tests/count-deps/CountDepsParser.stdout
- testsuite/tests/dependent/should_fail/T16326_Fail6.stderr
- testsuite/tests/driver/T4437.hs
- testsuite/tests/ghc-api/T11579.hs
- + testsuite/tests/ghc-cpp/GhcCpp01.hs
- + testsuite/tests/ghc-cpp/GhcCpp01.stderr
- + testsuite/tests/ghc-cpp/GhcCpp02.hs
- + testsuite/tests/ghc-cpp/GhcCpp02.stderr
- + testsuite/tests/ghc-cpp/all.T
- testsuite/tests/haddock/should_compile_flag_haddock/T17544.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/T17544_kw.stderr
- + testsuite/tests/hiefile/should_run/HieGadtConSigs.hs
- + testsuite/tests/hiefile/should_run/HieGadtConSigs.stdout
- testsuite/tests/hiefile/should_run/all.T
- testsuite/tests/interface-stability/template-haskell-exports.stdout
- testsuite/tests/parser/should_compile/DumpParsedAst.stderr
- testsuite/tests/parser/should_compile/DumpRenamedAst.stderr
- testsuite/tests/parser/should_compile/T15323.stderr
- + testsuite/tests/printer/CppCommentPlacement.hs
- testsuite/tests/printer/T18791.stderr
- + testsuite/tests/th/GadtConSigs_th_dump1.hs
- + testsuite/tests/th/GadtConSigs_th_dump1.stderr
- + testsuite/tests/th/GadtConSigs_th_pprint1.hs
- + testsuite/tests/th/GadtConSigs_th_pprint1.stderr
- testsuite/tests/th/T20868.stdout
- testsuite/tests/th/all.T
- testsuite/tests/typecheck/should_compile/T23739a.hs
- + testsuite/tests/typecheck/should_compile/TyAppPat_Tricky.hs
- testsuite/tests/typecheck/should_compile/all.T
- testsuite/tests/typecheck/should_fail/T20443b.stderr
- testsuite/tests/typecheck/should_fail/TyAppPat_TooMany.stderr
- + testsuite/tests/vdq-rta/should_compile/T25127_data.hs
- + testsuite/tests/vdq-rta/should_compile/T25127_data_inst.hs
- + testsuite/tests/vdq-rta/should_compile/T25127_infix.hs
- + testsuite/tests/vdq-rta/should_compile/T25127_newtype.hs
- testsuite/tests/vdq-rta/should_compile/all.T
- testsuite/tests/vdq-rta/should_fail/T24159_type_syntax_th_fail.script
- + testsuite/tests/vdq-rta/should_fail/T25127_fail_arity.hs
- + testsuite/tests/vdq-rta/should_fail/T25127_fail_arity.stderr
- + testsuite/tests/vdq-rta/should_fail/T25127_fail_th_quote.hs
- + testsuite/tests/vdq-rta/should_fail/T25127_fail_th_quote.stderr
- testsuite/tests/vdq-rta/should_fail/all.T
- + utils/check-cpp/.ghci
- + utils/check-cpp/.gitignore
- + utils/check-cpp/Eval.hs
- + utils/check-cpp/Example1.hs
- + utils/check-cpp/Example10.hs
- + utils/check-cpp/Example11.hs
- + utils/check-cpp/Example12.hs
- + utils/check-cpp/Example13.hs
- + utils/check-cpp/Example2.hs
- + utils/check-cpp/Example3.hs
- + utils/check-cpp/Example4.hs
- + utils/check-cpp/Example5.hs
- + utils/check-cpp/Example6.hs
- + utils/check-cpp/Example7.hs
- + utils/check-cpp/Example8.hs
- + utils/check-cpp/Example9.hs
- + utils/check-cpp/Lexer.x
- + utils/check-cpp/Macro.hs
- + utils/check-cpp/Main.hs
- + utils/check-cpp/ParsePP.hs
- + utils/check-cpp/ParseSimulate.hs
- + utils/check-cpp/Parser.y
- + utils/check-cpp/ParserM.hs
- + utils/check-cpp/PreProcess.hs
- + utils/check-cpp/README.md
- + utils/check-cpp/State.hs
- + utils/check-cpp/run.sh
- utils/check-exact/ExactPrint.hs
- utils/check-exact/Main.hs
- utils/check-exact/Parsers.hs
- utils/check-exact/Preprocess.hs
- utils/check-exact/Utils.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Hoogle.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs
- utils/haddock/haddock-api/src/Haddock/Convert.hs
- utils/haddock/haddock-api/src/Haddock/GhcUtils.hs
- utils/haddock/haddock-api/src/Haddock/Interface/Rename.hs
- utils/haddock/haddock-api/src/Haddock/Parser.hs
- utils/haddock/haddock-api/src/Haddock/Types.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/eadbe239c57c52d209ea58aa56e260…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/eadbe239c57c52d209ea58aa56e260…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
Ben Gamari pushed new branch wip/wasm-ffi-docs at Glasgow Haskell Compiler / GHC
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/wasm-ffi-docs
You're receiving this email because of your account on gitlab.haskell.org.
1
0

[Git][ghc/ghc][wip/T23109] 25 commits: MachRegs.h: Don't define NO_ARG_REGS when a XMM register is defined
by Simon Peyton Jones (@simonpj) 24 Jun '25
by Simon Peyton Jones (@simonpj) 24 Jun '25
24 Jun '25
Simon Peyton Jones pushed to branch wip/T23109 at Glasgow Haskell Compiler / GHC
Commits:
e64b3f16 by ARATA Mizuki at 2025-06-17T10:13:42+09:00
MachRegs.h: Don't define NO_ARG_REGS when a XMM register is defined
On i386, MAX_REAL_VANILLA_REG is 1, but MAX_REAL_XMM_REG is 4.
If we define NO_ARG_REGS on i386, programs that use SIMD vectors may segfault.
Closes #25985
A couple of notes on the BROKEN_TESTS field:
* This fixes the segfault from T25062_V16.
* The failure from T22187_run was fixed in an earlier commit (see #25561),
but BROKEN_TESTS was missed at that time. Now should be a good time to
mark it fixed.
- - - - -
3e7c6b4d by Matthew Pickering at 2025-06-18T15:34:04-04:00
Improve error messages when implicit lifting fails
This patch concerns programs which automatically try to fix level errors
by inserting `Lift`. For example:
```
foo x = [| x |]
~>
foo x = [| $(lift x) |]
```
Before, there were two problems with the message.
1. (#26031), the location of the error was reported as the whole
quotation.
2. (#26035), the message just mentions there is no Lift instance, but
gives no indicate why the user program needed a Lift instance in the
first place.
This problem is especially bad when you disable
`ImplicitStagePersistence`, so you just end up with a confusing "No
instance for" message rather than an error message about levels
This patch fixes both these issues.
Firstly, `PendingRnSplice` differentiates between a user-written splice
and an implicit lift. Then, the Lift instance is precisely requested
with a specific origin in the typechecker. If the instance fails to be
solved, the message is reported using the `TcRnBadlyLevelled`
constructor (like a normal level error).
Fixes #26031, #26035
- - - - -
44b8cee2 by Cheng Shao at 2025-06-18T15:34:46-04:00
testsuite: add T26120 marked as broken
- - - - -
894a04f3 by Cheng Shao at 2025-06-18T15:34:46-04:00
compiler: fix GHC.SysTools.Ar archive member size writing logic
This patch fixes a long-standing bug in `GHC.SysTools.Ar` that emits
the wrong archive member size in each archive header. It should encode
the exact length of the member payload, excluding any padding byte,
otherwise malformed archive that extracts a broken object with an
extra trailing byte could be created.
Apart from the in-tree `T26120` test, I've also created an out-of-tree
testsuite at https://github.com/TerrorJack/ghc-ar-quickcheck that
contains QuickCheck roundtrip tests for `GHC.SysTools.Ar`. With this
fix, simple roundtrip tests and `writeGNUAr`/GNU `ar` roundtrip test
passes. There might be more bugs lurking in here, but this patch is
still a critical bugfix already.
Fixes #26120 #22586.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
f677ab5f by Lauren Yim at 2025-06-18T15:35:37-04:00
fix some typos in the warnings page in the user guide
- - - - -
b968e1c1 by Rodrigo Mesquita at 2025-06-18T15:36:18-04:00
Add a frozen callstack to throwGhcException
Fixes #25956
- - - - -
a5e0c3a3 by fendor at 2025-06-18T15:36:59-04:00
Update using.rst to advertise full mhu support for GHCi
- - - - -
d3e60e97 by Ryan Scott at 2025-06-18T22:29:21-04:00
Deprecate -Wdata-kinds-tc, make DataKinds issues in typechecker become errors
!11314 introduced the `-Wdata-kinds-tc` warning as part of a fix for #22141.
This was a temporary stopgap measure to allow users who were accidentally
relying on code which needed the `DataKinds` extension in order to typecheck
without having to explicitly enable the extension.
Now that some amount of time has passed, this patch deprecates
`-Wdata-kinds-tc` and upgrades any `DataKinds`-related issues in the
typechecker (which were previously warnings) into errors.
- - - - -
fd5b5177 by Ryan Hendrickson at 2025-06-18T22:30:06-04:00
haddock: Add redact-type-synonyms pragma
`{-# OPTIONS_HADDOCK redact-type-synonyms #-}` pragma will hide the RHS
of type synonyms, and display the result kind instead, if the RHS
contains any unexported types.
- - - - -
fbc0b92a by Vladislav Zavialov at 2025-06-22T04:25:16+03:00
Visible forall in GADTs (#25127)
Add support for visible dependent quantification `forall a -> t` in
types of data constructors, e.g.
data KindVal a where
K :: forall k.
forall (a::k) -> -- now allowed!
k ->
KindVal a
For details, see docs/users_guide/exts/required_type_arguments.rst,
which has gained a new subsection.
DataCon in compiler/GHC/Core/DataCon.hs
---------------------------------------
The main change in this patch is that DataCon, the Core representation
of a data constructor, now uses a different type to store user-written
type variable binders:
- dcUserTyVarBinders :: [InvisTVBinder]
+ dcUserTyVarBinders :: [TyVarBinder]
where
type TyVarBinder = VarBndr TyVar ForAllTyFlag
type InvisTVBinder = VarBndr TyVar Specificity
and
data Specificity = InferredSpec | SpecifiedSpec
data ForAllTyFlag = Invisible Specificity | Required
This change necessitates some boring, mechanical changes scattered
throughout the diff:
... is now used in place of ...
-----------------+---------------
TyVarBinder | InvisTVBinder
IfaceForAllBndr | IfaceForAllSpecBndr
Specified | SpecifiedSpec
Inferred | InferredSpec
mkForAllTys | mkInvisForAllTys
additionally,
tyVarSpecToBinders -- added or removed calls
ifaceForAllSpecToBndrs -- removed calls
Visibility casts in mkDataConRep
--------------------------------
Type abstractions in Core (/\a. e) always have type (forall a. t)
because coreTyLamForAllTyFlag = Specified. This is also true of data
constructor workers. So we may be faced with the following:
data con worker: (forall a. blah)
data con wrapper: (forall a -> blah)
In this case the wrapper must use a visibility cast (e |> ForAllCo ...)
with appropriately set fco_vis{L,R}. Relevant functions:
mkDataConRep in compiler/GHC/Types/Id/Make.hs
dataConUserTyVarBindersNeedWrapper in compiler/GHC/Core/DataCon.hs
mkForAllVisCos in compiler/GHC/Core/Coercion.hs
mkCoreTyLams in compiler/GHC/Core/Make.hs
mkWpForAllCast in compiler/GHC/Tc/Types/Evidence.hs
More specifically:
- dataConUserTyVarBindersNeedWrapper has been updated to answer "yes"
if there are visible foralls in the type of the data constructor.
- mkDataConRep now uses mkCoreTyLams to generate the big lambda
abstractions (/\a b c. e) in the data con wrapper.
- mkCoreTyLams is a variant of mkCoreLams that applies visibility casts
as needed. It similar in purpose to the pre-existing mkWpForAllCast,
so the common bits have been factored out into mkForAllVisCos.
ConDecl in compiler/Language/Haskell/Syntax/Decls.hs
----------------------------------------------------
The surface syntax representation of a data constructor declaration is
ConDecl. In accordance with the proposal, only GADT syntax is extended
with support for visible forall, so we are interested in ConDeclGADT.
ConDeclGADT's field con_bndrs has been renamed to con_outer_bndrs
and is now accompanied by con_inner_bndrs:
con_outer_bndrs :: XRec pass (HsOuterSigTyVarBndrs pass)
con_inner_bndrs :: [HsForAllTelescope pass]
Visible foralls always end up in con_inner_bndrs. The outer binders are
stored and processed separately to support implicit quantification and
the forall-or-nothing rule, a design established by HsSigType.
A side effect of this change is that even in absence of visible foralls,
GHC now permits multiple invisible foralls, e.g.
data T a where { MkT :: forall a b. forall c d. ... -> T a }
But of course, this is done in service of making at least some of these
foralls visible. The entire compiler front-end has been updated to deal
with con_inner_bndrs. See the following modified or added functions:
Parser:
mkGadtDecl in compiler/GHC/Parser/PostProcess.hs
splitLHsGadtTy in compiler/GHC/Hs/Type.hs
Pretty-printer:
pprConDecl in compiler/GHC/Hs/Decls.hs
pprHsForAllTelescope in compiler/GHC/Hs/Type.hs
Renamer:
rnConDecl in compiler/GHC/Rename/Module.hs
bindHsForAllTelescopes in compiler/GHC/Rename/HsType.hs
extractHsForAllTelescopes in compiler/GHC/Rename/HsType.hs
Type checker:
tcConDecl in compiler/GHC/Tc/TyCl.hs
tcGadtConTyVarBndrs in compiler/GHC/Tc/Gen/HsType.hs
Template Haskell
----------------
The TH AST is left unchanged for the moment to avoid breakage. An
attempt to quote or reify a data constructor declaration with visible
forall in its type will result an error:
data ThRejectionReason -- in GHC/HsToCore/Errors/Types.hs
= ...
| ThDataConVisibleForall -- new error constructor
However, as noted in the previous section, GHC now permits multiple
invisible foralls, and TH was updated accordingly. Updated code:
repC in compiler/GHC/HsToCore/Quote.hs
reifyDataCon in compiler/GHC/Tc/Gen/Splice.hs
ppr @Con in libraries/ghc-boot-th/GHC/Boot/TH/Ppr.hs
Pattern matching
----------------
Everything described above concerns data constructor declarations, but
what about their use sites? Now it is trickier to type check a pattern
match fn(Con a b c)=... because we can no longer assume that a,b,c are
all value arguments. Indeed, some or all of them may very well turn out
to be required type arguments.
To that end, see the changes to:
tcDataConPat in compiler/GHC/Tc/Gen/Pat.hs
splitConTyArgs in compiler/GHC/Tc/Gen/Pat.hs
and the new helpers split_con_ty_args, zip_pats_bndrs.
This is also the reason the TcRnTooManyTyArgsInConPattern error
constructor has been removed. The new code emits TcRnArityMismatch
or TcRnIllegalInvisibleTypePattern.
Summary
-------
DataCon, ConDecl, as well as all related functions have been updated to
support required type arguments in data constructors.
Test cases:
HieGadtConSigs GadtConSigs_th_dump1 GadtConSigs_th_pprint1
T25127_data T25127_data_inst T25127_infix
T25127_newtype T25127_fail_th_quote T25127_fail_arity
TyAppPat_Tricky
Co-authored-by: mniip <mniip(a)mniip.com>
- - - - -
ae003a3a by Teo Camarasu at 2025-06-23T05:21:48-04:00
linters: lint-whitespace: bump upper-bound for containers
The version of containers was bumped in https://gitlab.haskell.org/ghc/ghc/-/merge_requests/13989
- - - - -
0fb37893 by Matthew Pickering at 2025-06-23T13:55:10-04:00
Move ModuleGraph into UnitEnv
The ModuleGraph is a piece of information associated with the
ExternalPackageState and HomeUnitGraph. Therefore we should store it
inside the HomeUnitEnv.
- - - - -
3bf6720e by soulomoon at 2025-06-23T13:55:52-04:00
Remove hptAllFamInstances usage during upsweep
Fixes #26118
This change eliminates the use of hptAllFamInstances during the upsweep phase,
as it could access non-below modules from the home package table.
The following updates were made:
* Updated checkFamInstConsistency to accept an explicit ModuleEnv FamInstEnv
parameter and removed the call to hptAllFamInstances.
* Adjusted hugInstancesBelow so we can construct ModuleEnv FamInstEnv
from its result,
* hptAllFamInstances and allFamInstances functions are removed.
- - - - -
83ee7b78 by Ben Gamari at 2025-06-24T05:02:07-04:00
configure: Don't force value of OTOOL, etc. if not present
Previously if `otool` and `install_name_tool` were not present they
would be overridden by `fp_settings.m4`. This logic was introduced in
4ff93292243888545da452ea4d4c1987f2343591 without explanation.
- - - - -
9329c9e1 by Ben Gamari at 2025-06-24T05:02:07-04:00
ghc-toolchain: Add support for otool, install_name_tool
Fixes part of ghc#23675.
- - - - -
25f5c998 by Ben Gamari at 2025-06-24T05:02:08-04:00
ghc-toolchain: Add support for llc, opt, llvm-as
Fixes #23675.
- - - - -
51d150dd by Rodrigo Mesquita at 2025-06-24T05:02:08-04:00
hadrian: Use settings-use-distro-mingw directly
The type `ToolchainSetting` only made sense when we had more settings to
fetch from the system config file. Even then "settings-use-distro-mingw"
is arguably not a toolchain setting.
With the fix for #23675, all toolchain tools were moved to the
`ghc-toolchain` `Toolchain` format. Therefore, we can inline
`settings-use-distro-mingw` accesses and delete `ToolchainSetting`.
- - - - -
dcf68a83 by Rodrigo Mesquita at 2025-06-24T05:02:08-04:00
configure: Check LlvmTarget exists for LlvmAsFlags
If LlvmTarget was empty, LlvmAsFlags would be just "--target=".
If it is empty now, simply keep LlvmAsFlags empty.
ghc-toolchain already does this right. This fix makes the two
configurations match up.
- - - - -
580a3353 by Ben Gamari at 2025-06-24T05:02:51-04:00
rts/linker/LoadArchive: Use bool
Improve type precision by using `bool` instead of `int` and `StgBool`.
- - - - -
76d1041d by Ben Gamari at 2025-06-24T05:02:51-04:00
rts/linker/LoadArchive: Don't rely on file extensions for identification
Previously archive members would be identified via their file extension,
as described in #13103. We now instead use a more principled approach,
relying on the magic number in the member's header.
As well, we refactor treatment of archive format detection to improve
code clarity and error handling.
Closes #13103.
- - - - -
23288511 by Simon Peyton Jones at 2025-06-24T11:23:11+01:00
Make injecting implicit bindings into its own pass
Previously we were injecting "impliicit bindings" (data constructor
worker and wrappers etc)
- both at the end of CoreTidy,
- and at the start of CorePrep
This is unpleasant and confusing. This patch puts it it its own pass,
addImplicitBinds, which runs between the two.
The function `GHC.CoreToStg.AddImplicitBinds.addImplicitBinds` now takes /all/
TyCons, not just the ones for algebraic data types. That change ripples
through to
- corePrepPgm
- doCodeGen
- byteCodeGen
All take [TyCon] which includes all TyCons
- - - - -
4ab5225b by Simon Peyton Jones at 2025-06-24T11:24:02+01:00
Implement unary classes
The big change is described exhaustively in
Note [Unary class magic] in GHC.Core.TyCon
Other changes
* We never unbox class dictionaries in worker/wrapper. This has been true for some
time now, but the logic is now centralised in functions in
GHC.Core.Opt.WorkWrap.Utils, namely `canUnboxTyCon`, and `canUnboxArg`
See Note [Do not unbox class dictionaries] in GHC.Core.Opt.WorkWrap.Utils.
* Refactored the `notWorthFloating` logic in GHc.Core.Opt.SetLevels.
I can't remember if I actually changed any behaviour here, but if so it's
only in a corner cases.
* Fixed a bug in `GHC.Core.TyCon.isEnumerationTyCon`, which was wrongly returning
True for (##).
* Remove redundant Role argument to `liftCoSubstWithEx`. It was always
Representational.
* I refactored evidence generation in the constraint solver:
* Made GHC.Tc.Types.Evidence contain better abstactions for evidence
generation.
* I deleted the file `GHC.Tc.Types.EvTerm` and merged its (small) contents
elsewhere. It wasn't paying its way.
* Made evidence for implicit parameters go via a proper abstraction.
Smaller things
* Rename `isDataTyCon` to `isBoxedDataTyCon`.
* GHC.Core.Corecion.liftCoSubstWithEx was only called with Representational role,
so I baked that into the function and removed the argument.
* Get rid of `GHC.Core.TyCon.tyConSingleAlgDataCon_maybe` in favour of calling
`not isNewTyCon` at the call sites; more explicit.
* Refatored `GHC.Core.TyCon.isInjectiveTyCon`; but I don't think I changed its
behaviour
* Moved `decomposeIPPred` to GHC.Core.Predicate
- - - - -
f67041ec by Simon Peyton Jones at 2025-06-24T15:26:34+01:00
Renaming around predicate types
.. we were (as it turned out) abstracting over
type-class selectors in SPECIALISATION rules!
- - - - -
edcdab2c by Simon Peyton Jones at 2025-06-24T15:26:34+01:00
Accept GHCi debugger output change
@alt-romes says this is fine
- - - - -
4e57e403 by Simon Peyton Jones at 2025-06-24T15:27:35+01:00
Small hacky fix to specUnfolding
...just using mkApps instead of mkCoreApps
(This part is likely to change again in a
future commit.)
- - - - -
276 changed files:
- .gitlab/generate-ci/gen_ci.hs
- .gitlab/jobs.yaml
- compiler/GHC.hs
- compiler/GHC/Builtin/Types.hs
- compiler/GHC/ByteCode/InfoTable.hs
- compiler/GHC/Core/Class.hs
- compiler/GHC/Core/Coercion.hs
- compiler/GHC/Core/ConLike.hs
- compiler/GHC/Core/DataCon.hs
- compiler/GHC/Core/DataCon.hs-boot
- compiler/GHC/Core/FamInstEnv.hs
- compiler/GHC/Core/Make.hs
- compiler/GHC/Core/Opt/Arity.hs
- compiler/GHC/Core/Opt/CprAnal.hs
- compiler/GHC/Core/Opt/DmdAnal.hs
- compiler/GHC/Core/Opt/OccurAnal.hs
- compiler/GHC/Core/Opt/Pipeline.hs
- compiler/GHC/Core/Opt/SetLevels.hs
- compiler/GHC/Core/Opt/WorkWrap/Utils.hs
- compiler/GHC/Core/PatSyn.hs
- compiler/GHC/Core/Predicate.hs
- compiler/GHC/Core/TyCo/Ppr.hs
- compiler/GHC/Core/TyCo/Rep.hs
- compiler/GHC/Core/TyCon.hs
- compiler/GHC/Core/Type.hs
- compiler/GHC/Core/Unfold.hs
- compiler/GHC/Core/Unfold/Make.hs
- compiler/GHC/Core/Utils.hs
- compiler/GHC/CoreToStg.hs
- + compiler/GHC/CoreToStg/AddImplicitBinds.hs
- compiler/GHC/CoreToStg/Prep.hs
- compiler/GHC/Driver/Backpack.hs
- compiler/GHC/Driver/Env.hs
- compiler/GHC/Driver/Env/Types.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/Main.hs
- compiler/GHC/Driver/Make.hs
- compiler/GHC/Driver/Pipeline/Execute.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Hs/Decls.hs
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/Pat.hs
- compiler/GHC/Hs/Type.hs
- compiler/GHC/HsToCore/Binds.hs
- compiler/GHC/HsToCore/Errors/Ppr.hs
- compiler/GHC/HsToCore/Errors/Types.hs
- compiler/GHC/HsToCore/Expr.hs
- compiler/GHC/HsToCore/Foreign/Call.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/Iface/Decl.hs
- compiler/GHC/Iface/Ext/Ast.hs
- compiler/GHC/Iface/Load.hs
- compiler/GHC/Iface/Syntax.hs
- compiler/GHC/Iface/Tidy.hs
- compiler/GHC/IfaceToCore.hs
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Parser/PostProcess/Haddock.hs
- compiler/GHC/Rename/HsType.hs
- compiler/GHC/Rename/Module.hs
- compiler/GHC/Rename/Splice.hs
- compiler/GHC/StgToByteCode.hs
- compiler/GHC/StgToCmm.hs
- compiler/GHC/SysTools/Ar.hs
- compiler/GHC/Tc/Errors.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Gen/Bind.hs
- compiler/GHC/Tc/Gen/Expr.hs
- compiler/GHC/Tc/Gen/Head.hs
- compiler/GHC/Tc/Gen/HsType.hs
- compiler/GHC/Tc/Gen/Match.hs
- compiler/GHC/Tc/Gen/Pat.hs
- compiler/GHC/Tc/Gen/Sig.hs
- compiler/GHC/Tc/Gen/Splice.hs
- compiler/GHC/Tc/Instance/Class.hs
- compiler/GHC/Tc/Instance/Family.hs
- compiler/GHC/Tc/Module.hs
- compiler/GHC/Tc/Solver.hs
- compiler/GHC/Tc/Solver/Default.hs
- compiler/GHC/Tc/Solver/Dict.hs
- compiler/GHC/Tc/Solver/Equality.hs
- compiler/GHC/Tc/Solver/Monad.hs
- compiler/GHC/Tc/Solver/Rewrite.hs
- compiler/GHC/Tc/Solver/Solve.hs
- compiler/GHC/Tc/TyCl.hs
- compiler/GHC/Tc/TyCl/Build.hs
- compiler/GHC/Tc/TyCl/Instance.hs
- compiler/GHC/Tc/TyCl/PatSyn.hs
- compiler/GHC/Tc/TyCl/Utils.hs
- − compiler/GHC/Tc/Types/EvTerm.hs
- compiler/GHC/Tc/Types/Evidence.hs
- compiler/GHC/Tc/Types/Origin.hs
- compiler/GHC/Tc/Utils/TcMType.hs
- compiler/GHC/Tc/Utils/TcType.hs
- compiler/GHC/Tc/Validity.hs
- compiler/GHC/ThToHs.hs
- compiler/GHC/Types/Demand.hs
- compiler/GHC/Types/Error/Codes.hs
- compiler/GHC/Types/Id.hs
- compiler/GHC/Types/Id/Make.hs
- compiler/GHC/Types/RepType.hs
- compiler/GHC/Types/TyThing.hs
- compiler/GHC/Types/Var.hs
- compiler/GHC/Types/Var.hs-boot
- compiler/GHC/Unit/Env.hs
- compiler/GHC/Unit/Home/Graph.hs
- compiler/GHC/Unit/Home/PackageTable.hs
- compiler/GHC/Utils/Panic.hs
- compiler/Language/Haskell/Syntax/Decls.hs
- compiler/Language/Haskell/Syntax/Pat.hs
- compiler/ghc.cabal.in
- distrib/configure.ac.in
- docs/users_guide/9.14.1-notes.rst
- docs/users_guide/exts/gadt_syntax.rst
- docs/users_guide/exts/required_type_arguments.rst
- docs/users_guide/using-warnings.rst
- docs/users_guide/using.rst
- ghc/GHCi/UI.hs
- hadrian/cfg/default.host.target.in
- hadrian/cfg/default.target.in
- hadrian/cfg/system.config.in
- hadrian/src/Builder.hs
- hadrian/src/Oracles/Setting.hs
- hadrian/src/Rules/Generate.hs
- hadrian/src/Settings/Builders/RunTest.hs
- libraries/ghc-boot-th/GHC/Boot/TH/Ppr.hs
- linters/lint-whitespace/lint-whitespace.cabal
- m4/fp_settings.m4
- m4/ghc_toolchain.m4
- m4/prep_target_file.m4
- rts/include/stg/MachRegs.h
- rts/linker/LoadArchive.c
- testsuite/tests/annotations/should_fail/annfail03.stderr
- testsuite/tests/annotations/should_fail/annfail09.stderr
- testsuite/tests/core-to-stg/T24124.stderr
- testsuite/tests/deSugar/should_compile/T2431.stderr
- testsuite/tests/dependent/should_fail/T16326_Fail6.stderr
- testsuite/tests/dmdanal/should_compile/T16029.stdout
- testsuite/tests/dmdanal/sigs/T21119.stderr
- testsuite/tests/dmdanal/sigs/T21888.stderr
- + testsuite/tests/ghc-api/T26120.hs
- + testsuite/tests/ghc-api/T26120.stdout
- testsuite/tests/ghc-api/all.T
- testsuite/tests/ghci.debugger/scripts/break011.stdout
- testsuite/tests/ghci.debugger/scripts/break024.stdout
- testsuite/tests/haddock/should_compile_flag_haddock/T17544.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/T17544_kw.stderr
- + testsuite/tests/hiefile/should_run/HieGadtConSigs.hs
- + testsuite/tests/hiefile/should_run/HieGadtConSigs.stdout
- testsuite/tests/hiefile/should_run/all.T
- testsuite/tests/indexed-types/should_compile/T2238.hs
- testsuite/tests/numeric/should_compile/T15547.stderr
- testsuite/tests/numeric/should_compile/T23907.stderr
- testsuite/tests/parser/should_compile/DumpParsedAst.stderr
- testsuite/tests/parser/should_compile/DumpRenamedAst.stderr
- testsuite/tests/parser/should_compile/T15323.stderr
- testsuite/tests/printer/T18791.stderr
- testsuite/tests/quasiquotation/qq001/qq001.stderr
- testsuite/tests/quasiquotation/qq002/qq002.stderr
- testsuite/tests/quasiquotation/qq003/qq003.stderr
- testsuite/tests/quasiquotation/qq004/qq004.stderr
- + testsuite/tests/quotes/LiftErrMsg.hs
- + testsuite/tests/quotes/LiftErrMsg.stderr
- + testsuite/tests/quotes/LiftErrMsgDefer.hs
- + testsuite/tests/quotes/LiftErrMsgDefer.stderr
- + testsuite/tests/quotes/LiftErrMsgTyped.hs
- + testsuite/tests/quotes/LiftErrMsgTyped.stderr
- testsuite/tests/quotes/T10384.stderr
- testsuite/tests/quotes/TH_localname.stderr
- testsuite/tests/quotes/all.T
- testsuite/tests/roles/should_compile/Roles14.stderr
- testsuite/tests/roles/should_compile/Roles3.stderr
- testsuite/tests/roles/should_compile/Roles4.stderr
- testsuite/tests/simplCore/should_compile/DataToTagFamilyScrut.stderr
- testsuite/tests/simplCore/should_compile/T15205.stderr
- testsuite/tests/simplCore/should_compile/T17366.stderr
- testsuite/tests/simplCore/should_compile/T17966.stderr
- testsuite/tests/simplCore/should_compile/T22309.stderr
- testsuite/tests/simplCore/should_compile/T22375DataFamily.stderr
- testsuite/tests/simplCore/should_compile/T23307.stderr
- testsuite/tests/simplCore/should_compile/T23307a.stderr
- testsuite/tests/simplCore/should_compile/T25389.stderr
- testsuite/tests/simplCore/should_compile/T25713.stderr
- testsuite/tests/simplCore/should_compile/T7360.stderr
- testsuite/tests/simplStg/should_compile/T15226b.stderr
- testsuite/tests/splice-imports/SI03.stderr
- testsuite/tests/splice-imports/SI05.stderr
- testsuite/tests/splice-imports/SI16.stderr
- testsuite/tests/splice-imports/SI18.stderr
- testsuite/tests/splice-imports/SI20.stderr
- testsuite/tests/splice-imports/SI25.stderr
- testsuite/tests/splice-imports/SI28.stderr
- testsuite/tests/splice-imports/SI31.stderr
- testsuite/tests/tcplugins/CtIdPlugin.hs
- + testsuite/tests/th/GadtConSigs_th_dump1.hs
- + testsuite/tests/th/GadtConSigs_th_dump1.stderr
- + testsuite/tests/th/GadtConSigs_th_pprint1.hs
- + testsuite/tests/th/GadtConSigs_th_pprint1.stderr
- testsuite/tests/th/T16976z.stderr
- testsuite/tests/th/T17820a.stderr
- testsuite/tests/th/T17820b.stderr
- testsuite/tests/th/T17820c.stderr
- testsuite/tests/th/T17820d.stderr
- testsuite/tests/th/T17820e.stderr
- testsuite/tests/th/T20868.stdout
- testsuite/tests/th/T23829_hasty.stderr
- testsuite/tests/th/T23829_hasty_b.stderr
- testsuite/tests/th/T5795.stderr
- testsuite/tests/th/all.T
- testsuite/tests/typecheck/should_compile/Makefile
- testsuite/tests/typecheck/should_compile/T12763.stderr
- testsuite/tests/typecheck/should_compile/T14774.stdout
- testsuite/tests/typecheck/should_compile/T18406b.stderr
- testsuite/tests/typecheck/should_compile/T18529.stderr
- + testsuite/tests/typecheck/should_compile/T20873c.hs
- − testsuite/tests/typecheck/should_compile/T22141a.stderr
- − testsuite/tests/typecheck/should_compile/T22141b.stderr
- − testsuite/tests/typecheck/should_compile/T22141c.stderr
- − testsuite/tests/typecheck/should_compile/T22141d.stderr
- − testsuite/tests/typecheck/should_compile/T22141e.stderr
- testsuite/tests/typecheck/should_compile/T23739a.hs
- + testsuite/tests/typecheck/should_compile/TyAppPat_Tricky.hs
- testsuite/tests/typecheck/should_compile/all.T
- testsuite/tests/typecheck/should_fail/T20443b.stderr
- − testsuite/tests/typecheck/should_fail/T20873c.hs
- − testsuite/tests/typecheck/should_fail/T20873c.stderr
- testsuite/tests/typecheck/should_compile/T22141a.hs → testsuite/tests/typecheck/should_fail/T22141a.hs
- testsuite/tests/typecheck/should_fail/T22141a.stderr
- testsuite/tests/typecheck/should_compile/T22141b.hs → testsuite/tests/typecheck/should_fail/T22141b.hs
- testsuite/tests/typecheck/should_fail/T22141b.stderr
- testsuite/tests/typecheck/should_compile/T22141c.hs → testsuite/tests/typecheck/should_fail/T22141c.hs
- testsuite/tests/typecheck/should_fail/T22141c.stderr
- testsuite/tests/typecheck/should_compile/T22141d.hs → testsuite/tests/typecheck/should_fail/T22141d.hs
- testsuite/tests/typecheck/should_fail/T22141d.stderr
- testsuite/tests/typecheck/should_compile/T22141e.hs → testsuite/tests/typecheck/should_fail/T22141e.hs
- testsuite/tests/typecheck/should_fail/T22141e.stderr
- testsuite/tests/typecheck/should_compile/T22141e_Aux.hs → testsuite/tests/typecheck/should_fail/T22141e_Aux.hs
- testsuite/tests/typecheck/should_fail/TyAppPat_TooMany.stderr
- testsuite/tests/typecheck/should_fail/all.T
- testsuite/tests/unboxedsums/unpack_sums_7.stdout
- + testsuite/tests/vdq-rta/should_compile/T25127_data.hs
- + testsuite/tests/vdq-rta/should_compile/T25127_data_inst.hs
- + testsuite/tests/vdq-rta/should_compile/T25127_infix.hs
- + testsuite/tests/vdq-rta/should_compile/T25127_newtype.hs
- testsuite/tests/vdq-rta/should_compile/all.T
- testsuite/tests/vdq-rta/should_fail/T23739_fail_case.hs
- testsuite/tests/vdq-rta/should_fail/T23739_fail_case.stderr
- testsuite/tests/vdq-rta/should_fail/T24159_type_syntax_th_fail.script
- + testsuite/tests/vdq-rta/should_fail/T25127_fail_arity.hs
- + testsuite/tests/vdq-rta/should_fail/T25127_fail_arity.stderr
- + testsuite/tests/vdq-rta/should_fail/T25127_fail_th_quote.hs
- + testsuite/tests/vdq-rta/should_fail/T25127_fail_th_quote.stderr
- testsuite/tests/vdq-rta/should_fail/all.T
- testsuite/tests/wasm/should_run/control-flow/LoadCmmGroup.hs
- testsuite/tests/wasm/should_run/control-flow/RunWasm.hs
- utils/check-exact/ExactPrint.hs
- utils/ghc-toolchain/exe/Main.hs
- utils/ghc-toolchain/src/GHC/Toolchain/Target.hs
- utils/haddock/CHANGES.md
- utils/haddock/doc/cheatsheet/haddocks.md
- utils/haddock/doc/markup.rst
- utils/haddock/haddock-api/src/Haddock/Backends/Hoogle.hs
- utils/haddock/haddock-api/src/Haddock/Backends/LaTeX.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
- utils/haddock/haddock-api/src/Haddock/Convert.hs
- utils/haddock/haddock-api/src/Haddock/GhcUtils.hs
- utils/haddock/haddock-api/src/Haddock/Interface.hs
- utils/haddock/haddock-api/src/Haddock/Interface/AttachInstances.hs
- utils/haddock/haddock-api/src/Haddock/Interface/Create.hs
- utils/haddock/haddock-api/src/Haddock/Interface/Rename.hs
- utils/haddock/haddock-api/src/Haddock/InterfaceFile.hs
- utils/haddock/haddock-api/src/Haddock/Types.hs
- + utils/haddock/html-test/ref/RedactTypeSynonyms.html
- + utils/haddock/html-test/src/RedactTypeSynonyms.hs
- + utils/haddock/latex-test/ref/RedactTypeSynonyms/RedactTypeSynonyms.tex
- + utils/haddock/latex-test/src/RedactTypeSynonyms/RedactTypeSynonyms.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/5e787061f1f0186ca7959f7c0ab1d1…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/5e787061f1f0186ca7959f7c0ab1d1…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
Simon Peyton Jones pushed to branch wip/T26115 at Glasgow Haskell Compiler / GHC
Commits:
ff3f98d1 by Simon Peyton Jones at 2025-06-24T16:16:23+01:00
More progress
- - - - -
7 changed files:
- compiler/GHC/HsToCore/Binds.hs
- compiler/GHC/Tc/Errors.hs
- compiler/GHC/Tc/Solver/Dict.hs
- compiler/GHC/Tc/Solver/InertSet.hs
- compiler/GHC/Tc/Solver/Monad.hs
- compiler/GHC/Tc/Solver/Solve.hs
- compiler/GHC/Tc/Types/Evidence.hs
Changes:
=====================================
compiler/GHC/HsToCore/Binds.hs
=====================================
@@ -1181,8 +1181,8 @@ dsSpec_help poly_nm poly_id poly_rhs spec_inl orig_bndrs ds_call
mk_spec_body fn_body = mkLets (rn_binds ++ picked_binds) $
mkApps fn_body rule_lhs_args
- -- ToDo: not mkCoreApps! That uses exprType on fun which
- -- fails in specUnfolding, sigh
+ -- NB: not mkCoreApps! That uses exprType on fun
+ -- which fails in specUnfolding, sigh
poly_name = idName poly_id
spec_occ = mkSpecOcc (getOccName poly_name)
=====================================
compiler/GHC/Tc/Errors.hs
=====================================
@@ -622,7 +622,8 @@ reportWanteds ctxt tc_lvl wc@(WC { wc_simple = simples, wc_impl = implics
-- report2: we suppress these if there are insolubles elsewhere in the tree
report2 = [ ("Implicit params", is_ip, False, mkGroupReporter mkIPErr)
, ("Irreds", is_irred, False, mkGroupReporter mkIrredErr)
- , ("Dicts", is_dict, False, mkGroupReporter mkDictErr) ]
+ , ("Dicts", is_dict, False, mkGroupReporter mkDictErr)
+ , ("Quantified", is_qc, False, mkGroupReporter mkQCErr) ]
-- report3: suppressed errors should be reported as categorized by either report1
-- or report2. Keep this in sync with the suppress function above
@@ -681,6 +682,9 @@ reportWanteds ctxt tc_lvl wc@(WC { wc_simple = simples, wc_impl = implics
is_irred _ (IrredPred {}) = True
is_irred _ _ = False
+ is_qc _ (ForAllPred {}) = True
+ is_qc _ _ = False
+
-- See situation (1) of Note [Suppressing confusing errors]
is_ww_fundep item _ = is_ww_fundep_item item
is_ww_fundep_item = isWantedWantedFunDepOrigin . errorItemOrigin
@@ -2175,6 +2179,13 @@ Warn of loopy local equalities that were dropped.
************************************************************************
-}
+mkQCErr :: HasDebugCallStack => SolverReportErrCtxt -> NonEmpty ErrorItem -> TcM SolverReport
+mkQCErr ctxt items
+ = do { let msg = mkPlainMismatchMsg $
+ CouldNotDeduce (getUserGivens ctxt) items Nothing
+ ; return $ important ctxt msg }
+
+
mkDictErr :: HasDebugCallStack => SolverReportErrCtxt -> NonEmpty ErrorItem -> TcM SolverReport
mkDictErr ctxt orig_items
= do { inst_envs <- tcGetInstEnvs
@@ -2192,8 +2203,8 @@ mkDictErr ctxt orig_items
; return $
SolverReport
{ sr_important_msg = SolverReportWithCtxt ctxt err
- , sr_supplementary =
- [ SupplementaryImportErrors imps | imps <- maybeToList (NE.nonEmpty imp_errs) ]
+ , sr_supplementary = [ SupplementaryImportErrors imps
+ | imps <- maybeToList (NE.nonEmpty imp_errs) ]
, sr_hints = hints
}
}
=====================================
compiler/GHC/Tc/Solver/Dict.hs
=====================================
@@ -701,7 +701,12 @@ and Given/instance fundeps entirely.
tryInertDicts :: DictCt -> SolverStage ()
tryInertDicts dict_ct
= Stage $ do { inerts <- getInertCans
- ; try_inert_dicts inerts dict_ct }
+ ; mode <- getTcSMode
+ -- In TcSSpecPrag mode we do not look at Givens; that's the point
+ -- Looking at Wanteds would be OK but no real benefit
+ ; case mode of
+ TcSSpecPrag -> continueWith ()
+ _other -> try_inert_dicts inerts dict_ct }
try_inert_dicts :: InertCans -> DictCt -> TcS (StopOrContinue ())
try_inert_dicts inerts dict_w@(DictCt { di_ev = ev_w, di_cls = cls, di_tys = tys })
@@ -767,22 +772,15 @@ tryShortCutSolver try_short_cut dict_w@(DictCt { di_ev = ev_w })
-- Enabled by the -fsolve-constant-dicts flag
-> tryTcS $ -- tryTcS tries to completely solve some contraints
+ -- Inherit the current solved_dicts, so that one invocation of
+ -- tryShortCutSolver can benefit from the work of earlier invocations
setTcSMode TcSSpecPrag $
- do { updInertSet zap_cans
- ; solveSimpleWanteds (unitBag (CDictCan dict_w)) }
+ do { wc <- solveSimpleWanteds (unitBag (CDictCan dict_w))
+ ; return (isSolvedWC wc) }
| otherwise
-> return False }
- where
- zap_cans :: InertSet -> InertSet
- -- Zap the inert Givens (so we don't try to use them for solving)
- -- and any inert Wanteds (no harm but not much benefit either.
- -- But preserve the current solved_dicts, so that one invocation of
- -- tryShortCutSolver can benefit from the work of earlier invocations
- zap_cans inerts@(IS { inert_cans = cans })
- = inerts { inert_cans = emptyInertCans (inert_given_eq_lvl cans) }
-
{- *******************************************************************
* *
=====================================
compiler/GHC/Tc/Solver/InertSet.hs
=====================================
@@ -27,7 +27,6 @@ module GHC.Tc.Solver.InertSet (
foldTyEqs, delEq, findEq,
partitionInertEqs, partitionFunEqs,
filterInertEqs, filterFunEqs,
- inertGivens,
foldFunEqs, addEqToCans,
-- * Inert Dicts
@@ -347,6 +346,10 @@ data InertSet
-- Canonical Given, Wanted
-- Sometimes called "the inert set"
+ , inert_givens :: InertCans
+ -- A subset of inert_cans, containing only Givens
+ -- Used to initialise inert_cans when recursing inside implications
+
, inert_cycle_breakers :: CycleBreakerVarStack
, inert_famapp_cache :: FunEqMap Reduction
@@ -399,11 +402,14 @@ emptyInertCans given_eq_lvl
emptyInertSet :: TcLevel -> InertSet
emptyInertSet given_eq_lvl
- = IS { inert_cans = emptyInertCans given_eq_lvl
+ = IS { inert_cans = empty_cans
+ , inert_givens = empty_cans
, inert_cycle_breakers = emptyBag :| []
, inert_famapp_cache = emptyFunEqs
, inert_solved_dicts = emptyDictMap
- , inert_safehask = emptyDictMap }
+ , inert_safehask = emptyDictMap }
+ where
+ empty_cans = emptyInertCans given_eq_lvl
{- Note [Solved dictionaries]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -2129,43 +2135,3 @@ Wrong! The level-check ensures that the inner implicit parameter wins.
that this chain of events won't happen, but that's very fragile.)
-}
-{- *********************************************************************
-* *
- Extracting Givens from the inert set
-* *
-********************************************************************* -}
-
-
--- | Extract only Given constraints from the inert set.
-inertGivens :: InertSet -> InertSet
-inertGivens is@(IS { inert_cans = cans, inert_safehask = safehask }) =
- is { inert_cans = givens_cans
- , inert_safehask = safehask_givens
- , inert_solved_dicts = emptyDictMap
- }
- where
-
- isGivenEq :: EqCt -> Bool
- isGivenEq eq = isGiven (ctEvidence (CEqCan eq))
- isGivenDict :: DictCt -> Bool
- isGivenDict dict = isGiven (ctEvidence (CDictCan dict))
- isGivenIrred :: IrredCt -> Bool
- isGivenIrred irred = isGiven (ctEvidence (CIrredCan irred))
-
- -- Filter the inert constraints for Givens
- (eq_givens_list, _) = partitionInertEqs isGivenEq (inert_eqs cans)
- (funeq_givens_list, _) = partitionFunEqs isGivenEq (inert_funeqs cans)
- dict_givens = filterDicts isGivenDict (inert_dicts cans)
- safehask_givens = filterDicts isGivenDict safehask
- irreds_givens = filterBag isGivenIrred (inert_irreds cans)
-
- eq_givens = foldr addInertEqs emptyTyEqs eq_givens_list
- funeq_givens = foldr addFunEqs emptyFunEqs funeq_givens_list
-
- givens_cans =
- cans
- { inert_eqs = eq_givens
- , inert_funeqs = funeq_givens
- , inert_dicts = dict_givens
- , inert_irreds = irreds_givens
- }
=====================================
compiler/GHC/Tc/Solver/Monad.hs
=====================================
@@ -1293,27 +1293,21 @@ nestImplicTcS :: EvBindsVar
-> TcLevel -> TcS a
-> TcS a
nestImplicTcS ref inner_tclvl (TcS thing_inside)
- = TcS $ \ TcSEnv { tcs_unified = unified_var
- , tcs_inerts = old_inert_var
- , tcs_count = count
- , tcs_unif_lvl = unif_lvl
- , tcs_mode = mode
- } ->
+ = TcS $ \ env@(TcSEnv { tcs_inerts = old_inert_var }) ->
do { inerts <- TcM.readTcRef old_inert_var
+
+ -- Initialise the inert_cans from the inert_givens of the parent
+ -- so that the child is not polluted with the parent's inert Wanteds
; let nest_inert = inerts { inert_cycle_breakers = pushCycleBreakerVarStack
(inert_cycle_breakers inerts)
- , inert_cans = (inert_cans inerts)
+ , inert_cans = (inert_givens inerts)
{ inert_given_eqs = False } }
-- All other InertSet fields are inherited
; new_inert_var <- TcM.newTcRef nest_inert
; new_wl_var <- TcM.newTcRef emptyWorkList
- ; let nest_env = TcSEnv { tcs_count = count -- Inherited
- , tcs_unif_lvl = unif_lvl -- Inherited
- , tcs_ev_binds = ref
- , tcs_unified = unified_var
- , tcs_inerts = new_inert_var
- , tcs_mode = mode
- , tcs_worklist = new_wl_var }
+ ; let nest_env = env { tcs_ev_binds = ref
+ , tcs_inerts = new_inert_var
+ , tcs_worklist = new_wl_var }
; res <- TcM.setTcLevel inner_tclvl $
thing_inside nest_env
@@ -1339,6 +1333,7 @@ nestTcS (TcS thing_inside)
; new_wl_var <- TcM.newTcRef emptyWorkList
; let nest_env = env { tcs_inerts = new_inert_var
, tcs_worklist = new_wl_var }
+ -- Inherit tcs_ev_binds from caller
; res <- thing_inside nest_env
@@ -1347,18 +1342,17 @@ nestTcS (TcS thing_inside)
; return res }
-tryTcS :: TcS WantedConstraints -> TcS Bool
+tryTcS :: TcS Bool -> TcS Bool
-- Like nestTcS, but
-- (a) be a no-op if the nested computation returns Nothing
-- (b) if (but only if) success, propagate nested bindings to the caller
tryTcS (TcS thing_inside)
= TcS $ \ env@(TcSEnv { tcs_inerts = inerts_var
- , tcs_ev_binds = old_ev_binds_var
- , tcs_worklist = wl_var }) ->
+ , tcs_ev_binds = old_ev_binds_var }) ->
do { old_inerts <- TcM.readTcRef inerts_var
; new_inert_var <- TcM.newTcRef old_inerts
; new_wl_var <- TcM.newTcRef emptyWorkList
- ; new_ev_binds_var <- TcM.newTcEvBinds
+ ; new_ev_binds_var <- TcM.cloneEvBindsVar old_ev_binds_var
; let nest_env = env { tcs_ev_binds = new_ev_binds_var
, tcs_inerts = new_inert_var
, tcs_worklist = new_wl_var }
@@ -1367,10 +1361,10 @@ tryTcS (TcS thing_inside)
vcat [ text "old_ev_binds:" <+> ppr old_ev_binds_var
, text "new_ev_binds:" <+> ppr new_ev_binds_var
, ppr old_inerts ]
- ; wc <- thing_inside nest_env
- ; TcM.traceTc "tryTcS }" (ppr wc)
+ ; solved <- thing_inside nest_env
+ ; TcM.traceTc "tryTcS }" (ppr solved)
- ; if not (isSolvedWC wc)
+ ; if not solved
then return False
else do { -- Successfully solved
-- Add the new bindings to the existing ones
@@ -1382,17 +1376,12 @@ tryTcS (TcS thing_inside)
; TcM.traceTc "tryTcS update" (ppr (inert_solved_dicts new_inerts))
- -- We **must not** drop solved implications, due
- -- to Note [Free vars of EvFun] in GHC.Tc.Types.Evidence;
- -- so we re-emit them here.
- ; TcM.updTcRef wl_var (extendWorkListImplics (wc_impl wc))
-
; return True } }
updateInertsWith :: InertSet -> InertSet -> InertSet
-- Update the current inert set with bits from a nested solve,
-- that finished with a new inert set
--- In particular, propagage:
+-- In particular, propagate:
-- - solved dictionaires; see Note [Propagate the solved dictionaries]
-- - Safe Haskell failures
updateInertsWith current_inerts
=====================================
compiler/GHC/Tc/Solver/Solve.hs
=====================================
@@ -280,6 +280,20 @@ solveNestedImplications implics
; return unsolved_implics }
+trySolveImplication :: Implication -> TcS Bool
+trySolveImplication (Implic { ic_tclvl = tclvl
+ , ic_binds = ev_binds_var
+ , ic_given = given_ids
+ , ic_wanted = wanteds
+ , ic_env = ct_loc_env
+ , ic_info = info })
+ = nestImplicTcS ev_binds_var tclvl $
+ do { let loc = mkGivenLoc tclvl info ct_loc_env
+ givens = mkGivens loc given_ids
+ ; solveSimpleGivens givens
+ ; residual_wanted <- solveWanteds wanteds
+ ; return (isSolvedWC residual_wanted) }
+
solveImplication :: Implication -- Wanted
-> TcS Implication -- Simplified implication
-- Precondition: The TcS monad contains an empty worklist and given-only inerts
@@ -289,6 +303,7 @@ solveImplication imp@(Implic { ic_tclvl = tclvl
, ic_given = given_ids
, ic_wanted = wanteds
, ic_info = info
+ , ic_env = ct_loc_env
, ic_status = status })
| isSolvedStatus status
= return imp -- Do nothing
@@ -306,7 +321,7 @@ solveImplication imp@(Implic { ic_tclvl = tclvl
-- Solve the nested constraints
; (has_given_eqs, given_insols, residual_wanted)
<- nestImplicTcS ev_binds_var tclvl $
- do { let loc = mkGivenLoc tclvl info (ic_env imp)
+ do { let loc = mkGivenLoc tclvl info ct_loc_env
givens = mkGivens loc given_ids
; solveSimpleGivens givens
@@ -958,6 +973,11 @@ solveSimpleGivens givens
| otherwise
= do { traceTcS "solveSimpleGivens {" (ppr givens)
; go givens
+
+ -- Capture the Givens in the inert_givens of the inert set
+ -- for use by subsequent calls of nestImplicTcS
+ ; updInertSet (\is -> is { inert_givens = inert_cans is })
+
; traceTcS "End solveSimpleGivens }" empty }
where
go givens = do { solveSimples (listToBag givens)
@@ -1348,7 +1368,7 @@ solveWantedForAll qci tvs theta body_pred
; return ( wantedCtEvEvId wanted_ev
, unitBag (mkNonCanonical $ CtWanted wanted_ev)) }
- ; traceTcS "solveForAll" (ppr given_ev_vars $$ ppr wanteds $$ ppr w_id)
+ ; traceTcS "solveForAll {" (ppr skol_tvs $$ ppr given_ev_vars $$ ppr wanteds $$ ppr w_id)
; ev_binds_var <- TcS.newTcEvBinds
; solved <- trySolveImplication $
(implicationPrototype loc_env)
@@ -1359,6 +1379,7 @@ solveWantedForAll qci tvs theta body_pred
, ic_skols = skol_tvs
, ic_given = given_ev_vars
, ic_wanted = emptyWC { wc_simple = wanteds } }
+ ; traceTcS "sllveForAll }" (ppr solved)
; if not solved
then do { addInertForAll qci
; stopWith (CtWanted wtd) "Wanted forall-constraint:unsolved" }
@@ -1379,34 +1400,6 @@ solveWantedForAll qci tvs theta body_pred
ClassPred cls tys -> pSizeClassPred cls tys
_ -> pSizeType pred
-trySolveImplication :: Implication -> TcS Bool
-trySolveImplication imp
- = tryTcS $
- do { imp' <- solveImplication imp
- ; return (emptyWC { wc_impl = unitBag imp' }) }
- -- ToDo: this emptyWC bit is somewhat clumsy
-
-{-
-solveWantedForAll_spec :: WantedCtEvidence -> TcS (StopOrContinue Void)
--- Solve this implication constraint completely or not at all
-solveWantedForAll_spec wtd
- = do { traceTcS "solveWantedForAll {" (ppr wtd)
- ; fully_solved <- tryTcS (setTcSMode TcSVanilla $
- solveWanteds (mkSimpleWC [ev]))
- -- It's crucial to call solveWanteds here, not solveSimpleWanteds,
- -- because solving `ev` will land in solveWantedForAll_norm,
- -- which emits an implication, which we must then solve
- ; if fully_solved
- then do { traceTcS "solveWantedForAll: fully solved }" (ppr wtd)
- ; return $ Stop ev (text "Fully solved:" <+> ppr wtd) }
- else do { traceTcS "solveWantedForAll: not fully solved }" (ppr wtd)
- ; updInertIrreds (IrredCt ev IrredShapeReason)
- -- Stash the unsolved quantified constraint in the irreds
- ; return $ Stop ev (text "Not fully solved:" <+> ppr wtd) } }
- where
- ev = CtWanted wtd
--}
-
{- Note [Solving a Wanted forall-constraint]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Solving a wanted forall (quantified) constraint
=====================================
compiler/GHC/Tc/Types/Evidence.hs
=====================================
@@ -894,7 +894,7 @@ evVarsOfTypeable ev =
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Finding the free vars of an EvFun is made tricky by the fact the
bindings et_binds may be a mutable variable. Fortunately, we
-can just squeeze by. Here's how.
+ocan just squeeze by. Here's how.
* evVarsOfTerm is used only by GHC.Tc.Solver.neededEvVars.
* Each EvBindsVar in an et_binds field of an EvFun is /also/ in the
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ff3f98d14fdc75e6d7c9fca4685901c…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ff3f98d14fdc75e6d7c9fca4685901c…
You're receiving this email because of your account on gitlab.haskell.org.
1
0

[Git][ghc/ghc][wip/fendor/no-load] 22 commits: MachRegs.h: Don't define NO_ARG_REGS when a XMM register is defined
by Hannes Siebenhandl (@fendor) 24 Jun '25
by Hannes Siebenhandl (@fendor) 24 Jun '25
24 Jun '25
Hannes Siebenhandl pushed to branch wip/fendor/no-load at Glasgow Haskell Compiler / GHC
Commits:
e64b3f16 by ARATA Mizuki at 2025-06-17T10:13:42+09:00
MachRegs.h: Don't define NO_ARG_REGS when a XMM register is defined
On i386, MAX_REAL_VANILLA_REG is 1, but MAX_REAL_XMM_REG is 4.
If we define NO_ARG_REGS on i386, programs that use SIMD vectors may segfault.
Closes #25985
A couple of notes on the BROKEN_TESTS field:
* This fixes the segfault from T25062_V16.
* The failure from T22187_run was fixed in an earlier commit (see #25561),
but BROKEN_TESTS was missed at that time. Now should be a good time to
mark it fixed.
- - - - -
3e7c6b4d by Matthew Pickering at 2025-06-18T15:34:04-04:00
Improve error messages when implicit lifting fails
This patch concerns programs which automatically try to fix level errors
by inserting `Lift`. For example:
```
foo x = [| x |]
~>
foo x = [| $(lift x) |]
```
Before, there were two problems with the message.
1. (#26031), the location of the error was reported as the whole
quotation.
2. (#26035), the message just mentions there is no Lift instance, but
gives no indicate why the user program needed a Lift instance in the
first place.
This problem is especially bad when you disable
`ImplicitStagePersistence`, so you just end up with a confusing "No
instance for" message rather than an error message about levels
This patch fixes both these issues.
Firstly, `PendingRnSplice` differentiates between a user-written splice
and an implicit lift. Then, the Lift instance is precisely requested
with a specific origin in the typechecker. If the instance fails to be
solved, the message is reported using the `TcRnBadlyLevelled`
constructor (like a normal level error).
Fixes #26031, #26035
- - - - -
44b8cee2 by Cheng Shao at 2025-06-18T15:34:46-04:00
testsuite: add T26120 marked as broken
- - - - -
894a04f3 by Cheng Shao at 2025-06-18T15:34:46-04:00
compiler: fix GHC.SysTools.Ar archive member size writing logic
This patch fixes a long-standing bug in `GHC.SysTools.Ar` that emits
the wrong archive member size in each archive header. It should encode
the exact length of the member payload, excluding any padding byte,
otherwise malformed archive that extracts a broken object with an
extra trailing byte could be created.
Apart from the in-tree `T26120` test, I've also created an out-of-tree
testsuite at https://github.com/TerrorJack/ghc-ar-quickcheck that
contains QuickCheck roundtrip tests for `GHC.SysTools.Ar`. With this
fix, simple roundtrip tests and `writeGNUAr`/GNU `ar` roundtrip test
passes. There might be more bugs lurking in here, but this patch is
still a critical bugfix already.
Fixes #26120 #22586.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
f677ab5f by Lauren Yim at 2025-06-18T15:35:37-04:00
fix some typos in the warnings page in the user guide
- - - - -
b968e1c1 by Rodrigo Mesquita at 2025-06-18T15:36:18-04:00
Add a frozen callstack to throwGhcException
Fixes #25956
- - - - -
a5e0c3a3 by fendor at 2025-06-18T15:36:59-04:00
Update using.rst to advertise full mhu support for GHCi
- - - - -
d3e60e97 by Ryan Scott at 2025-06-18T22:29:21-04:00
Deprecate -Wdata-kinds-tc, make DataKinds issues in typechecker become errors
!11314 introduced the `-Wdata-kinds-tc` warning as part of a fix for #22141.
This was a temporary stopgap measure to allow users who were accidentally
relying on code which needed the `DataKinds` extension in order to typecheck
without having to explicitly enable the extension.
Now that some amount of time has passed, this patch deprecates
`-Wdata-kinds-tc` and upgrades any `DataKinds`-related issues in the
typechecker (which were previously warnings) into errors.
- - - - -
fd5b5177 by Ryan Hendrickson at 2025-06-18T22:30:06-04:00
haddock: Add redact-type-synonyms pragma
`{-# OPTIONS_HADDOCK redact-type-synonyms #-}` pragma will hide the RHS
of type synonyms, and display the result kind instead, if the RHS
contains any unexported types.
- - - - -
fbc0b92a by Vladislav Zavialov at 2025-06-22T04:25:16+03:00
Visible forall in GADTs (#25127)
Add support for visible dependent quantification `forall a -> t` in
types of data constructors, e.g.
data KindVal a where
K :: forall k.
forall (a::k) -> -- now allowed!
k ->
KindVal a
For details, see docs/users_guide/exts/required_type_arguments.rst,
which has gained a new subsection.
DataCon in compiler/GHC/Core/DataCon.hs
---------------------------------------
The main change in this patch is that DataCon, the Core representation
of a data constructor, now uses a different type to store user-written
type variable binders:
- dcUserTyVarBinders :: [InvisTVBinder]
+ dcUserTyVarBinders :: [TyVarBinder]
where
type TyVarBinder = VarBndr TyVar ForAllTyFlag
type InvisTVBinder = VarBndr TyVar Specificity
and
data Specificity = InferredSpec | SpecifiedSpec
data ForAllTyFlag = Invisible Specificity | Required
This change necessitates some boring, mechanical changes scattered
throughout the diff:
... is now used in place of ...
-----------------+---------------
TyVarBinder | InvisTVBinder
IfaceForAllBndr | IfaceForAllSpecBndr
Specified | SpecifiedSpec
Inferred | InferredSpec
mkForAllTys | mkInvisForAllTys
additionally,
tyVarSpecToBinders -- added or removed calls
ifaceForAllSpecToBndrs -- removed calls
Visibility casts in mkDataConRep
--------------------------------
Type abstractions in Core (/\a. e) always have type (forall a. t)
because coreTyLamForAllTyFlag = Specified. This is also true of data
constructor workers. So we may be faced with the following:
data con worker: (forall a. blah)
data con wrapper: (forall a -> blah)
In this case the wrapper must use a visibility cast (e |> ForAllCo ...)
with appropriately set fco_vis{L,R}. Relevant functions:
mkDataConRep in compiler/GHC/Types/Id/Make.hs
dataConUserTyVarBindersNeedWrapper in compiler/GHC/Core/DataCon.hs
mkForAllVisCos in compiler/GHC/Core/Coercion.hs
mkCoreTyLams in compiler/GHC/Core/Make.hs
mkWpForAllCast in compiler/GHC/Tc/Types/Evidence.hs
More specifically:
- dataConUserTyVarBindersNeedWrapper has been updated to answer "yes"
if there are visible foralls in the type of the data constructor.
- mkDataConRep now uses mkCoreTyLams to generate the big lambda
abstractions (/\a b c. e) in the data con wrapper.
- mkCoreTyLams is a variant of mkCoreLams that applies visibility casts
as needed. It similar in purpose to the pre-existing mkWpForAllCast,
so the common bits have been factored out into mkForAllVisCos.
ConDecl in compiler/Language/Haskell/Syntax/Decls.hs
----------------------------------------------------
The surface syntax representation of a data constructor declaration is
ConDecl. In accordance with the proposal, only GADT syntax is extended
with support for visible forall, so we are interested in ConDeclGADT.
ConDeclGADT's field con_bndrs has been renamed to con_outer_bndrs
and is now accompanied by con_inner_bndrs:
con_outer_bndrs :: XRec pass (HsOuterSigTyVarBndrs pass)
con_inner_bndrs :: [HsForAllTelescope pass]
Visible foralls always end up in con_inner_bndrs. The outer binders are
stored and processed separately to support implicit quantification and
the forall-or-nothing rule, a design established by HsSigType.
A side effect of this change is that even in absence of visible foralls,
GHC now permits multiple invisible foralls, e.g.
data T a where { MkT :: forall a b. forall c d. ... -> T a }
But of course, this is done in service of making at least some of these
foralls visible. The entire compiler front-end has been updated to deal
with con_inner_bndrs. See the following modified or added functions:
Parser:
mkGadtDecl in compiler/GHC/Parser/PostProcess.hs
splitLHsGadtTy in compiler/GHC/Hs/Type.hs
Pretty-printer:
pprConDecl in compiler/GHC/Hs/Decls.hs
pprHsForAllTelescope in compiler/GHC/Hs/Type.hs
Renamer:
rnConDecl in compiler/GHC/Rename/Module.hs
bindHsForAllTelescopes in compiler/GHC/Rename/HsType.hs
extractHsForAllTelescopes in compiler/GHC/Rename/HsType.hs
Type checker:
tcConDecl in compiler/GHC/Tc/TyCl.hs
tcGadtConTyVarBndrs in compiler/GHC/Tc/Gen/HsType.hs
Template Haskell
----------------
The TH AST is left unchanged for the moment to avoid breakage. An
attempt to quote or reify a data constructor declaration with visible
forall in its type will result an error:
data ThRejectionReason -- in GHC/HsToCore/Errors/Types.hs
= ...
| ThDataConVisibleForall -- new error constructor
However, as noted in the previous section, GHC now permits multiple
invisible foralls, and TH was updated accordingly. Updated code:
repC in compiler/GHC/HsToCore/Quote.hs
reifyDataCon in compiler/GHC/Tc/Gen/Splice.hs
ppr @Con in libraries/ghc-boot-th/GHC/Boot/TH/Ppr.hs
Pattern matching
----------------
Everything described above concerns data constructor declarations, but
what about their use sites? Now it is trickier to type check a pattern
match fn(Con a b c)=... because we can no longer assume that a,b,c are
all value arguments. Indeed, some or all of them may very well turn out
to be required type arguments.
To that end, see the changes to:
tcDataConPat in compiler/GHC/Tc/Gen/Pat.hs
splitConTyArgs in compiler/GHC/Tc/Gen/Pat.hs
and the new helpers split_con_ty_args, zip_pats_bndrs.
This is also the reason the TcRnTooManyTyArgsInConPattern error
constructor has been removed. The new code emits TcRnArityMismatch
or TcRnIllegalInvisibleTypePattern.
Summary
-------
DataCon, ConDecl, as well as all related functions have been updated to
support required type arguments in data constructors.
Test cases:
HieGadtConSigs GadtConSigs_th_dump1 GadtConSigs_th_pprint1
T25127_data T25127_data_inst T25127_infix
T25127_newtype T25127_fail_th_quote T25127_fail_arity
TyAppPat_Tricky
Co-authored-by: mniip <mniip(a)mniip.com>
- - - - -
ae003a3a by Teo Camarasu at 2025-06-23T05:21:48-04:00
linters: lint-whitespace: bump upper-bound for containers
The version of containers was bumped in https://gitlab.haskell.org/ghc/ghc/-/merge_requests/13989
- - - - -
0fb37893 by Matthew Pickering at 2025-06-23T13:55:10-04:00
Move ModuleGraph into UnitEnv
The ModuleGraph is a piece of information associated with the
ExternalPackageState and HomeUnitGraph. Therefore we should store it
inside the HomeUnitEnv.
- - - - -
3bf6720e by soulomoon at 2025-06-23T13:55:52-04:00
Remove hptAllFamInstances usage during upsweep
Fixes #26118
This change eliminates the use of hptAllFamInstances during the upsweep phase,
as it could access non-below modules from the home package table.
The following updates were made:
* Updated checkFamInstConsistency to accept an explicit ModuleEnv FamInstEnv
parameter and removed the call to hptAllFamInstances.
* Adjusted hugInstancesBelow so we can construct ModuleEnv FamInstEnv
from its result,
* hptAllFamInstances and allFamInstances functions are removed.
- - - - -
83ee7b78 by Ben Gamari at 2025-06-24T05:02:07-04:00
configure: Don't force value of OTOOL, etc. if not present
Previously if `otool` and `install_name_tool` were not present they
would be overridden by `fp_settings.m4`. This logic was introduced in
4ff93292243888545da452ea4d4c1987f2343591 without explanation.
- - - - -
9329c9e1 by Ben Gamari at 2025-06-24T05:02:07-04:00
ghc-toolchain: Add support for otool, install_name_tool
Fixes part of ghc#23675.
- - - - -
25f5c998 by Ben Gamari at 2025-06-24T05:02:08-04:00
ghc-toolchain: Add support for llc, opt, llvm-as
Fixes #23675.
- - - - -
51d150dd by Rodrigo Mesquita at 2025-06-24T05:02:08-04:00
hadrian: Use settings-use-distro-mingw directly
The type `ToolchainSetting` only made sense when we had more settings to
fetch from the system config file. Even then "settings-use-distro-mingw"
is arguably not a toolchain setting.
With the fix for #23675, all toolchain tools were moved to the
`ghc-toolchain` `Toolchain` format. Therefore, we can inline
`settings-use-distro-mingw` accesses and delete `ToolchainSetting`.
- - - - -
dcf68a83 by Rodrigo Mesquita at 2025-06-24T05:02:08-04:00
configure: Check LlvmTarget exists for LlvmAsFlags
If LlvmTarget was empty, LlvmAsFlags would be just "--target=".
If it is empty now, simply keep LlvmAsFlags empty.
ghc-toolchain already does this right. This fix makes the two
configurations match up.
- - - - -
580a3353 by Ben Gamari at 2025-06-24T05:02:51-04:00
rts/linker/LoadArchive: Use bool
Improve type precision by using `bool` instead of `int` and `StgBool`.
- - - - -
76d1041d by Ben Gamari at 2025-06-24T05:02:51-04:00
rts/linker/LoadArchive: Don't rely on file extensions for identification
Previously archive members would be identified via their file extension,
as described in #13103. We now instead use a more principled approach,
relying on the magic number in the member's header.
As well, we refactor treatment of archive format detection to improve
code clarity and error handling.
Closes #13103.
- - - - -
89a84dce by fendor at 2025-06-24T17:05:08+02:00
Teach `:reload` about multiple home units
`:reload` needs to lookup the `ModuleName` and must not assume the given
`ModuleName` is in the current `HomeUnit`.
We add a new utility function which allows us to find a `HomeUnitModule`
instead of a `Module`.
Further, we introduce the `GhciCommandError` type which can be used to
abort the execution of a GHCi command.
This error is caught and printed in a human readable fashion.
- - - - -
b4c44675 by fendor at 2025-06-24T17:05:39+02:00
Implement `-fno-load-initial-targets` flag
We add the new flag `-fno-load-initial-targets` which doesn't load all `Target`s
immediately but only computes the module graph for all `Target`s.
The user can then decide to load modules from that module graph using
the syntax:
ghci> :reload <Mod>
This will load everything in the module graph up to `Mod`.
The user can return to the initial state by using the builtin target
`none` to unload all modules.
ghci> :reload none
Is in principle identical to starting a new session with the
`-fno-load-initial-targets` flag.
The `-fno-load-initial-targets` flag allows for faster startup time of GHCi when a
user has lots of `Target`s.
We additionally extend the `:reload` command to accept multiple
`ModuleName`s. For example:
ghci> :reload <Mod1> <Mod2>
Loads all modules up to the modules `Mod1` and `Mod2`.
- - - - -
234 changed files:
- .gitlab/generate-ci/gen_ci.hs
- .gitlab/jobs.yaml
- compiler/GHC.hs
- compiler/GHC/Builtin/Types.hs
- compiler/GHC/Core/Coercion.hs
- compiler/GHC/Core/ConLike.hs
- compiler/GHC/Core/DataCon.hs
- compiler/GHC/Core/DataCon.hs-boot
- compiler/GHC/Core/Make.hs
- compiler/GHC/Core/Opt/Pipeline.hs
- compiler/GHC/Core/PatSyn.hs
- compiler/GHC/Core/TyCo/Ppr.hs
- compiler/GHC/Core/TyCo/Rep.hs
- compiler/GHC/Driver/Backpack.hs
- compiler/GHC/Driver/DynFlags.hs
- compiler/GHC/Driver/Env.hs
- compiler/GHC/Driver/Env/Types.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/Main.hs
- compiler/GHC/Driver/Make.hs
- compiler/GHC/Driver/Pipeline/Execute.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Hs/Decls.hs
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/Pat.hs
- compiler/GHC/Hs/Type.hs
- compiler/GHC/HsToCore/Errors/Ppr.hs
- compiler/GHC/HsToCore/Errors/Types.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/Iface/Decl.hs
- compiler/GHC/Iface/Ext/Ast.hs
- compiler/GHC/Iface/Load.hs
- compiler/GHC/Iface/Syntax.hs
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Parser/PostProcess/Haddock.hs
- compiler/GHC/Rename/HsType.hs
- compiler/GHC/Rename/Module.hs
- compiler/GHC/Rename/Splice.hs
- compiler/GHC/SysTools/Ar.hs
- compiler/GHC/Tc/Errors.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Gen/Head.hs
- compiler/GHC/Tc/Gen/HsType.hs
- compiler/GHC/Tc/Gen/Match.hs
- compiler/GHC/Tc/Gen/Pat.hs
- compiler/GHC/Tc/Gen/Splice.hs
- compiler/GHC/Tc/Instance/Family.hs
- compiler/GHC/Tc/Module.hs
- compiler/GHC/Tc/Solver/Monad.hs
- compiler/GHC/Tc/TyCl.hs
- compiler/GHC/Tc/TyCl/Build.hs
- compiler/GHC/Tc/TyCl/Utils.hs
- compiler/GHC/Tc/Types/Evidence.hs
- compiler/GHC/Tc/Types/Origin.hs
- compiler/GHC/Tc/Validity.hs
- compiler/GHC/ThToHs.hs
- compiler/GHC/Types/Error/Codes.hs
- compiler/GHC/Types/Id/Make.hs
- compiler/GHC/Types/Var.hs-boot
- compiler/GHC/Unit/Env.hs
- compiler/GHC/Unit/Home/Graph.hs
- compiler/GHC/Unit/Home/PackageTable.hs
- compiler/GHC/Unit/Module/Graph.hs
- compiler/GHC/Utils/Panic.hs
- compiler/Language/Haskell/Syntax/Decls.hs
- compiler/Language/Haskell/Syntax/Pat.hs
- distrib/configure.ac.in
- docs/users_guide/9.14.1-notes.rst
- docs/users_guide/exts/gadt_syntax.rst
- docs/users_guide/exts/required_type_arguments.rst
- docs/users_guide/ghci.rst
- docs/users_guide/using-warnings.rst
- docs/users_guide/using.rst
- ghc/GHCi/UI.hs
- ghc/GHCi/UI/Exception.hs
- ghc/GHCi/UI/Print.hs
- hadrian/cfg/default.host.target.in
- hadrian/cfg/default.target.in
- hadrian/cfg/system.config.in
- hadrian/src/Builder.hs
- hadrian/src/Oracles/Setting.hs
- hadrian/src/Rules/Generate.hs
- hadrian/src/Settings/Builders/RunTest.hs
- libraries/ghc-boot-th/GHC/Boot/TH/Ppr.hs
- linters/lint-whitespace/lint-whitespace.cabal
- m4/fp_settings.m4
- m4/ghc_toolchain.m4
- m4/prep_target_file.m4
- rts/include/stg/MachRegs.h
- rts/linker/LoadArchive.c
- testsuite/tests/annotations/should_fail/annfail03.stderr
- testsuite/tests/annotations/should_fail/annfail09.stderr
- testsuite/tests/dependent/should_fail/T16326_Fail6.stderr
- + testsuite/tests/ghc-api/T26120.hs
- + testsuite/tests/ghc-api/T26120.stdout
- testsuite/tests/ghc-api/all.T
- testsuite/tests/ghc-e/should_fail/T18441fail5.stderr
- testsuite/tests/ghci/prog-mhu003/prog-mhu003.stderr
- testsuite/tests/ghci/prog-mhu004/prog-mhu004a.stderr
- + testsuite/tests/ghci/prog-mhu005/Makefile
- + testsuite/tests/ghci/prog-mhu005/a/A.hs
- + testsuite/tests/ghci/prog-mhu005/all.T
- + testsuite/tests/ghci/prog-mhu005/b/B.hs
- + testsuite/tests/ghci/prog-mhu005/prog-mhu005a.script
- + testsuite/tests/ghci/prog-mhu005/prog-mhu005a.stderr
- + testsuite/tests/ghci/prog-mhu005/prog-mhu005a.stdout
- + testsuite/tests/ghci/prog-mhu005/unitA
- + testsuite/tests/ghci/prog-mhu005/unitB
- + testsuite/tests/ghci/prog021/A.hs
- + testsuite/tests/ghci/prog021/B.hs
- + testsuite/tests/ghci/prog021/Makefile
- + testsuite/tests/ghci/prog021/all.T
- + testsuite/tests/ghci/prog021/prog021a.script
- + testsuite/tests/ghci/prog021/prog021a.stderr
- + testsuite/tests/ghci/prog021/prog021a.stdout
- + testsuite/tests/ghci/prog021/prog021b.script
- + testsuite/tests/ghci/prog021/prog021b.stderr
- + testsuite/tests/ghci/prog021/prog021b.stdout
- + testsuite/tests/ghci/prog022/A.hs
- + testsuite/tests/ghci/prog022/B.hs
- + testsuite/tests/ghci/prog022/Makefile
- + testsuite/tests/ghci/prog022/all.T
- + testsuite/tests/ghci/prog022/ghci.prog022a.script
- + testsuite/tests/ghci/prog022/ghci.prog022a.stderr
- + testsuite/tests/ghci/prog022/ghci.prog022a.stdout
- + testsuite/tests/ghci/prog022/ghci.prog022b.script
- + testsuite/tests/ghci/prog022/ghci.prog022b.stderr
- + testsuite/tests/ghci/prog022/ghci.prog022b.stdout
- testsuite/tests/ghci/scripts/ghci021.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/T17544.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/T17544_kw.stderr
- + testsuite/tests/hiefile/should_run/HieGadtConSigs.hs
- + testsuite/tests/hiefile/should_run/HieGadtConSigs.stdout
- testsuite/tests/hiefile/should_run/all.T
- testsuite/tests/parser/should_compile/DumpParsedAst.stderr
- testsuite/tests/parser/should_compile/DumpRenamedAst.stderr
- testsuite/tests/parser/should_compile/T15323.stderr
- testsuite/tests/printer/T18791.stderr
- testsuite/tests/quasiquotation/qq001/qq001.stderr
- testsuite/tests/quasiquotation/qq002/qq002.stderr
- testsuite/tests/quasiquotation/qq003/qq003.stderr
- testsuite/tests/quasiquotation/qq004/qq004.stderr
- + testsuite/tests/quotes/LiftErrMsg.hs
- + testsuite/tests/quotes/LiftErrMsg.stderr
- + testsuite/tests/quotes/LiftErrMsgDefer.hs
- + testsuite/tests/quotes/LiftErrMsgDefer.stderr
- + testsuite/tests/quotes/LiftErrMsgTyped.hs
- + testsuite/tests/quotes/LiftErrMsgTyped.stderr
- testsuite/tests/quotes/T10384.stderr
- testsuite/tests/quotes/TH_localname.stderr
- testsuite/tests/quotes/all.T
- testsuite/tests/splice-imports/SI03.stderr
- testsuite/tests/splice-imports/SI05.stderr
- testsuite/tests/splice-imports/SI16.stderr
- testsuite/tests/splice-imports/SI18.stderr
- testsuite/tests/splice-imports/SI20.stderr
- testsuite/tests/splice-imports/SI25.stderr
- testsuite/tests/splice-imports/SI28.stderr
- testsuite/tests/splice-imports/SI31.stderr
- + testsuite/tests/th/GadtConSigs_th_dump1.hs
- + testsuite/tests/th/GadtConSigs_th_dump1.stderr
- + testsuite/tests/th/GadtConSigs_th_pprint1.hs
- + testsuite/tests/th/GadtConSigs_th_pprint1.stderr
- testsuite/tests/th/T16976z.stderr
- testsuite/tests/th/T17820a.stderr
- testsuite/tests/th/T17820b.stderr
- testsuite/tests/th/T17820c.stderr
- testsuite/tests/th/T17820d.stderr
- testsuite/tests/th/T17820e.stderr
- testsuite/tests/th/T20868.stdout
- testsuite/tests/th/T23829_hasty.stderr
- testsuite/tests/th/T23829_hasty_b.stderr
- testsuite/tests/th/T5795.stderr
- testsuite/tests/th/all.T
- + testsuite/tests/typecheck/should_compile/T20873c.hs
- − testsuite/tests/typecheck/should_compile/T22141a.stderr
- − testsuite/tests/typecheck/should_compile/T22141b.stderr
- − testsuite/tests/typecheck/should_compile/T22141c.stderr
- − testsuite/tests/typecheck/should_compile/T22141d.stderr
- − testsuite/tests/typecheck/should_compile/T22141e.stderr
- testsuite/tests/typecheck/should_compile/T23739a.hs
- + testsuite/tests/typecheck/should_compile/TyAppPat_Tricky.hs
- testsuite/tests/typecheck/should_compile/all.T
- testsuite/tests/typecheck/should_fail/T20443b.stderr
- − testsuite/tests/typecheck/should_fail/T20873c.hs
- − testsuite/tests/typecheck/should_fail/T20873c.stderr
- testsuite/tests/typecheck/should_compile/T22141a.hs → testsuite/tests/typecheck/should_fail/T22141a.hs
- testsuite/tests/typecheck/should_fail/T22141a.stderr
- testsuite/tests/typecheck/should_compile/T22141b.hs → testsuite/tests/typecheck/should_fail/T22141b.hs
- testsuite/tests/typecheck/should_fail/T22141b.stderr
- testsuite/tests/typecheck/should_compile/T22141c.hs → testsuite/tests/typecheck/should_fail/T22141c.hs
- testsuite/tests/typecheck/should_fail/T22141c.stderr
- testsuite/tests/typecheck/should_compile/T22141d.hs → testsuite/tests/typecheck/should_fail/T22141d.hs
- testsuite/tests/typecheck/should_fail/T22141d.stderr
- testsuite/tests/typecheck/should_compile/T22141e.hs → testsuite/tests/typecheck/should_fail/T22141e.hs
- testsuite/tests/typecheck/should_fail/T22141e.stderr
- testsuite/tests/typecheck/should_compile/T22141e_Aux.hs → testsuite/tests/typecheck/should_fail/T22141e_Aux.hs
- testsuite/tests/typecheck/should_fail/TyAppPat_TooMany.stderr
- testsuite/tests/typecheck/should_fail/all.T
- + testsuite/tests/vdq-rta/should_compile/T25127_data.hs
- + testsuite/tests/vdq-rta/should_compile/T25127_data_inst.hs
- + testsuite/tests/vdq-rta/should_compile/T25127_infix.hs
- + testsuite/tests/vdq-rta/should_compile/T25127_newtype.hs
- testsuite/tests/vdq-rta/should_compile/all.T
- testsuite/tests/vdq-rta/should_fail/T23739_fail_case.hs
- testsuite/tests/vdq-rta/should_fail/T23739_fail_case.stderr
- testsuite/tests/vdq-rta/should_fail/T24159_type_syntax_th_fail.script
- + testsuite/tests/vdq-rta/should_fail/T25127_fail_arity.hs
- + testsuite/tests/vdq-rta/should_fail/T25127_fail_arity.stderr
- + testsuite/tests/vdq-rta/should_fail/T25127_fail_th_quote.hs
- + testsuite/tests/vdq-rta/should_fail/T25127_fail_th_quote.stderr
- testsuite/tests/vdq-rta/should_fail/all.T
- utils/check-exact/ExactPrint.hs
- utils/ghc-toolchain/exe/Main.hs
- utils/ghc-toolchain/src/GHC/Toolchain/Target.hs
- utils/haddock/CHANGES.md
- utils/haddock/doc/cheatsheet/haddocks.md
- utils/haddock/doc/markup.rst
- utils/haddock/haddock-api/src/Haddock/Backends/Hoogle.hs
- utils/haddock/haddock-api/src/Haddock/Backends/LaTeX.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
- utils/haddock/haddock-api/src/Haddock/Convert.hs
- utils/haddock/haddock-api/src/Haddock/GhcUtils.hs
- utils/haddock/haddock-api/src/Haddock/Interface.hs
- utils/haddock/haddock-api/src/Haddock/Interface/AttachInstances.hs
- utils/haddock/haddock-api/src/Haddock/Interface/Create.hs
- utils/haddock/haddock-api/src/Haddock/Interface/Rename.hs
- utils/haddock/haddock-api/src/Haddock/InterfaceFile.hs
- utils/haddock/haddock-api/src/Haddock/Types.hs
- + utils/haddock/html-test/ref/RedactTypeSynonyms.html
- + utils/haddock/html-test/src/RedactTypeSynonyms.hs
- + utils/haddock/latex-test/ref/RedactTypeSynonyms/RedactTypeSynonyms.tex
- + utils/haddock/latex-test/src/RedactTypeSynonyms/RedactTypeSynonyms.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/ea100f163261ca8c40023c305d2943…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/ea100f163261ca8c40023c305d2943…
You're receiving this email because of your account on gitlab.haskell.org.
1
0