[Git][ghc/ghc][wip/sjakobi/ci-test-bootstrap-nightly-only] ci: Run test-bootstrap only in nightly and release pipelines
by Simon Jakobi (@sjakobi) 24 Nov '26
by Simon Jakobi (@sjakobi) 24 Nov '26
24 Nov '26
Simon Jakobi pushed to branch wip/sjakobi/ci-test-bootstrap-nightly-only at Glasgow Haskell Compiler / GHC
Commits:
d127eb37 by Simon Jakobi at 2026-11-24T10:53:57+01:00
ci: Run test-bootstrap only in nightly and release pipelines
This should save roughly 20–30 x86_64-linux runner-hours per day in MR
pipelines, Marge batches and master pushes.
test-bootstrap was added to full-ci pipelines and Marge batches in
5d45b92a9bd, after changes had twice broken building with GHC 9.2, then
the oldest supported boot compiler. Today, the validate jobs build with
the oldest supported one, 9.10, and test-bootstrap rarely fails on its
own.
The downside of this patch is that building with 9.12.2 and 9.14.1,
bootstrapping hadrian from the bootstrap plans and building from the
source tarball are tested only in nightly and release pipelines.
With the test-bootstrap label it's still possible to run it on an MR.
Assisted-by: Claude Fable 5.2
- - - - -
1 changed file:
- .gitlab-ci.yml
Changes:
=====================================
.gitlab-ci.yml
=====================================
@@ -710,7 +710,6 @@ source-tarball:
- if: $NIGHTLY
- if: '$RELEASE_JOB == "yes"'
- if: '$CI_MERGE_REQUEST_LABELS =~ /.*test-bootstrap.*/'
- - *full-ci
generate-hadrian-bootstrap-sources:
stage: full-build
@@ -731,7 +730,6 @@ generate-hadrian-bootstrap-sources:
- if: $NIGHTLY
- if: '$RELEASE_JOB == "yes"'
- if: '$CI_MERGE_REQUEST_LABELS =~ /.*test-bootstrap.*/'
- - *full-ci
package-hadrian-bootstrap-sources:
@@ -749,7 +747,6 @@ package-hadrian-bootstrap-sources:
- if: $NIGHTLY
- if: '$RELEASE_JOB == "yes"'
- if: '$CI_MERGE_REQUEST_LABELS =~ /.*test-bootstrap.*/'
- - *full-ci
test-bootstrap:
stage: full-build
@@ -789,7 +786,6 @@ test-bootstrap:
rules:
- if: $NIGHTLY
- if: '$CI_MERGE_REQUEST_LABELS =~ /.*test-bootstrap.*/'
- - *full-ci
- if: '$RELEASE_JOB == "yes"'
when: always
variables:
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d127eb37ada1f0744b28dc5e9634d1b…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d127eb37ada1f0744b28dc5e9634d1b…
You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1
0
[Git][ghc/ghc][wip/mangoiv/clone-shallow-default] 15 commits: NCG: List each destination of a jump table once
by Magnus (@MangoIV) 24 Nov '26
by Magnus (@MangoIV) 24 Nov '26
24 Nov '26
Magnus pushed to branch wip/mangoiv/clone-shallow-default at Glasgow Haskell Compiler / GHC
Commits:
01a5b0ac by Sylvain Henry at 2026-11-22T16:35:34-05:00
NCG: List each destination of a jump table once
jumpDestsOfInstr listed a block once per jump table entry that named
it. The linear register allocator makes a fixup block per listed
destination, so such a block got several fixup blocks. The patch of
the jump sends every entry to the first one. The other fixup blocks
were dead code, and the CFG had an edge to each of them.
jumpDestsOfInstr now lists each destination once, in every backend.
joinToTargets asserts it in debug builds.
Co-Authored-By: Claude Fable 5.1 <noreply(a)anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply(a)anthropic.com>
- - - - -
e4498112 by Andreas Klebinger at 2026-11-22T16:35:34-05:00
x86 ncg: Track the current block in NatM to keep the CFG in sync
The x86 NCG uses a CFG for code layout. When instruction selection
makes new blocks (word2Float#, cmpxchg loops, 64-bit shifts on i386),
it must add them to the CFG. Some sites did not. The CFG went out of
sync, the layout was bad, and the register allocator panicked when it
added fixup blocks (#27694, #27915).
NatM now keeps the current block in its state. Combinators update the
CFG and the current block together. See Note [Updating the CFG during
CodeGen] in GHC.CmmToAsm.Monad.
Other changes:
* -dasm-lint checks that the jumps in the code and the edges in the
CFG agree in both directions. This found a second desync: the CFG
did not follow the jumps that allocMoreStack retargets. The new
addPreentryBlock fixes it.
* The code must be emitted in generation order, because the CFG
records new blocks in that order. A store now generates the code of
its value before the code of its address, in the order it emits
them. Atomic operations take their address from the new
getNonClobberedAmode, so the code of their other operands cannot
clobber it.
Fixes #27694, #27915
Co-authored-by: Sylvain Henry <sylvain(a)haskus.fr>
Co-Authored-By: Claude Fable 5.1 <noreply(a)anthropic.com>
- - - - -
f59fb957 by Sylvain Henry at 2026-11-22T16:35:34-05:00
x86 ncg: Maintain the CFG on i386
The i386 NCG now keeps its CFG in sync with the code (see the previous
commit), so backendMaintainsCfg is now True for i386. i386 gets the
CFG based code layout, dead code elimination and the -dasm-lint check,
like x86-64.
The compiler allocates more on i386: the CFG now goes through the
register allocator, branch shortcutting and optimizeCFG, which i386
skipped before. x86-64 already does this work.
Metric Increase:
CoOpt_Read
ManyAlternatives
T10421
T12425
T12707
T13056
T13253
T13253-spj
T13960
T15164
T15304
T15630
T15630a
T15703
T16577
T17516
T17836
T18140
T18282
T18304
T18698a
T18698b
T18730
T18923
T19695
T20049
T21839c
T24471
T26425
T26989
T5642
T6048
T783
T9233
T9630
Co-Authored-By: Claude Opus 5.5 <noreply(a)anthropic.com>
- - - - -
2091b89a by fendor at 2026-11-22T16:36:17-05:00
`ghc -M`: Add support for link nodes to json output
`LinkNode`s are part of the module graph and indicate that a certain
linking artefact is to be produced from other module graph nodes.
We expose `LinkNode`s in the output of `ghc -M -dep-json`, allowing
consumers to see when a linking artefact is to be produced.
Only the JSON output format of `ghc -M` supports `LinkNode` as it is
unclear how the Makefile output should be retrofitted to express the
dependencies, and whether it would require a feature guard.
Closes #28007
- - - - -
cfd4fb67 by Ryan Scott at 2026-11-22T16:36:59-05:00
GHC.HsToCore.Quote: Quote \cases with the correct type
Previously, `\cases` expressions inside of Template Haskell quotes would
incorrectly use the `Match` type instead of `Clause` for the element type. We
now use `nonEmptyCoreList` when quoting `\cases`, which infers the correct type
automatically. This works because `\cases` has an invariant that the list of
clauses is always non-empty.
Fixes #27826.
- - - - -
06e71ddf by Simon Peyton Jones at 2026-11-22T16:37:40-05:00
Better desugaring for bang patterns
Ticket #27862 showed that we were desugaring bang patterns in a
silly way, which led to bad code. This small fix makes it much
better.
I ended up refactoring `decomposeFirstPat` to be of type
(LPat -> LPat) instead of (Pat -> Pat)
which made it much easier to keep the locations correct.
On the way I also fixed #28137, a missing warning.
See Note [Tidying patterns] which has new (TP1) and (TP2)
and Note [Grouping equations] especially (GE1)
- - - - -
cd6c2a96 by Simon Jakobi at 2026-11-22T16:38:23-05:00
Cmm: drop eliminated blocks from the graph in CBE
Previously, common block elimination only made the eliminated blocks
unreachable. They stayed in the graph until stack layout discarded
them.
Removing these blocks right away reduces the potential for confusion
(e.g. #27368). It does not appear to make any significant difference
to compiler allocations.
Assisted-by: Claude Opus 5.5
- - - - -
c0764c69 by Hannes Siebenhandl at 2026-11-22T16:39:04-05:00
Use Set operations over Foldable operations
Use `O(log n)` operations over `O(n)` for all call-sites of `hsc_all_home_unit_ids`.
- - - - -
242f8daf by Alan Zimmerman at 2026-11-22T16:39:46-05:00
EPA: Use AnnList in DecBrl
Via updating the TTG extension point payload
- - - - -
1e568190 by David Eichmann at 2026-11-22T16:40:28-05:00
Fix race condition in IOManager test
- - - - -
64f821c6 by Simon Peyton Jones at 2026-11-22T16:41:09-05:00
Fix a zonking bug
As #28135 showed, we were failing to zonk some type-variable
binders before doing scoped-sort dependency analysis, resulting
in chaos.
The fix is easy.
- - - - -
ed5124b3 by mangoiv at 2026-11-22T16:41:50-05:00
ci: nightly push can run on any arch
- - - - -
1340d255 by ARATA Mizuki at 2026-11-23T20:13:03-05:00
rts: Fix unwinding information for StgRun
The unwinding rule for rsp updated in a5ec467ee3d4e77c026437a545981269acde3434
was wrong. It gave the value of rsp _after_ the call instruction (i.e.
on entry to StgRun), whereas it should give the value _before_ the call
instruction (i.e. the caller's rsp).
Fixes #27637
- - - - -
56bb91d9 by Alan Zimmerman at 2026-11-23T20:13:44-05:00
EPA: Replace AnnListLayout / AnnListBrackets with EpLayout
We have harmonised the use of `AnnListLayout` and `AnnListBrackets` to
be equivalent to `EpLayout`.
We now take the final step, and remove them completely in favour of
`EpLayout`.
The change looks bigger than it is, because a lot of golden test
output gets updated.
- - - - -
5dafc946 by mangoiv at 2026-11-24T10:43:19+01:00
ci: make shallow cloning the default
We disabled shallow cloning because linters sometimes need deep clones.
We now clone shallowly and just enable deep cloning on lint jobs that we
know need them (see b2f106f5544e4c71bb07df4acb9d2b5ed184a7e3)
Fixes #28157
- - - - -
121 changed files:
- .gitlab-ci.yml
- + changelog.d/27694
- + changelog.d/T27137
- + changelog.d/T27637
- + changelog.d/T27862
- + changelog.d/T28135
- + changelog.d/make-depends-link-nodes
- compiler/GHC/Cmm/CommonBlockElim.hs
- compiler/GHC/CmmToAsm.hs
- compiler/GHC/CmmToAsm/AArch64/CodeGen.hs
- compiler/GHC/CmmToAsm/AArch64/Instr.hs
- compiler/GHC/CmmToAsm/BlockLayout.hs
- compiler/GHC/CmmToAsm/CFG.hs
- compiler/GHC/CmmToAsm/Instr.hs
- compiler/GHC/CmmToAsm/LA64/Instr.hs
- compiler/GHC/CmmToAsm/Monad.hs
- compiler/GHC/CmmToAsm/PPC/Instr.hs
- compiler/GHC/CmmToAsm/RV64/Instr.hs
- compiler/GHC/CmmToAsm/Reg/Linear/JoinToTargets.hs
- compiler/GHC/CmmToAsm/X86/CodeGen.hs
- compiler/GHC/CmmToAsm/X86/Instr.hs
- compiler/GHC/Driver/Downsweep.hs
- compiler/GHC/Driver/Make.hs
- compiler/GHC/Driver/MakeFile.hs
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/HsToCore/Match.hs
- compiler/GHC/HsToCore/Match/Literal.hs
- compiler/GHC/HsToCore/Monad.hs
- compiler/GHC/HsToCore/Pmc.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/Iface/Load.hs
- compiler/GHC/Iface/Recomp.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/Annotation.hs
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Tc/Gen/HsType.hs
- compiler/GHC/Tc/Solver.hs
- compiler/GHC/Tc/TyCl.hs
- + distrib/configure.ac
- docs/users_guide/make-depends-json-schema-1_0.json
- rts/StgCRun.c
- testsuite/driver/perf_notes.py
- testsuite/tests/ado/T22483.stderr
- + testsuite/tests/codeGen/should_compile/T27694.hs
- + testsuite/tests/codeGen/should_compile/T27694c.hs
- + testsuite/tests/codeGen/should_compile/T27694d.hs
- testsuite/tests/codeGen/should_compile/all.T
- + testsuite/tests/codeGen/should_run/T27694b.hs
- + testsuite/tests/codeGen/should_run/T27694b.stdout
- + testsuite/tests/codeGen/should_run/T27915.hs
- + testsuite/tests/codeGen/should_run/T27915.stdout-ws-32
- + testsuite/tests/codeGen/should_run/T27915.stdout-ws-64
- testsuite/tests/codeGen/should_run/all.T
- + testsuite/tests/deSugar/should_compile/T27862.hs
- + testsuite/tests/deSugar/should_compile/T27862.stderr
- + testsuite/tests/deSugar/should_compile/T27862a.hs
- + testsuite/tests/deSugar/should_compile/T27862a.stderr
- + testsuite/tests/deSugar/should_compile/T27862b.hs
- + testsuite/tests/deSugar/should_compile/T27862b.stderr
- + testsuite/tests/deSugar/should_compile/T27862c.hs
- + testsuite/tests/deSugar/should_compile/T27862c.stderr
- + testsuite/tests/deSugar/should_compile/T27862d.hs
- + testsuite/tests/deSugar/should_compile/T27862d.stderr
- + testsuite/tests/deSugar/should_compile/T28137.hs
- + testsuite/tests/deSugar/should_compile/T28137.stderr
- testsuite/tests/deSugar/should_compile/all.T
- testsuite/tests/deSugar/should_run/dsrun008.stderr
- testsuite/tests/driver/mkdepend/all.T
- + testsuite/tests/driver/mkdepend/mhu04/app/Main.hs
- + testsuite/tests/driver/mkdepend/mhu04/app/Utils.hs
- + testsuite/tests/driver/mkdepend/mhu04/lib/Lib.hs
- + testsuite/tests/driver/mkdepend/mhu04/lib/Lib/Internal.hs
- + testsuite/tests/driver/mkdepend/mhu04/unitApp
- + testsuite/tests/driver/mkdepend/mhu04/unitLib
- + testsuite/tests/driver/mkdepend/mhu05/app/Main.hs
- + testsuite/tests/driver/mkdepend/mhu05/lib/Lib.hs
- + testsuite/tests/driver/mkdepend/mhu05/lib/Lib/Internal.hs
- + testsuite/tests/driver/mkdepend/mhu05/test/Spec.hs
- + testsuite/tests/driver/mkdepend/mhu05/unitApp
- + testsuite/tests/driver/mkdepend/mhu05/unitLib
- + testsuite/tests/driver/mkdepend/mhu05/unitTest
- + testsuite/tests/driver/mkdepend/mkdepend02.dep-json
- + testsuite/tests/driver/mkdepend/mkdepend02/Main.hs
- + testsuite/tests/driver/mkdepend/mkdepend_bkp_01/bkp01.bkp
- + testsuite/tests/driver/mkdepend/mkdepend_mhu04.dep-json
- + testsuite/tests/driver/mkdepend/mkdepend_mhu04.dep-makefile
- + testsuite/tests/driver/mkdepend/mkdepend_mhu05.dep-json
- + testsuite/tests/driver/mkdepend/mkdepend_mhu05.dep-makefile
- testsuite/tests/ghc-api/exactprint/T22919.stderr
- testsuite/tests/ghc-api/exactprint/Test20239.stderr
- testsuite/tests/ghc-api/exactprint/ZeroWidthSemi.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/T17544.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/T17544_kw.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/T24221.stderr
- testsuite/tests/module/mod185.stderr
- testsuite/tests/parser/should_compile/DumpParsedAst.stderr
- testsuite/tests/parser/should_compile/DumpParsedAstComments.stderr
- testsuite/tests/parser/should_compile/DumpRenamedAst.stderr
- testsuite/tests/parser/should_compile/DumpSemis.stderr
- testsuite/tests/parser/should_compile/KindSigs.stderr
- testsuite/tests/parser/should_compile/T14189.stderr
- testsuite/tests/parser/should_compile/T15279.stderr
- testsuite/tests/parser/should_compile/T15323.stderr
- testsuite/tests/parser/should_compile/T20452.stderr
- testsuite/tests/parser/should_compile/T20718.stderr
- testsuite/tests/parser/should_compile/T20846.stderr
- testsuite/tests/pmcheck/should_compile/T24234.stderr
- testsuite/tests/printer/T18791.stderr
- testsuite/tests/printer/Test20297.stdout
- testsuite/tests/printer/Test24533.stdout
- testsuite/tests/rts/IOManager.hsc
- testsuite/tests/rts/all.T
- + testsuite/tests/th/T27826.hs
- testsuite/tests/th/all.T
- + testsuite/tests/typecheck/should_compile/T28135.hs
- testsuite/tests/typecheck/should_compile/all.T
- testsuite/tests/typecheck/should_fail/tcfail203a.stderr
- utils/check-exact/ExactPrint.hs
- utils/check-exact/Main.hs
- utils/check-exact/Transform.hs
- utils/check-exact/Utils.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/ff8e50970d3cefdedb77a8402819ed…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/ff8e50970d3cefdedb77a8402819ed…
You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1
0
[Git][ghc/ghc][wip/sjakobi/T27688-bt-single-bit-tests] X86 NCG: use bt for single-bit tests
by Simon Jakobi (@sjakobi) 24 Nov '26
by Simon Jakobi (@sjakobi) 24 Nov '26
24 Nov '26
Simon Jakobi pushed to branch wip/sjakobi/T27688-bt-single-bit-tests at Glasgow Haskell Compiler / GHC
Commits:
257fd761 by Simon Jakobi at 2026-11-24T08:51:24+01:00
X86 NCG: use bt for single-bit tests
Previously the Cmm patterns
(x & (1 << i)) != 0
(x & (1 << i)) == 0
compiled to a mov/shl/and/test sequence. Now they compile to a single
bt, followed directly by a jc/jae or setc/setae.
As with btr/bts/btc, a literal single-bit mask that doesn't fit in an
imm32, such as x & 0x10000000000, is now also tested with bt instead of
being loaded into a register first.
Data.Bits.testBit doesn't benefit yet when the bit index is variable:
its bounds-checked shiftL wraps the shift in a mask that blocks this
optimization.
See Note [Bit-test instructions] in GHC.CmmToAsm.X86.CodeGen.
Fixes #27688.
Assisted-by: Claude Fable 5.1
- - - - -
9 changed files:
- changelog.d/ncg-x86-bit-test-instructions
- compiler/GHC/CmmToAsm/X86/CodeGen.hs
- compiler/GHC/CmmToAsm/X86/Instr.hs
- compiler/GHC/CmmToAsm/X86/Ppr.hs
- + testsuite/tests/codeGen/should_gen_asm/T27688.asm
- + testsuite/tests/codeGen/should_gen_asm/T27688.hs
- + testsuite/tests/codeGen/should_gen_asm/T27688b.asm
- + testsuite/tests/codeGen/should_gen_asm/T27688b.cmm
- testsuite/tests/codeGen/should_gen_asm/all.T
Changes:
=====================================
changelog.d/ncg-x86-bit-test-instructions
=====================================
@@ -1,20 +1,21 @@
section: compiler
synopsis: The x86 native code generator now uses the bit-test instructions
- ``btr``/``bts``/``btc`` to clear, set or complement a single bit
+ ``bt``/``btr``/``bts``/``btc`` to test, clear, set or complement a single
+ bit
description:
- Cmm patterns such as ``x & ~(1 << i)``, ``x | (1 << i)`` and
- ``x ^ (1 << i)`` now compile to a single ``btr``/``bts``/``btc``
- instruction instead of a mov/shl/not/and-style sequence, matching what C
- compilers produce. The same applies to the literal masks that constant
- folding produces from these patterns when ``i`` is constant, in the cases
- where the mask doesn't fit in an imm32 operand.
+ Cmm patterns such as ``(x & (1 << i)) != 0``, ``x & ~(1 << i)``,
+ ``x | (1 << i)`` and ``x ^ (1 << i)`` now compile to a single
+ ``bt``/``btr``/``bts``/``btc`` instruction instead of a mov/shl/and-style
+ sequence, matching what C compilers produce. The same happens with a
+ literal ``i`` when the folded mask does not fit in an imm32 operand,
+ e.g. ``x | (1 << 40)``.
For a variable bit index this applies only when the shift is unchecked,
as with ``uncheckedShiftL#`` or ``Data.Bits.unsafeShiftL``. The
bounds-checked ``shiftL`` — used, for example, by the default
- implementations of ``clearBit``, ``setBit`` and ``complementBit`` —
- wraps the shift in a bounds mask that this optimisation does not see
- through. With a literal index, the bounds mask is constant-folded away,
- so the checked operations benefit too.
-mrs: !16311
-issues: #25233
+ implementations of ``testBit``, ``clearBit``, ``setBit`` and
+ ``complementBit`` — wraps the shift in a bounds mask that this
+ optimisation does not see through. With a literal index, the bounds mask
+ is constant-folded away, so the checked operations benefit too.
+mrs: !16311 !16639
+issues: #25233 #27688
=====================================
compiler/GHC/CmmToAsm/X86/CodeGen.hs
=====================================
@@ -1428,16 +1428,16 @@ getRegister' platform is32Bit (CmmMachOp mop [x]) = do -- unary MachOps
-- See Note [Bit-test instructions].
getRegister' platform is32Bit (CmmMachOp (MO_And w) [x, y])
| bitTestOpWidthOK is32Bit w
- , Just (opnd, ix) <- clearBitArgs_maybe platform w x y
- = genBitTestCode (intFormat w) BTR opnd ix
+ , Just (opnd, ix) <- matchEitherArg (invSingleBitMask_maybe platform w) x y
+ = genBitModifyCode (intFormat w) BTR opnd ix
getRegister' platform is32Bit (CmmMachOp (MO_Or w) [x, y])
| bitTestOpWidthOK is32Bit w
- , Just (opnd, ix) <- setBitArgs_maybe platform w x y
- = genBitTestCode (intFormat w) BTS opnd ix
+ , Just (opnd, ix) <- matchEitherArg (singleBitMask_maybe platform w) x y
+ = genBitModifyCode (intFormat w) BTS opnd ix
getRegister' platform is32Bit (CmmMachOp (MO_Xor w) [x, y])
| bitTestOpWidthOK is32Bit w
- , Just (opnd, ix) <- setBitArgs_maybe platform w x y
- = genBitTestCode (intFormat w) BTC opnd ix
+ , Just (opnd, ix) <- matchEitherArg (singleBitMask_maybe platform w) x y
+ = genBitModifyCode (intFormat w) BTC opnd ix
getRegister' platform is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps
sse4_1 <- x86Feature x86Sse4_1Enabled
@@ -3926,6 +3926,24 @@ condIntCode' platform cond (CmmLoad x ty _) (CmmLit lit)
--
return (CondCode False cond code)
+-- single-bit test, e.g. (x & (1 << i)) != 0
+-- see Note [Bit-test instructions]
+condIntCode' platform cond (CmmMachOp (MO_And w) [x, y]) (CmmLit (CmmInt 0 _))
+ | Just bt_cond <- bitTestCond cond
+ , bitTestOpWidthOK (target32Bit platform) w
+ , Just (opnd, ix) <- matchEitherArg (singleBitMask_maybe platform w) x y
+ , let fmt = intFormat w
+ = case ix of
+ BitIndexImm i -> do
+ (x_reg, x_code) <- getSomeReg opnd
+ return $ CondCode False bt_cond $
+ x_code `snocOL` BT fmt (OpImm (ImmInt i)) (OpReg x_reg)
+ BitIndexReg i -> do
+ (i_reg, i_code) <- getNonClobberedReg i
+ (x_reg, x_code) <- getSomeReg opnd
+ return $ CondCode False bt_cond $
+ i_code `appOL` x_code `snocOL` BT fmt (OpReg i_reg) (OpReg x_reg)
+
-- anything vs zero, using a mask
-- TODO: Add some sanity checking!!!!
condIntCode' platform cond (CmmMachOp (MO_And _) [x,o2]) (CmmLit (CmmInt 0 ty))
@@ -5883,17 +5901,18 @@ genTrivialCode rep instr a b = do
{- Note [Bit-test instructions]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-x86 has dedicated instructions for clearing (btr), setting (bts) and
-complementing (btc) a single bit whose index is given in a register. We use
-them for Cmm patterns such as
+x86 has dedicated instructions for testing (bt), clearing (btr), setting
+(bts) and complementing (btc) a single bit whose index is given in a
+register. We use them for Cmm patterns such as
- x & ~(1 << i) ==> btr i, x (#25233)
+ (x & (1 << i)) != 0 ==> bt i, x; jc
+ x & ~(1 << i) ==> btr i, x
-replacing a mov/shl/not/and sequence with a single instruction. The
-shift-count register operand of shl is masked modulo the operand width, and
-the bit-offset register operand of btr/bts/btc is masked the same way, so
-the replacement is faithful even for out-of-range i (where the Cmm shift is
-in any case undefined).
+replacing a mov/shl/and/test or mov/shl/not/and sequence with a single
+instruction. The shift-count register operand of shl is masked modulo the
+operand width, and the bit-offset register operand of the bit-test
+instructions is masked the same way, so the replacement is faithful even for
+out-of-range i (where the Cmm shift is in any case undefined).
The bit-offset operand of these instructions must be an immediate or a
register. When the bit index is a literal, no shift reaches the NCG:
@@ -5901,10 +5920,11 @@ constant folding has already turned the whole mask into a literal. If that
mask fits in an imm32, we keep the ordinary and/or/xor with an immediate:
it has the same latency and better throughput (more execution ports) than
the bit-test instructions, and at worst two bytes of extra code size for bit
-indices 7..30.
+indices 7..30. Likewise a single-bit test keeps 'test' with an immediate:
+test+jcc macro-fuse into one uop, bt+jcc do not.
But a W64 mask touching the upper bits, e.g. ~(1 << 40), would have to be moved
into a register first. For such masks we recognise the folded literal itself
-(exactly one bit clear resp. set) and emit btr/bts/btc with an immediate
+(exactly one bit clear resp. set) and emit bt/btr/bts/btc with an immediate
bit offset.
We restrict the pattern to W32 and native-width W64: the instructions do not
@@ -5916,15 +5936,15 @@ they are not worth the extra care.
--
-- The returned expression is always at word width ('machOpArgReps' fixes
-- shift amounts at 'wordWidth'). See Note [Bit-test instructions].
-singleBit_maybe :: CmmExpr -> Maybe CmmExpr
-singleBit_maybe (CmmMachOp (MO_Shl _) [CmmLit (CmmInt 1 _), i]) = Just i
-singleBit_maybe _ = Nothing
+singleBitShift_maybe :: CmmExpr -> Maybe CmmExpr
+singleBitShift_maybe (CmmMachOp (MO_Shl _) [CmmLit (CmmInt 1 _), i]) = Just i
+singleBitShift_maybe _ = Nothing
-- | If exactly one bit of @m@, taken at width @w@, is set, return its index.
--
-- See Note [Bit-test instructions].
-setBitLit_maybe :: Width -> Integer -> Maybe Int
-setBitLit_maybe w m
+singleBitLit_maybe :: Width -> Integer -> Maybe Int
+singleBitLit_maybe w m
| popCount m' == 1 = Just (countTrailingZeros m')
| otherwise = Nothing
where
@@ -5935,66 +5955,74 @@ setBitLit_maybe w m
-- index.
--
-- See Note [Bit-test instructions].
-clearBitLit_maybe :: Width -> Integer -> Maybe Int
-clearBitLit_maybe w m = setBitLit_maybe w (complement m)
+invSingleBitLit_maybe :: Width -> Integer -> Maybe Int
+invSingleBitLit_maybe w m = singleBitLit_maybe w (complement m)
bitTestOpWidthOK :: Bool -> Width -> Bool
bitTestOpWidthOK is32Bit w = w == W32 || (w == W64 && not is32Bit)
--- | The bit-offset operand of a bit-test instruction (btr/bts/btc).
+-- | The condition to branch on after @bt@, for a @mask != 0@ ('NE') or
+-- @mask == 0@ ('EQQ') comparison. 'Nothing' for any other condition.
+--
+-- @bt@ reports the tested bit in CF, so we branch on 'CARRY' or 'GEU'
+-- rather than on ZF via 'NE' or 'EQQ'.
+bitTestCond :: Cond -> Maybe Cond
+bitTestCond NE = Just CARRY
+bitTestCond EQQ = Just GEU
+bitTestCond _ = Nothing
+
+-- | The bit-offset operand of a bit-test instruction.
data BitIndex
- = BitIndexReg CmmExpr -- ^ variable index, computed into a register
- | BitIndexImm Int -- ^ literal index, emitted as an immediate
+ = BitIndexReg !CmmExpr -- ^ variable index, computed into a register
+ | BitIndexImm !Int -- ^ literal index, emitted as an immediate
--- | Match the operands of a single-bit set or complement operation: one
--- operand is a mask @1 << i@, or a literal with exactly one bit set that
--- does not fit in an imm32. Returns the other operand and the bit index.
---
--- Both operand orders are matched, e.g. @x | (1 << i)@ and @(1 << i) | x@.
+-- | Match a single-bit mask: @1 << i@, or a literal with exactly one bit set
+-- that does not fit in an imm32. Returns the bit index.
--
-- See Note [Bit-test instructions].
-setBitArgs_maybe :: Platform -> Width -> CmmExpr -> CmmExpr
- -> Maybe (CmmExpr, BitIndex)
-setBitArgs_maybe platform w x y = go x y `mplus` go y x
- where
- go opnd mask
- | Just i <- singleBit_maybe mask
- = Just (opnd, BitIndexReg i)
- | CmmLit lit@(CmmInt m _) <- mask
- , Just i <- setBitLit_maybe w m
- , not (is32BitLit platform lit)
- = Just (opnd, BitIndexImm i)
- | otherwise
- = Nothing
+singleBitMask_maybe :: Platform -> Width -> CmmExpr -> Maybe BitIndex
+singleBitMask_maybe platform w mask
+ | Just i <- singleBitShift_maybe mask
+ = Just (BitIndexReg i)
+ | CmmLit lit@(CmmInt m _) <- mask
+ , Just i <- singleBitLit_maybe w m
+ , not (is32BitLit platform lit)
+ = Just (BitIndexImm i)
+ | otherwise
+ = Nothing
+
+-- | As 'singleBitMask_maybe', for an inverted single-bit mask: @~(1 << i)@,
+-- or a literal with exactly one bit clear.
+invSingleBitMask_maybe :: Platform -> Width -> CmmExpr -> Maybe BitIndex
+invSingleBitMask_maybe platform w mask
+ | CmmMachOp (MO_Not _) [b] <- mask
+ , Just i <- singleBitShift_maybe b
+ = Just (BitIndexReg i)
+ | CmmLit lit@(CmmInt m _) <- mask
+ , Just i <- invSingleBitLit_maybe w m
+ , not (is32BitLit platform lit)
+ = Just (BitIndexImm i)
+ | otherwise
+ = Nothing
--- | As 'setBitArgs_maybe', for a single-bit clear operation: the mask is
--- @~(1 << i)@, or a literal with exactly one bit clear.
-clearBitArgs_maybe :: Platform -> Width -> CmmExpr -> CmmExpr
- -> Maybe (CmmExpr, BitIndex)
-clearBitArgs_maybe platform w x y = go x y `mplus` go y x
- where
- go opnd mask
- | CmmMachOp (MO_Not _) [b] <- mask
- , Just i <- singleBit_maybe b
- = Just (opnd, BitIndexReg i)
- | CmmLit lit@(CmmInt m _) <- mask
- , Just i <- clearBitLit_maybe w m
- , not (is32BitLit platform lit)
- = Just (opnd, BitIndexImm i)
- | otherwise
- = Nothing
+-- | Apply a matcher to either of two operands, returning the other operand
+-- alongside the match, e.g. for both @x | (1 << i)@ and @(1 << i) | x@.
+matchEitherArg :: (CmmExpr -> Maybe a) -> CmmExpr -> CmmExpr
+ -> Maybe (CmmExpr, a)
+matchEitherArg match x y =
+ ((,) x <$> match y) `mplus` ((,) y <$> match x)
-- | Generate code for @dst := x@ followed by a bit-test instruction
-- (btr/bts/btc).
--
-- See Note [Bit-test instructions].
-genBitTestCode :: Format -> (Format -> Operand -> Operand -> Instr)
- -> CmmExpr -> BitIndex -> NatM Register
-genBitTestCode rep instr x (BitIndexImm i) = do
+genBitModifyCode :: Format -> (Format -> Operand -> Operand -> Instr)
+ -> CmmExpr -> BitIndex -> NatM Register
+genBitModifyCode rep instr x (BitIndexImm i) = do
x_code <- getAnyReg x
let code dst = x_code dst `snocOL` instr rep (OpImm (ImmInt i)) (OpReg dst)
return (Any rep code)
-genBitTestCode rep instr x (BitIndexReg i) = do
+genBitModifyCode rep instr x (BitIndexReg i) = do
(i_reg, i_code) <- getNonClobberedReg i
x_code <- getAnyReg x
tmp <- getNewRegNat rep
=====================================
compiler/GHC/CmmToAsm/X86/Instr.hs
=====================================
@@ -192,7 +192,8 @@ data Instr
| SHRD Format Operand{-amount-} Operand Operand
| SHLD Format Operand{-amount-} Operand Operand
- | BT Format Imm Operand
+ -- | Bit test
+ | BT Format Operand{- ^ bit offset (imm/reg) -} Operand
-- | Bit test-and-reset
| BTR Format Operand{- ^ bit offset (imm/reg) -} Operand
-- | Bit set
@@ -506,7 +507,7 @@ regUsageOfInstr platform instr
SHR fmt imm dst -> readOp fmt imm <.> modifyOp fmt dst
SHLD fmt imm dst1 dst2 -> readModifyModify fmt imm dst1 dst2
SHRD fmt imm dst1 dst2 -> readModifyModify fmt imm dst1 dst2
- BT fmt _ src -> readOp fmt src
+ BT fmt off src -> readOp fmt off <.> readOp fmt src
BTR fmt off dst -> readOp fmt off <.> modifyOp fmt dst
BTS fmt off dst -> readOp fmt off <.> modifyOp fmt dst
BTC fmt off dst -> readOp fmt off <.> modifyOp fmt dst
@@ -819,7 +820,7 @@ patchRegsOfInstr platform instr env
SHR fmt imm dst -> patch1 (SHR fmt imm) dst
SHLD fmt imm dst1 dst2 -> patch2 (SHLD fmt imm) dst1 dst2
SHRD fmt imm dst1 dst2 -> patch2 (SHRD fmt imm) dst1 dst2
- BT fmt imm src -> patch1 (BT fmt imm) src
+ BT fmt off src -> patch2 (BT fmt) off src
BTR fmt off dst -> patch2 (BTR fmt) off dst
BTS fmt off dst -> patch2 (BTS fmt) off dst
BTC fmt off dst -> patch2 (BTC fmt) off dst
=====================================
compiler/GHC/CmmToAsm/X86/Ppr.hs
=====================================
@@ -860,8 +860,8 @@ pprInstr platform i = case i of
SHRD format src dst1 dst2
-> pprShift2 (text "shrd") format src dst1 dst2
- BT format imm src
- -> pprFormatImmOp (text "bt") format imm src
+ BT format off src
+ -> pprFormatOpOp (text "bt") format off src
BTR format off dst
-> pprFormatOpOp (text "btr") format off dst
@@ -1251,16 +1251,6 @@ pprInstr platform i = case i of
FmtInt64 -> text "q"
pprBroadcastFormat _ = panic "Scalar Format invading vector operation"
- pprFormatImmOp :: Line doc -> Format -> Imm -> Operand -> doc
- pprFormatImmOp name format imm op1
- = line $ hcat [
- pprMnemonic name format,
- char '$',
- pprImm platform imm,
- comma,
- pprOperand platform format op1
- ]
-
pprFormatOp_ :: Line doc -> Format -> Operand -> doc
pprFormatOp_ name format op1
= line $ hcat [
=====================================
testsuite/tests/codeGen/should_gen_asm/T27688.asm
=====================================
@@ -0,0 +1,3 @@
+btq %
+btl %
+btq $40,
=====================================
testsuite/tests/codeGen/should_gen_asm/T27688.hs
=====================================
@@ -0,0 +1,30 @@
+{-# LANGUAGE MagicHash #-}
+
+-- Check that testing a single, variable bit uses the bt instruction
+-- (#27688).
+module T27688 where
+
+import GHC.Exts
+
+testBitNe :: Word# -> Int# -> Int#
+testBitNe x i =
+ if isTrue# ((x `and#` (1## `uncheckedShiftL#` i)) `neWord#` 0##)
+ then 1# else 2#
+
+testBitEq :: Word# -> Int# -> Int#
+testBitEq x i =
+ if isTrue# ((x `and#` (1## `uncheckedShiftL#` i)) `eqWord#` 0##)
+ then 1# else 2#
+
+testBit32 :: Word32# -> Int# -> Int#
+testBit32 x i =
+ if isTrue# ((x `andWord32#` (wordToWord32# 1## `uncheckedShiftLWord32#` i))
+ `neWord32#` wordToWord32# 0##)
+ then 1# else 2#
+
+-- With a constant bit index >= 32, the mask constant-folds to a literal
+-- that does not fit in an imm32, so bt with an immediate offset is used.
+testBit40 :: Word# -> Int#
+testBit40 x =
+ if isTrue# ((x `and#` (1## `uncheckedShiftL#` 40#)) `neWord#` 0##)
+ then 1# else 2#
=====================================
testsuite/tests/codeGen/should_gen_asm/T27688b.asm
=====================================
@@ -0,0 +1,4 @@
+btq %
+setc
+setae
+btq $40,
=====================================
testsuite/tests/codeGen/should_gen_asm/T27688b.cmm
=====================================
@@ -0,0 +1,21 @@
+#include "Cmm.h"
+
+// Single-bit tests whose result is used as a value rather than as a branch
+// condition, a literal mask that does not fit in an imm32, and the mask on
+// the left of the operator (#27688).
+
+testBitValue (W_ x, W_ i) {
+ return ((x & (1 << i)) != 0);
+}
+
+testBitValueEq (W_ x, W_ i) {
+ return ((x & (1 << i)) == 0);
+}
+
+testBit40 (W_ x) {
+ return (((0x10000000000 :: bits64) & x) != 0);
+}
+
+testBitLeft (W_ x, W_ i) {
+ return (((1 << i) & x) != 0);
+}
=====================================
testsuite/tests/codeGen/should_gen_asm/all.T
=====================================
@@ -44,6 +44,10 @@ test('T25233', [unless(arch('x86_64'), skip),
test('T25233b', [unless(arch('x86_64'), skip),
when(unregisterised(), skip)], compile_grep_asm, ['cmm', True, ''])
test('T24813', is_amd64_codegen, compile_cmp_asm, ['cmm', '-msse4.2'])
+test('T27688', [unless(arch('x86_64'), skip),
+ when(unregisterised(), skip)], compile_grep_asm, ['hs', True, '-O'])
+test('T27688b', [unless(arch('x86_64'), skip),
+ when(unregisterised(), skip)], compile_grep_asm, ['cmm', True, ''])
is_aarch64_codegen = [
unless(arch('aarch64'), skip),
when(unregisterised(), skip),
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/257fd761179cf0ecfb70c5b0733a2fd…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/257fd761179cf0ecfb70c5b0733a2fd…
You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1
0
[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 13 commits: rts: Fix unwinding information for StgRun
by Marge Bot (@marge-bot) 24 Nov '26
by Marge Bot (@marge-bot) 24 Nov '26
24 Nov '26
Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC
Commits:
1340d255 by ARATA Mizuki at 2026-11-23T20:13:03-05:00
rts: Fix unwinding information for StgRun
The unwinding rule for rsp updated in a5ec467ee3d4e77c026437a545981269acde3434
was wrong. It gave the value of rsp _after_ the call instruction (i.e.
on entry to StgRun), whereas it should give the value _before_ the call
instruction (i.e. the caller's rsp).
Fixes #27637
- - - - -
56bb91d9 by Alan Zimmerman at 2026-11-23T20:13:44-05:00
EPA: Replace AnnListLayout / AnnListBrackets with EpLayout
We have harmonised the use of `AnnListLayout` and `AnnListBrackets` to
be equivalent to `EpLayout`.
We now take the final step, and remove them completely in favour of
`EpLayout`.
The change looks bigger than it is, because a lot of golden test
output gets updated.
- - - - -
f0fa4c04 by Simon Peyton Jones at 2026-11-24T00:51:50-05:00
Use a different herald for -ddump-simpl-trace
... so that we can more easily skip the high-volume ones
- - - - -
bd812078 by Simon Peyton Jones at 2026-11-24T00:51:50-05:00
Update comments and user manual
This commit addresses the comment-related suggestions in #27973
- - - - -
227f2bfe by Simon Peyton Jones at 2026-11-24T00:51:50-05:00
Document and refactor eta-reduction documentation
Triggered by #27212, this patch does several related things.
* #27212 suggested that `findRhsArity` should ask for eta-expansion
whenever the RHS's `manifestArity` is less than the arity it finds.
That is a misconception: it deliberately compares with `exprArity`,
which counts PAPs, so that we do not eta-expand PAPs (#9020).
Switching to `manifestArity` makes compile time worse in T13960
and T13056.
So this patch changes no code here; we continue to expand only to
increase `exprArity` not `manifestArity`. Instead it documents the
design in `findRhsArity`, `tryEtaExpandRhs`, `wantEtaExpansion` and
Note [Do not eta-expand PAPs] (which now records the #27212
experiment).
* Refactor GHC.Core.Opt.Arity.tryEtaReduce, which was hard to
understand:
- Accumulate an MCoercion rather than a Coercion, so the common
no-cast case builds no coercions at all.
- Separate equations of `go` for type and value arguments. For
value arguments, the new `getTrivialHead_maybe` looks through any
nesting of casts and floatable ticks, and `mkEtaReduceFunCo` builds
the coercion.
- Make the FunCo with `mkFunCo2` and compute its right-hand
FunTyFlag from the coercion kinds. The cast can turn a Type-kinded
argument into a Constraint-kinded one. New test T27212 covers this.
- `mkEtaReduceForAllMCo` builds the ForAllCo for type arguments. It
is tiresomely similar to `mkEtaForAllMCo`, but with the visibilities
the other way round (#24014). It will go away again once !17006
lands.
- New helper `mCoToCo` in GHC.Core.TyCo.Make.
* Drop the checks on multiplicity in `tryEtaReduce`, which sometimes
disabled eta-reduction. For example, (\x. K x) has type Int -> T,
but the data constructor has type K :: Int %1 -> T, so we used to
refuse to eta-reduce it to K.
But Note [Linting linearity] in GHC.Core.Lint (EXAMPLE 4) already
says that we do not preserve linearity under eta-reduction, so this
change just puts that claim into practice. See (EtaMult) in
Note [Eta reduction soundness].
Consequences in the testsuite:
- T18052a: the pattern-synonym builder (\x y. (x,y)) is now just (,).
- T21888a: the NOINLINE function (f x = Just x) becomes (f = Just),
so f loses its CPR signature. The test is about demands, not CPR.
* Tidy up the documentation of eta-reduction:
- Relabel the criteria in Note [Eta reduction soundness] as (EtaA),
(EtaS), (EtaR), (EtaE), (EtaT), (EtaJ), (EtaB) and (EtaW), and
update all references to them. Also fix references to point (2) of
Note [Eta reduction makes sense], which no longer exists.
- Replace the confused "never reduce arity" bullet with an example in
(EtaA), cross-referenced from Note [Arity robustness].
- Add historical notes (EtaMult) and (EtaBot).
- Label the equations in Note [Eta reduction with casted arguments]
(ECA1-4), and point to the code that implements them.
LLM disclosure: I interacted with Claude a lot for this MR, but I
wrote all the code and docs myself.
- - - - -
b2b6920b by Zubin Duggal at 2026-11-24T00:51:51-05:00
linker: Remove DotA and DotDLL constructors of LinkablePart
As far as I can, we have never actually used these constructors,
and they have never appeared in a positive position, ever since they
were introduced a long time ago.
Foreign libraries aren't loaded through these either, that happens either
through `loadPackages` which uses `LibrarySpec` or through 'loadCmdLineLibs'
Also, a Linkable defines the build product of a single home module. DotA/DotDLL
are library like things, so they don't fit into a Linkable anyway.
- - - - -
e2ba1375 by Zubin Duggal at 2026-11-24T00:51:51-05:00
Identify Linkable with fingerprints of their contents rather than modtimes
- - - - -
7177d4d8 by Zubin Duggal at 2026-11-24T00:51:51-05:00
Linker cleanup
delete a bunch of unused functions
- - - - -
93eee371 by Zubin Duggal at 2026-11-24T00:51:51-05:00
Record constituent hashes for bytecode libraries
A bytecode library now records the combined hash of its constituents,
so relinking can be skipped when they haven't changed.
- - - - -
c77c3525 by Zubin Duggal at 2026-11-24T00:51:51-05:00
bytecode: Give persistent bytecode files a fixed-size header with a hash
The header of .gbc and .bytecodelib files now consists of the magic word,
the compiler version and a hash, all with fixed-length encodings. The hash
is the gbc_hash of a bytecode file, or the inputs hash of a bytecode
library.
readBinByteCodeHash and readBytecodeLibInputsHash now read only the header
rather than the whole file. The version is written as its four numeric
components instead of as a string.
- - - - -
6902245d by Zubin Duggal at 2026-11-24T00:51:51-05:00
driver: Refresh ms_bytecode_date when reusing a ModSummary
- - - - -
5ded42a7 by Zubin Duggal at 2026-11-24T00:51:51-05:00
bytecode: Treat persistent bytecode files with a bad header as stale
- - - - -
46235ab5 by Zubin Duggal at 2026-11-24T00:51:52-05:00
bytecode: Record the inputs hash in BytecodeLib
-------------------------
Metric Increase:
MultiLayerModulesRecomp
MultiLayerModulesTH_OneShot
-------------------------
- - - - -
76 changed files:
- + changelog.d/T27212
- + changelog.d/T27637
- compiler/GHC/ByteCode/Binary.hs
- compiler/GHC/ByteCode/Serialize.hs
- compiler/GHC/Core/Coercion.hs
- compiler/GHC/Core/Opt/Arity.hs
- compiler/GHC/Core/Opt/OccurAnal.hs
- compiler/GHC/Core/Opt/Pipeline.hs
- compiler/GHC/Core/Opt/Simplify/Env.hs
- compiler/GHC/Core/Opt/Simplify/Inline.hs
- compiler/GHC/Core/Opt/Simplify/Iteration.hs
- compiler/GHC/Core/Opt/Simplify/Utils.hs
- compiler/GHC/Core/Opt/SpecConstr.hs
- compiler/GHC/Core/Opt/Specialise.hs
- compiler/GHC/Core/TyCo/Make.hs
- compiler/GHC/Core/Type.hs
- compiler/GHC/Core/Utils.hs
- compiler/GHC/Driver/Config/Core/Opt/Simplify.hs
- compiler/GHC/Driver/Downsweep.hs
- compiler/GHC/Driver/Main/Compile.hs
- compiler/GHC/Driver/Main/Passes.hs
- compiler/GHC/Driver/Pipeline.hs
- compiler/GHC/Linker/ByteCode.hs
- compiler/GHC/Linker/Deps.hs
- compiler/GHC/Linker/Loader.hs
- compiler/GHC/Linker/Types.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/Annotation.hs
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Unit/Finder.hs
- compiler/GHC/Utils/Logger.hs
- compiler/Language/Haskell/Syntax/Binds/InlinePragma.hs
- docs/users_guide/debug-info.rst
- docs/users_guide/using-optimisation.rst
- rts/StgCRun.c
- testsuite/tests/dmdanal/sigs/T21888a.stderr
- testsuite/tests/driver/bytecode-object/Makefile
- testsuite/tests/driver/bytecode-object/all.T
- + testsuite/tests/driver/bytecode-object/bytecode_object27.stdout
- + testsuite/tests/driver/bytecode-object/bytecode_object28.script
- + testsuite/tests/driver/bytecode-object/bytecode_object28.stdout
- + testsuite/tests/driver/bytecode-object/bytecode_object29.stdout
- + testsuite/tests/driver/recomp023/M.hs
- + testsuite/tests/driver/recomp023/M2.hs
- + testsuite/tests/driver/recomp023/Makefile
- + testsuite/tests/driver/recomp023/all.T
- + testsuite/tests/driver/recomp023/recomp023.stdout
- testsuite/tests/ghc-api/exactprint/T22919.stderr
- testsuite/tests/ghc-api/exactprint/Test20239.stderr
- testsuite/tests/ghc-api/exactprint/ZeroWidthSemi.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/T17544.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/T17544_kw.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/T24221.stderr
- testsuite/tests/module/mod185.stderr
- testsuite/tests/parser/should_compile/DumpParsedAst.stderr
- testsuite/tests/parser/should_compile/DumpParsedAstComments.stderr
- testsuite/tests/parser/should_compile/DumpRenamedAst.stderr
- testsuite/tests/parser/should_compile/DumpSemis.stderr
- testsuite/tests/parser/should_compile/KindSigs.stderr
- testsuite/tests/parser/should_compile/T14189.stderr
- testsuite/tests/parser/should_compile/T15279.stderr
- testsuite/tests/parser/should_compile/T15323.stderr
- testsuite/tests/parser/should_compile/T20452.stderr
- testsuite/tests/parser/should_compile/T20718.stderr
- testsuite/tests/parser/should_compile/T20846.stderr
- testsuite/tests/printer/T18052a.stderr
- testsuite/tests/printer/T18791.stderr
- testsuite/tests/printer/Test20297.stdout
- testsuite/tests/printer/Test24533.stdout
- testsuite/tests/simplCore/should_compile/T24726.stderr
- + testsuite/tests/simplCore/should_compile/T27212.hs
- testsuite/tests/simplCore/should_compile/all.T
- utils/check-exact/ExactPrint.hs
- utils/check-exact/Main.hs
- utils/check-exact/Transform.hs
- utils/check-exact/Utils.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c3e4541acb2242a45f445a9e584aae…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c3e4541acb2242a45f445a9e584aae…
You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1
0
[Git][ghc/ghc][master] EPA: Replace AnnListLayout / AnnListBrackets with EpLayout
by Marge Bot (@marge-bot) 24 Nov '26
by Marge Bot (@marge-bot) 24 Nov '26
24 Nov '26
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
56bb91d9 by Alan Zimmerman at 2026-11-23T20:13:44-05:00
EPA: Replace AnnListLayout / AnnListBrackets with EpLayout
We have harmonised the use of `AnnListLayout` and `AnnListBrackets` to
be equivalent to `EpLayout`.
We now take the final step, and remove them completely in favour of
`EpLayout`.
The change looks bigger than it is, because a lot of golden test
output gets updated.
- - - - -
28 changed files:
- compiler/GHC/Parser.y
- compiler/GHC/Parser/Annotation.hs
- compiler/GHC/Parser/PostProcess.hs
- testsuite/tests/ghc-api/exactprint/T22919.stderr
- testsuite/tests/ghc-api/exactprint/Test20239.stderr
- testsuite/tests/ghc-api/exactprint/ZeroWidthSemi.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/T17544.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/T17544_kw.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/T24221.stderr
- testsuite/tests/module/mod185.stderr
- testsuite/tests/parser/should_compile/DumpParsedAst.stderr
- testsuite/tests/parser/should_compile/DumpParsedAstComments.stderr
- testsuite/tests/parser/should_compile/DumpRenamedAst.stderr
- testsuite/tests/parser/should_compile/DumpSemis.stderr
- testsuite/tests/parser/should_compile/KindSigs.stderr
- testsuite/tests/parser/should_compile/T14189.stderr
- testsuite/tests/parser/should_compile/T15279.stderr
- testsuite/tests/parser/should_compile/T15323.stderr
- testsuite/tests/parser/should_compile/T20452.stderr
- testsuite/tests/parser/should_compile/T20718.stderr
- testsuite/tests/parser/should_compile/T20846.stderr
- testsuite/tests/printer/T18791.stderr
- testsuite/tests/printer/Test20297.stdout
- testsuite/tests/printer/Test24533.stdout
- utils/check-exact/ExactPrint.hs
- utils/check-exact/Main.hs
- utils/check-exact/Transform.hs
- utils/check-exact/Utils.hs
Changes:
=====================================
compiler/GHC/Parser.y
=====================================
@@ -1529,13 +1529,13 @@ where_type_family :: { Located ((EpToken "where", EpToken ".."),FamilyInfo GhcP
, ClosedTypeFamily (fst $ fst $ unLoc $2) (fmap reverse $ snd $ unLoc $2)) }
ty_fam_inst_eqn_list :: { Located ((AnnList, EpToken ".."),Maybe [LTyFamInstEqn GhcPs]) }
- : '{' ty_fam_inst_eqns '}' { sLL $1 $> ((AnnList AnnListBraces (ListBraces (epTok $1) (epTok $3)) [], noAnn)
+ : '{' ty_fam_inst_eqns '}' { sLL $1 $> ((AnnList (EpExplicitBraces (epTok $1) (epTok $3)) [], noAnn)
,Just (unLoc $2)) }
| vocurly ty_fam_inst_eqns close { let (L loc _) = $2 in
- L loc ((AnnList (AnnListLayout (glR $1)) ListNone [], noAnn),Just (unLoc $2)) }
- | '{' '..' '}' { sLL $1 $> ((AnnList AnnListBraces (ListBraces (epTok $1) (epTok $3)) [], epTok $2), Nothing) }
+ L loc ((AnnList (EpVirtualBraces (glR $1)) [], noAnn),Just (unLoc $2)) }
+ | '{' '..' '}' { sLL $1 $> ((AnnList (EpExplicitBraces (epTok $1) (epTok $3)) [], epTok $2), Nothing) }
| vocurly '..' close { let (L loc _) = $2 in
- L loc ((AnnList (AnnListLayout (glR $1)) ListNone [], epTok $2),Nothing) }
+ L loc ((AnnList (EpVirtualBraces (glR $1)) [], epTok $2),Nothing) }
ty_fam_inst_eqns :: { Located [LTyFamInstEqn GhcPs] }
: ty_fam_inst_eqns ';' ty_fam_inst_eqn
@@ -1797,10 +1797,10 @@ cvars1 :: { [RecordPatSynField GhcPs] }
where_decls :: { LocatedA (OrdList (LHsDecl GhcPs), EpToken "where", AnnList) }
: 'where' '{' decls '}' {% amsA' (sLL $1 $> (thdOf3 $ unLoc $3,
epTok $1,
- AnnList AnnListBraces (ListBraces (epTok $2) (epTok $4)) (sndOf3 $ unLoc $3))) }
+ AnnList (EpExplicitBraces (epTok $2) (epTok $4)) (sndOf3 $ unLoc $3))) }
| 'where' vocurly decls close {% amsA' (sLL $1 $3 (thdOf3 $ unLoc $3,
epTok $1,
- AnnList (AnnListLayout (glR $3)) ListNone (sndOf3 $ unLoc $3))) }
+ AnnList (EpVirtualBraces (glR $3)) (sndOf3 $ unLoc $3))) }
pattern_synonym_sig :: { LSig GhcPs }
: 'pattern' con_list '::' sigtype
@@ -1853,10 +1853,10 @@ decllist_cls
:: { Located ( AnnList
, OrdList (LHsDecl GhcPs)
, EpLayout) } -- Reversed
- : '{' decls_cls '}' { sLL $1 $> (AnnList AnnListBraces (ListBraces (epTok $1) (epTok $3)) (fst $ unLoc $2)
+ : '{' decls_cls '}' { sLL $1 $> (AnnList (EpExplicitBraces (epTok $1) (epTok $3)) (fst $ unLoc $2)
,snd $ unLoc $2, epExplicitBraces $1 $3) }
| vocurly decls_cls close { let { L l (anns, decls) = $2 }
- in L l (AnnList (AnnListLayout (glR $1)) ListNone anns, decls, EpVirtualBraces (glR $1)) }
+ in L l (AnnList (EpVirtualBraces (glR $1)) anns, decls, EpVirtualBraces (glR $1)) }
-- Class body
--
@@ -1897,8 +1897,8 @@ decls_inst :: { Located ([EpToken ";"],OrdList (LHsDecl GhcPs)) } -- Reversed
decllist_inst
:: { Located (AnnList, OrdList (LHsDecl GhcPs)) } -- Reversed
- : '{' decls_inst '}' { sLL $1 $> (AnnList AnnListBraces (ListBraces (epTok $1) (epTok $3)) (fst $ unLoc $2), snd $ unLoc $2) }
- | vocurly decls_inst close { L (gl $2) (AnnList (AnnListLayout (glR $1)) ListNone (fst $ unLoc $2), snd $ unLoc $2) }
+ : '{' decls_inst '}' { sLL $1 $> (AnnList (EpExplicitBraces (epTok $1) (epTok $3)) (fst $ unLoc $2), snd $ unLoc $2) }
+ | vocurly decls_inst close { L (gl $2) (AnnList (EpVirtualBraces (glR $1)) (fst $ unLoc $2), snd $ unLoc $2) }
-- Instance body
--
@@ -1935,9 +1935,9 @@ decls :: { Located (EpaLocation, [EpToken ";"], OrdList (LHsDecl GhcPs)) }
| {- empty -} { noLoc (noAnn, [],nilOL) }
decllist :: { Located (AnnList,Located (OrdList (LHsDecl GhcPs))) }
- : '{' decls '}' { sLL $1 $> (AnnList AnnListBraces (ListBraces (epTok $1) (epTok $3)) (sndOf3 $ unLoc $2)
+ : '{' decls '}' { sLL $1 $> (AnnList (EpExplicitBraces (epTok $1) (epTok $3)) (sndOf3 $ unLoc $2)
,sL1 $2 $ thdOf3 $ unLoc $2) }
- | vocurly decls close { sL1 $2 (AnnList (AnnListLayout (fstOf3 $ unLoc $2)) ListNone (sndOf3 $ unLoc $2)
+ | vocurly decls close { sL1 $2 (AnnList (EpVirtualBraces (fstOf3 $ unLoc $2)) (sndOf3 $ unLoc $2)
,sL1 $2 $ thdOf3 $ unLoc $2) }
-- Binding groups other than those of class and instance declarations
@@ -1945,16 +1945,16 @@ decllist :: { Located (AnnList,Located (OrdList (LHsDecl GhcPs))) }
binds :: { LHsLocalBinds GhcPs }
-- May have implicit parameters
-- No type declarations
- : decllist {% do { let { (AnnList la p s, decls) = unLoc $1 }
+ : decllist {% do { let { (ann, decls) = unLoc $1 }
; val_binds <- cvBindGroup (unLoc $ decls)
; !cs <- getCommentsFor (gl $1)
- ; return (L (EpAnn (glR $1) noAnn cs) $ HsValBinds (AnnList la p s, noEpTok) val_binds)} }
+ ; return (L (EpAnn (glR $1) noAnn cs) $ HsValBinds (ann, noEpTok) val_binds)} }
| '{' dbinds '}' {% amsA' (sLL $1 $>
- $ HsIPBinds (AnnList AnnListBraces (ListBraces (epTok $1) (epTok $3)) [], noEpTok) (IPBinds noExtField (reverse $ unLoc $2))) }
+ $ HsIPBinds (AnnList (EpExplicitBraces (epTok $1) (epTok $3)) [], noEpTok) (IPBinds noExtField (reverse $ unLoc $2))) }
| vocurly dbinds close {% amsA' (sLL $1 $2
- $ HsIPBinds (AnnList (AnnListLayout $ glR $2) ListNone [], noEpTok) (IPBinds noExtField (reverse $ unLoc $2))) }
+ $ HsIPBinds (AnnList (EpVirtualBraces $ glR $2) [], noEpTok) (IPBinds noExtField (reverse $ unLoc $2))) }
wherebinds :: { Maybe (LHsLocalBinds GhcPs) }
@@ -2556,11 +2556,11 @@ gadt_constrlist :: { Located ((EpToken "where", AnnList)
: 'where' '{' gadt_constrs '}' {% checkEmptyGADTs $
L (comb2 $1 $4)
- ((epTok $1, AnnList AnnListBraces (ListBraces (epTok $2) (epTok $4)) [])
+ ((epTok $1, AnnList (EpExplicitBraces (epTok $2) (epTok $4)) [])
, unLoc $3) }
| 'where' vocurly gadt_constrs close {% checkEmptyGADTs $
L (comb2 $1 $3)
- ((epTok $1, AnnList (AnnListLayout $ glR $2) ListNone [])
+ ((epTok $1, AnnList (EpVirtualBraces $ glR $2) [])
, unLoc $3) }
| {- empty -} { noLoc (noAnn,[]) }
@@ -3339,8 +3339,8 @@ acmd :: { LHsCmdTop GhcPs }
return (sL1a cmd $ HsCmdTop noExtField cmd) }
cvtopbody :: { (AnnList,[LHsDecl GhcPs]) }
- : '{' cvtopdecls0 '}' { (AnnList AnnListBraces (ListBraces (epTok $1) (epTok $3)) [],$2) }
- | vocurly cvtopdecls0 close { (AnnList (AnnListLayout (glR $1)) ListNone [],$2) }
+ : '{' cvtopdecls0 '}' { (AnnList (EpExplicitBraces (epTok $1) (epTok $3)) [],$2) }
+ | vocurly cvtopdecls0 close { (AnnList (EpVirtualBraces (glR $1)) [],$2) }
cvtopdecls0 :: { [LHsDecl GhcPs] }
: topdecls_semi { cvTopDecls $1 }
@@ -3568,12 +3568,12 @@ guardquals1 :: { Located [LStmt GhcPs (LHsExpr GhcPs)] }
altslist(PATS) :: { forall b. DisambECP b => PV (LocatedA ([LMatch GhcPs (LocatedA b)], AnnList)) }
: '{' alts(PATS) '}' { $2 >>= \ $2 -> amsA'
(sLL $1 $> (reverse (snd $ unLoc $2),
- (AnnList AnnListBraces (ListBraces (epTok $1) (epTok $3)) (fst $ unLoc $2)))) }
+ (AnnList (EpExplicitBraces (epTok $1) (epTok $3)) (fst $ unLoc $2)))) }
| vocurly alts(PATS) close { $2 >>= \ $2 -> amsA'
(L (getLoc $2) (reverse (snd $ unLoc $2),
- (AnnList (AnnListLayout $ glR $2) ListNone (fst $ unLoc $2)))) }
- | '{' '}' { amsA' (sLL $1 $> ([], (AnnList AnnListBraces (ListBraces (epTok $1) (epTok $2)) []))) }
- | vocurly close { return $ noLocA ([], AnnList (AnnListLayout $ glR $1) ListNone []) }
+ (AnnList (EpVirtualBraces $ glR $2) (fst $ unLoc $2)))) }
+ | '{' '}' { amsA' (sLL $1 $> ([], (AnnList (EpExplicitBraces (epTok $1) (epTok $2)) []))) }
+ | vocurly close { return $ noLocA ([], AnnList (EpVirtualBraces $ glR $1) []) }
alts(PATS) :: { forall b. DisambECP b => PV (Located ([EpToken ";"],[LMatch GhcPs (LocatedA b)])) }
: alts1(PATS) { $1 >>= \ $1 -> return $
@@ -3630,9 +3630,9 @@ gdpats :: { forall b. DisambECP b => PV (Located (NonEmpty (LGRHS GhcPs (Located
-- we don't need it.
ifgdpats :: { Located (AnnList, NonEmpty (LGRHS GhcPs (LHsExpr GhcPs))) }
: '{' gdpats '}' {% runPV $2 >>= \ $2 ->
- return $ sLL $1 $> (AnnList AnnListBraces (ListBraces (epTok $1) (epTok $3)) [], unLoc $2) }
+ return $ sLL $1 $> (AnnList (EpExplicitBraces (epTok $1) (epTok $3)) [], unLoc $2) }
| gdpats close {% runPV $1 >>= \ $1 ->
- return $ sL1 $1 (AnnList (AnnListLayout (startLocSpan $ glR $1)) ListNone [], unLoc $1) }
+ return $ sL1 $1 (AnnList (EpVirtualBraces (startLocSpan $ glR $1)) [], unLoc $1) }
gdpat :: { forall b. DisambECP b => PV (LGRHS GhcPs (LocatedA b)) }
: '|' guardquals '->' exp
@@ -3682,10 +3682,10 @@ apat : aexp {% (checkPattern <=< runPV) (unECP $1) }
stmtlist :: { forall b. DisambECP b => PV (LocatedA (AnnList, Located [LocatedA (Stmt GhcPs (LocatedA b))])) }
: '{' stmts '}' { $2 >>= \ $2 ->
- amsA' (sLL $1 $> (AnnList AnnListBraces (ListBraces (epTok $1) (epTok $3)) (fromOL $ fst $ unLoc $2)
+ amsA' (sLL $1 $> (AnnList (EpExplicitBraces (epTok $1) (epTok $3)) (fromOL $ fst $ unLoc $2)
, sL1 $2 $ reverse $ snd $ unLoc $2))}
| vocurly stmts close { $2 >>= \ $2 ->
- amsA' (L (stmtsLoc $2) (AnnList (AnnListLayout (spanAsAnchor $ stmtsLoc $2)) ListNone (fromOL $ fst $ unLoc $2)
+ amsA' (L (stmtsLoc $2) (AnnList (EpVirtualBraces (spanAsAnchor $ stmtsLoc $2)) (fromOL $ fst $ unLoc $2)
, sL1 $2 $ reverse $ snd $ unLoc $2))}
-- do { ;; s ; s ; ; s ;; }
=====================================
compiler/GHC/Parser/Annotation.hs
=====================================
@@ -41,7 +41,7 @@ module GHC.Parser.Annotation (
-- ** Annotation data types used in TTG extension points
- AnnList(..), AnnListBrackets(..), AnnListLayout(..),
+ AnnList(..),
AnnParen(..),
AnnCType(..),AnnWarningTxt(..),AnnOverlap(..),AnnAnnDecl(..),AnnPragSCC(..),
@@ -291,6 +291,7 @@ data EpLayout =
EpNoLayout
deriving instance Data EpLayout
+deriving instance Eq EpLayout
-- | Used in 'GHC.Parser.Haddock' to get layout column. It assumes
-- | there is a RealSrcSpan in it, falling back to zero otherwise
@@ -522,31 +523,12 @@ instance Outputable TrailingAnn where
-- surrounding items such as braces if present, and introductory
-- keywords such as 'where'.
--- AZ: goal: only used when there is layout, so vertical alignment matters
data AnnList
= AnnList {
- al_layout :: !AnnListLayout,
- al_brackets :: !AnnListBrackets,
+ al_layout :: !EpLayout,
al_semis :: [EpToken ";"] -- decls
} deriving (Data,Eq)
-data AnnListBrackets
- = ListBraces (EpToken "{") (EpToken "}")
- | ListNone
- deriving (Data,Eq)
-
--- | How the extent of a list was delimited in the source.
-data AnnListLayout
- = AnnListBraces -- ^ Explicit @{ ; }@ written by the user. The tokens
- -- live in 'al_brackets' and 'al_semis'.
- | AnnListLayout !EpaLocation
- -- ^ The lexer opened an implicit layout context.
- -- The 'EpaLocation' is the @vocurly@ token (or, for
- -- MultiWayIf, the leading @|@), whose start column is
- -- the layout column chosen by 'new_layout_context'.
- | AnnListNoLayout -- ^ Neither: an Empty or compiler-generated list.
- deriving (Data, Eq)
-
-- ---------------------------------------------------------------------
-- Annotations for parenthesised elements, such as tuples, lists
-- ---------------------------------------------------------------------
@@ -1017,10 +999,10 @@ instance NoAnn NoEpAnns where
noAnn = NoEpAnns
instance NoAnn AnnList where
- noAnn = AnnList noAnn ListNone noAnn
+ noAnn = AnnList noAnn noAnn
-instance NoAnn AnnListLayout where
- noAnn = AnnListNoLayout
+instance NoAnn EpLayout where
+ noAnn = EpNoLayout
instance NoAnn NameAnn where
noAnn = NameAnnTrailing []
@@ -1114,17 +1096,13 @@ instance Outputable NameAnn where
= text "NameAnnTrailing" <+> ppr t
instance Outputable AnnList where
- ppr (AnnList l p s)
- = text "AnnList" <+> ppr l <+> ppr p <+> ppr s
-
-instance Outputable AnnListBrackets where
- ppr (ListBraces o c) = text "ListBraces" <+> ppr o <+> ppr c
- ppr ListNone = text "ListNone"
+ ppr (AnnList l s)
+ = text "AnnList" <+> ppr l <+> ppr s
-instance Outputable AnnListLayout where
- ppr AnnListBraces = text "AnnListBraces"
- ppr (AnnListLayout l) = text "AnnListLayout" <+> ppr l
- ppr AnnListNoLayout = text "AnnListNoLayout"
+instance Outputable EpLayout where
+ ppr (EpExplicitBraces o c) = text "EpExplicitBraces" <+> ppr o <+> ppr c
+ ppr (EpVirtualBraces l) = text "EpVirtualBraces" <+> ppr l
+ ppr EpNoLayout = text "EpNoLayout"
instance Outputable AnnCType where
ppr (AnnCType o c l ca)
=====================================
compiler/GHC/Parser/PostProcess.hs
=====================================
@@ -473,13 +473,13 @@ valid_anchor (EpaSpan (RealSrcSpan r _)) = srcSpanStartLine r >= 0
valid_anchor _ = False
patch_annlist_layout :: AnnList -> AnnList
-patch_annlist_layout (AnnList lo bs s) = AnnList (patch_layout lo) bs s
+patch_annlist_layout (AnnList lo s) = AnnList (patch_layout lo) s
-- If the decl list for where binds is empty, the anchor ends up
-- invalid. Explicitly mark it as not having layout
-patch_layout :: AnnListLayout -> AnnListLayout
-patch_layout lo@(AnnListLayout (EpaSpan (RealSrcSpan _ _)) ) = lo
-patch_layout (AnnListLayout _ ) = AnnListNoLayout
+patch_layout :: EpLayout -> EpLayout
+patch_layout lo@(EpVirtualBraces (EpaSpan (RealSrcSpan _ _)) ) = lo
+patch_layout (EpVirtualBraces _ ) = EpNoLayout
patch_layout lo = lo
-- | The anchor for a stmtlist is based on either the location or
=====================================
testsuite/tests/ghc-api/exactprint/T22919.stderr
=====================================
@@ -70,8 +70,7 @@
((,)
(FromSource)
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[]))
(L
(EpAnn
=====================================
testsuite/tests/ghc-api/exactprint/Test20239.stderr
=====================================
@@ -134,8 +134,7 @@
(EpTok
(EpaSpan { <no location info> }))
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[])
(EpTok
(EpaSpan { Test20239.hs:5:34 })))
=====================================
testsuite/tests/ghc-api/exactprint/ZeroWidthSemi.stderr
=====================================
@@ -82,8 +82,7 @@
((,)
(FromSource)
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[]))
(L
(EpAnn
=====================================
testsuite/tests/haddock/should_compile_flag_haddock/T17544.stderr
=====================================
@@ -61,9 +61,8 @@
(EpTok
(EpaSpan { T17544.hs:5:12-16 }))
(AnnList
- (AnnListLayout
+ (EpVirtualBraces
(EpaSpan { T17544.hs:6:3 }))
- (ListNone)
[]))
(EpVirtualBraces
(EpaSpan { T17544.hs:6:3 })))
@@ -242,9 +241,8 @@
(EpTok
(EpaSpan { T17544.hs:9:12-16 }))
(AnnList
- (AnnListLayout
+ (EpVirtualBraces
(EpaSpan { T17544.hs:10:3 }))
- (ListNone)
[]))
(EpVirtualBraces
(EpaSpan { T17544.hs:10:3 })))
@@ -424,9 +422,8 @@
(EpTok
(EpaSpan { T17544.hs:13:12-16 }))
(AnnList
- (AnnListLayout
+ (EpVirtualBraces
(EpaSpan { T17544.hs:14:3 }))
- (ListNone)
[]))
(EpVirtualBraces
(EpaSpan { T17544.hs:14:3 })))
@@ -606,9 +603,8 @@
(EpTok
(EpaSpan { T17544.hs:17:12-16 }))
(AnnList
- (AnnListLayout
+ (EpVirtualBraces
(EpaSpan { T17544.hs:18:3 }))
- (ListNone)
[]))
(EpVirtualBraces
(EpaSpan { T17544.hs:18:3 })))
@@ -855,8 +851,7 @@
(EpTok
(EpaSpan { T17544.hs:22:12-16 }))
(AnnList
- (AnnListBraces)
- (ListBraces
+ (EpExplicitBraces
(EpTok (EpaSpan { T17544.hs:22:18 }))
(EpTok (EpaSpan { T17544.hs:22:30 })))
[]))
@@ -1011,9 +1006,8 @@
(EpTok
(EpaSpan { T17544.hs:23:17-21 }))
(AnnList
- (AnnListLayout
+ (EpVirtualBraces
(EpaSpan { T17544.hs:24:3 }))
- (ListNone)
[])))
[]
(L
@@ -1139,9 +1133,8 @@
(EpTok
(EpaSpan { T17544.hs:24:15-19 }))
(AnnList
- (AnnListLayout
+ (EpVirtualBraces
(EpaSpan { T17544.hs:25:5 }))
- (ListNone)
[])
(EpTok
(EpaSpan { <no location info> })))
@@ -1257,8 +1250,7 @@
(EpTok
(EpaSpan { T17544.hs:28:12-16 }))
(AnnList
- (AnnListBraces)
- (ListBraces
+ (EpExplicitBraces
(EpTok (EpaSpan { T17544.hs:28:18 }))
(EpTok (EpaSpan { T17544.hs:28:30 })))
[]))
@@ -1413,9 +1405,8 @@
(EpTok
(EpaSpan { T17544.hs:29:17-21 }))
(AnnList
- (AnnListLayout
+ (EpVirtualBraces
(EpaSpan { T17544.hs:30:3 }))
- (ListNone)
[])))
[]
(L
@@ -1541,9 +1532,8 @@
(EpTok
(EpaSpan { T17544.hs:30:15-19 }))
(AnnList
- (AnnListLayout
+ (EpVirtualBraces
(EpaSpan { T17544.hs:31:5 }))
- (ListNone)
[])
(EpTok
(EpaSpan { <no location info> })))
@@ -1659,8 +1649,7 @@
(EpTok
(EpaSpan { T17544.hs:34:12-16 }))
(AnnList
- (AnnListBraces)
- (ListBraces
+ (EpExplicitBraces
(EpTok (EpaSpan { T17544.hs:34:18 }))
(EpTok (EpaSpan { T17544.hs:34:30 })))
[]))
@@ -1815,9 +1804,8 @@
(EpTok
(EpaSpan { T17544.hs:35:17-21 }))
(AnnList
- (AnnListLayout
+ (EpVirtualBraces
(EpaSpan { T17544.hs:36:3 }))
- (ListNone)
[])))
[]
(L
@@ -1943,9 +1931,8 @@
(EpTok
(EpaSpan { T17544.hs:36:15-19 }))
(AnnList
- (AnnListLayout
+ (EpVirtualBraces
(EpaSpan { T17544.hs:37:5 }))
- (ListNone)
[])
(EpTok
(EpaSpan { <no location info> })))
@@ -2061,8 +2048,7 @@
(EpTok
(EpaSpan { T17544.hs:40:12-16 }))
(AnnList
- (AnnListBraces)
- (ListBraces
+ (EpExplicitBraces
(EpTok (EpaSpan { T17544.hs:40:18 }))
(EpTok (EpaSpan { T17544.hs:40:30 })))
[]))
@@ -2217,9 +2203,8 @@
(EpTok
(EpaSpan { T17544.hs:41:17-21 }))
(AnnList
- (AnnListLayout
+ (EpVirtualBraces
(EpaSpan { T17544.hs:42:3 }))
- (ListNone)
[])))
[]
(L
@@ -2345,9 +2330,8 @@
(EpTok
(EpaSpan { T17544.hs:42:15-19 }))
(AnnList
- (AnnListLayout
+ (EpVirtualBraces
(EpaSpan { T17544.hs:43:5 }))
- (ListNone)
[])
(EpTok
(EpaSpan { <no location info> })))
@@ -2463,8 +2447,7 @@
(EpTok
(EpaSpan { T17544.hs:46:12-16 }))
(AnnList
- (AnnListBraces)
- (ListBraces
+ (EpExplicitBraces
(EpTok (EpaSpan { T17544.hs:46:18 }))
(EpTok (EpaSpan { T17544.hs:46:30 })))
[]))
@@ -2619,9 +2602,8 @@
(EpTok
(EpaSpan { T17544.hs:47:17-21 }))
(AnnList
- (AnnListLayout
+ (EpVirtualBraces
(EpaSpan { T17544.hs:48:3 }))
- (ListNone)
[])))
[]
(L
@@ -2747,9 +2729,8 @@
(EpTok
(EpaSpan { T17544.hs:48:15-19 }))
(AnnList
- (AnnListLayout
+ (EpVirtualBraces
(EpaSpan { T17544.hs:49:5 }))
- (ListNone)
[])
(EpTok
(EpaSpan { <no location info> })))
@@ -2865,8 +2846,7 @@
(EpTok
(EpaSpan { T17544.hs:52:13-17 }))
(AnnList
- (AnnListBraces)
- (ListBraces
+ (EpExplicitBraces
(EpTok (EpaSpan { T17544.hs:52:19 }))
(EpTok (EpaSpan { T17544.hs:52:32 })))
[]))
@@ -3021,9 +3001,8 @@
(EpTok
(EpaSpan { T17544.hs:53:18-22 }))
(AnnList
- (AnnListLayout
+ (EpVirtualBraces
(EpaSpan { T17544.hs:54:3 }))
- (ListNone)
[])))
[]
(L
@@ -3149,9 +3128,8 @@
(EpTok
(EpaSpan { T17544.hs:54:16-20 }))
(AnnList
- (AnnListLayout
+ (EpVirtualBraces
(EpaSpan { T17544.hs:55:5 }))
- (ListNone)
[])
(EpTok
(EpaSpan { <no location info> })))
=====================================
testsuite/tests/haddock/should_compile_flag_haddock/T17544_kw.stderr
=====================================
@@ -185,9 +185,8 @@
(EpTok
(EpaSpan { T17544_kw.hs:14:3-7 }))
(AnnList
- (AnnListLayout
+ (EpVirtualBraces
(EpaSpan { T17544_kw.hs:14:9 }))
- (ListNone)
[])
(EpTok
(EpaSpan { <no location info> })))
@@ -296,9 +295,8 @@
(EpTok
(EpaSpan { T17544_kw.hs:17:3-7 }))
(AnnList
- (AnnListLayout
+ (EpVirtualBraces
(EpaSpan { T17544_kw.hs:17:9 }))
- (ListNone)
[])
(EpTok
(EpaSpan { <no location info> })))
@@ -415,9 +413,8 @@
(EpTok
(EpaSpan { T17544_kw.hs:21:3-7 }))
(AnnList
- (AnnListLayout
+ (EpVirtualBraces
(EpaSpan { T17544_kw.hs:22:5 }))
- (ListNone)
[]))
(EpVirtualBraces
(EpaSpan { T17544_kw.hs:22:5 })))
=====================================
testsuite/tests/haddock/should_compile_flag_haddock/T24221.stderr
=====================================
@@ -82,8 +82,7 @@
(EpTok
(EpaSpan { <no location info> }))
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[])
(EpTok
(EpaSpan { T24221.hs:5:3 })))
@@ -419,8 +418,7 @@
(EpTok
(EpaSpan { <no location info> }))
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[])
(EpTok
(EpaSpan { T24221.hs:11:11 })))
@@ -590,8 +588,7 @@
(EpTok
(EpaSpan { <no location info> }))
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[])
(EpTok
(EpaSpan { T24221.hs:14:11 })))
@@ -787,8 +784,7 @@
(EpTok
(EpaSpan { <no location info> }))
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[])
(EpTok
(EpaSpan { T24221.hs:19:11 })))
@@ -984,8 +980,7 @@
(EpTok
(EpaSpan { <no location info> }))
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[])
(EpTok
(EpaSpan { T24221.hs:27:11 })))
@@ -1228,8 +1223,7 @@
(EpTok
(EpaSpan { <no location info> }))
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[])
(EpTok
(EpaSpan { T24221.hs:31:11 })))
@@ -1485,8 +1479,7 @@
(EpTok
(EpaSpan { <no location info> }))
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[])
(EpTok
(EpaSpan { T24221.hs:36:11 })))
=====================================
testsuite/tests/module/mod185.stderr
=====================================
@@ -97,8 +97,7 @@
((,)
(FromSource)
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[]))
(L
(EpAnn
=====================================
testsuite/tests/parser/should_compile/DumpParsedAst.stderr
=====================================
@@ -120,8 +120,7 @@
(EpTok
(EpaSpan { <no location info> }))
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[])
(EpTok
(EpaSpan { DumpParsedAst.hs:7:12 })))
@@ -365,9 +364,8 @@
(EpaSpan { <no location info> })))
(ClosedTypeFamily
(AnnList
- (AnnListLayout
+ (EpVirtualBraces
(EpaSpan { DumpParsedAst.hs:11:3 }))
- (ListNone)
[])
(Just
[(L
@@ -837,8 +835,7 @@
(EpTok
(EpaSpan { <no location info> }))
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[])
(EpTok
(EpaSpan { DumpParsedAst.hs:15:19 })))
@@ -1154,9 +1151,8 @@
(EpaSpan { <no location info> })))
(ClosedTypeFamily
(AnnList
- (AnnListLayout
+ (EpVirtualBraces
(EpaSpan { DumpParsedAst.hs:19:3 }))
- (ListNone)
[])
(Just
[(L
@@ -1808,9 +1804,8 @@
(EpTok
(EpaSpan { DumpParsedAst.hs:22:62-66 }))
(AnnList
- (AnnListLayout
+ (EpVirtualBraces
(EpaSpan { DumpParsedAst.hs:23:3 }))
- (ListNone)
[])
(EpTok
(EpaSpan { <no location info> })))
@@ -2235,8 +2230,7 @@
((,)
(FromSource)
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[]))
(L
(EpAnn
=====================================
testsuite/tests/parser/should_compile/DumpParsedAstComments.stderr
=====================================
@@ -90,8 +90,7 @@
((,)
(FromSource)
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[]))
(L
(EpAnn
@@ -219,8 +218,7 @@
((,)
(FromSource)
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[]))
(L
(EpAnn
@@ -297,9 +295,8 @@
((,)
(Right
(AnnList
- (AnnListLayout
+ (EpVirtualBraces
(EpaSpan { DumpParsedAstComments.hs:16:3 }))
- (ListNone)
[]))
(EpaSpan { DumpParsedAstComments.hs:14:7-8 }))
(DoExpr
@@ -373,8 +370,7 @@
((,)
(FromSource)
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[]))
(L
(EpAnn
=====================================
testsuite/tests/parser/should_compile/DumpRenamedAst.stderr
=====================================
@@ -30,8 +30,7 @@
((,)
(FromSource)
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[]))
(L
(EpAnn
@@ -184,8 +183,7 @@
(EpTok
(EpaSpan { <no location info> }))
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[])
(EpTok
(EpaSpan { <no location info> })))
@@ -318,9 +316,8 @@
(EpaSpan { <no location info> })))
(ClosedTypeFamily
(AnnList
- (AnnListLayout
+ (EpVirtualBraces
(EpaSpan { DumpRenamedAst.hs:13:3 }))
- (ListNone)
[])
(Just
[(L
@@ -1046,8 +1043,7 @@
(EpTok
(EpaSpan { <no location info> }))
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[])
(EpTok
(EpaSpan { <no location info> })))
@@ -1194,9 +1190,8 @@
(EpaSpan { <no location info> })))
(ClosedTypeFamily
(AnnList
- (AnnListLayout
+ (EpVirtualBraces
(EpaSpan { DumpRenamedAst.hs:26:3 }))
- (ListNone)
[])
(Just
[(L
@@ -2322,8 +2317,7 @@
(EpTok
(EpaSpan { <no location info> }))
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[])
(EpTok
(EpaSpan { <no location info> })))
=====================================
testsuite/tests/parser/should_compile/DumpSemis.stderr
=====================================
@@ -261,8 +261,7 @@
((,)
(FromSource)
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[]))
(L
(EpAnn
@@ -333,9 +332,8 @@
((,)
(Right
(AnnList
- (AnnListLayout
- (EpaSpan { DumpSemis.hs:(11,3)-(12,3) }))
- (ListNone)
+ (EpVirtualBraces
+ (EpaSpan { DumpSemis.hs:(11,3)-(12,3) }))
[]))
(EpaSpan { DumpSemis.hs:10:7-8 }))
(DoExpr
@@ -364,8 +362,7 @@
((,)
(Right
(AnnList
- (AnnListBraces)
- (ListBraces
+ (EpExplicitBraces
(EpTok (EpaSpan { DumpSemis.hs:11:6 }))
(EpTok (EpaSpan { DumpSemis.hs:11:15 })))
[(EpTok
@@ -560,8 +557,7 @@
((,)
(FromSource)
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[]))
(L
(EpAnn
@@ -632,8 +628,7 @@
((,)
(Right
(AnnList
- (AnnListBraces)
- (ListBraces
+ (EpExplicitBraces
(EpTok (EpaSpan { DumpSemis.hs:16:3 }))
(EpTok (EpaSpan { DumpSemis.hs:19:3 })))
[(EpTok
@@ -818,8 +813,7 @@
((,)
(FromSource)
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[]))
(L
(EpAnn
@@ -890,8 +884,7 @@
((,)
(Right
(AnnList
- (AnnListBraces)
- (ListBraces
+ (EpExplicitBraces
(EpTok (EpaSpan { DumpSemis.hs:22:10 }))
(EpTok (EpaSpan { DumpSemis.hs:22:30 })))
[(EpTok
@@ -1032,8 +1025,7 @@
((,)
(FromSource)
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[]))
(L
(EpAnn
@@ -1143,8 +1135,7 @@
((,)
(FromSource)
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[]))
(L
(EpAnn
@@ -1256,8 +1247,7 @@
((,)
(FromSource)
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[]))
(L
(EpAnn
@@ -1366,9 +1356,8 @@
(EpTok
(EpaSpan { DumpSemis.hs:28:40-44 }))
(AnnList
- (AnnListLayout
+ (EpVirtualBraces
(EpaSpan { DumpSemis.hs:29:3 }))
- (ListNone)
[]))
(EpVirtualBraces
(EpaSpan { DumpSemis.hs:29:3 })))
@@ -1766,8 +1755,7 @@
((,)
(FromSource)
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[]))
(L
(EpAnn
@@ -1898,8 +1886,7 @@
((,)
(FromSource)
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[]))
(L
(EpAnn
@@ -1981,8 +1968,7 @@
(HsValBinds
((,)
(AnnList
- (AnnListBraces)
- (ListBraces
+ (EpExplicitBraces
(EpTok (EpaSpan { DumpSemis.hs:34:13 }))
(EpTok (EpaSpan { DumpSemis.hs:34:31 })))
[(EpTok
@@ -2026,8 +2012,7 @@
((,)
(FromSource)
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[]))
(L
(EpAnn
@@ -2145,8 +2130,7 @@
((,)
(FromSource)
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[]))
(L
(EpAnn
@@ -2282,8 +2266,7 @@
((,)
(FromSource)
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[]))
(L
(EpAnn
@@ -2393,8 +2376,7 @@
((,)
(FromSource)
(AnnList
- (AnnListBraces)
- (ListBraces
+ (EpExplicitBraces
(EpTok (EpaSpan { DumpSemis.hs:38:4 }))
(EpTok (EpaSpan { DumpSemis.hs:44:4 })))
[(EpTok
=====================================
testsuite/tests/parser/should_compile/KindSigs.stderr
=====================================
@@ -112,9 +112,8 @@
(EpaSpan { <no location info> })))
(ClosedTypeFamily
(AnnList
- (AnnListLayout
+ (EpVirtualBraces
(EpaSpan { KindSigs.hs:12:3 }))
- (ListNone)
[])
(Just
[(L
@@ -1003,8 +1002,7 @@
((,)
(FromSource)
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[]))
(L
(EpAnn
@@ -1728,8 +1726,7 @@
((,)
(FromSource)
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[]))
(L
(EpAnn
=====================================
testsuite/tests/parser/should_compile/T14189.stderr
=====================================
@@ -54,8 +54,7 @@
(EpTok
(EpaSpan { <no location info> }))
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[])
(EpTok
(EpaSpan { <no location info> })))
=====================================
testsuite/tests/parser/should_compile/T15279.stderr
=====================================
@@ -28,7 +28,7 @@
[]
[]))
(EpVirtualBraces
- (1))
+ (EpaSpan { T15279.hs:5:1 }))
(Nothing)
(Nothing))
(Just
@@ -155,8 +155,7 @@
((,)
(FromSource)
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[]))
(L
(EpAnn
@@ -239,8 +238,14 @@
(SourceText 'b')
('b'))))))
[])
- (EmptyLocalBinds
- (NoExtField)))))
+ (L
+ (EpAnn
+ (EpaSpan { <no location info> })
+ []
+ (EpaComments
+ []))
+ (EmptyLocalBinds
+ (NoExtField))))))
,(L
(EpAnn
(EpaSpan { T15279.hs-incl:2:1-13 })
@@ -316,8 +321,14 @@
(SourceText 'c')
('c'))))))
[])
- (EmptyLocalBinds
- (NoExtField)))))
+ (L
+ (EpAnn
+ (EpaSpan { <no location info> })
+ []
+ (EpaComments
+ []))
+ (EmptyLocalBinds
+ (NoExtField))))))
,(L
(EpAnn
(EpaSpan { T15279.hs:7:1-11 })
@@ -390,7 +401,13 @@
(SourceText 'a')
('a'))))))
[])
- (EmptyLocalBinds
- (NoExtField)))))])))))]))
+ (L
+ (EpAnn
+ (EpaSpan { <no location info> })
+ []
+ (EpaComments
+ []))
+ (EmptyLocalBinds
+ (NoExtField))))))])))))]))
=====================================
testsuite/tests/parser/should_compile/T15323.stderr
=====================================
@@ -111,9 +111,8 @@
(EpTok
(EpaSpan { T15323.hs:5:21-25 }))
(AnnList
- (AnnListLayout
+ (EpVirtualBraces
(EpaSpan { T15323.hs:6:5 }))
- (ListNone)
[])
(EpTok
(EpaSpan { <no location info> })))
=====================================
testsuite/tests/parser/should_compile/T20452.stderr
=====================================
@@ -130,8 +130,7 @@
(EpTok
(EpaSpan { <no location info> }))
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[])
(EpTok
(EpaSpan { T20452.hs:5:24 })))
@@ -263,8 +262,7 @@
(EpTok
(EpaSpan { <no location info> }))
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[])
(EpTok
(EpaSpan { T20452.hs:6:24 })))
@@ -325,8 +323,7 @@
(EpTok
(EpaSpan { T20452.hs:8:78-82 }))
(AnnList
- (AnnListBraces)
- (ListBraces
+ (EpExplicitBraces
(EpTok (EpaSpan { T20452.hs:8:84 }))
(EpTok (EpaSpan { T20452.hs:8:85 })))
[]))
@@ -560,8 +557,7 @@
(EpTok
(EpaSpan { T20452.hs:9:78-82 }))
(AnnList
- (AnnListBraces)
- (ListBraces
+ (EpExplicitBraces
(EpTok (EpaSpan { T20452.hs:9:84 }))
(EpTok (EpaSpan { T20452.hs:9:85 })))
[]))
=====================================
testsuite/tests/parser/should_compile/T20718.stderr
=====================================
@@ -104,8 +104,7 @@
((,)
(FromSource)
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[]))
(L
(EpAnn
=====================================
testsuite/tests/parser/should_compile/T20846.stderr
=====================================
@@ -94,8 +94,7 @@
((,)
(FromSource)
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[]))
(L
(EpAnn
=====================================
testsuite/tests/printer/T18791.stderr
=====================================
@@ -82,9 +82,8 @@
(EpTok
(EpaSpan { T18791.hs:4:8-12 }))
(AnnList
- (AnnListLayout
+ (EpVirtualBraces
(EpaSpan { T18791.hs:5:3 }))
- (ListNone)
[])
(EpTok
(EpaSpan { <no location info> })))
=====================================
testsuite/tests/printer/Test20297.stdout
=====================================
@@ -83,8 +83,7 @@
((,)
(FromSource)
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[]))
(L
(EpAnn
@@ -178,8 +177,7 @@
(HsValBinds
((,)
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[])
(EpTok
(EpaSpan { Test20297.hs:9:3-7 })))
@@ -215,8 +213,7 @@
((,)
(FromSource)
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[]))
(L
(EpAnn
@@ -310,9 +307,8 @@
(HsValBinds
((,)
(AnnList
- (AnnListLayout
+ (EpVirtualBraces
(EpaSpan { Test20297.hs:13:9-26 }))
- (ListNone)
[])
(EpTok
(EpaSpan { Test20297.hs:12:3-7 })))
@@ -340,8 +336,7 @@
((,)
(FromSource)
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[]))
(L
(EpAnn
@@ -412,9 +407,8 @@
((,)
(Right
(AnnList
- (AnnListLayout
+ (EpVirtualBraces
(EpaSpan { Test20297.hs:13:22-26 }))
- (ListNone)
[]))
(EpaSpan { Test20297.hs:13:19-20 }))
(DoExpr
@@ -490,8 +484,7 @@
((,)
(FromSource)
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[]))
(L
(EpAnn
@@ -563,9 +556,8 @@
(EpTok
(EpaSpan { Test20297.hs:16:5-6 }))
(AnnList
- (AnnListLayout
+ (EpVirtualBraces
(EpaSpan { Test20297.hs:16:8 }))
- (ListNone)
[]))
(:|
(L
@@ -784,8 +776,7 @@
((,)
(FromSource)
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[]))
(L
(EpAnn
@@ -873,8 +864,7 @@
(HsValBinds
((,)
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[])
(EpTok
(EpaSpan { Test20297.ppr.hs:6:3-7 })))
@@ -904,8 +894,7 @@
((,)
(FromSource)
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[]))
(L
(EpAnn
@@ -993,9 +982,8 @@
(HsValBinds
((,)
(AnnList
- (AnnListLayout
+ (EpVirtualBraces
(EpaSpan { Test20297.ppr.hs:10:7-24 }))
- (ListNone)
[])
(EpTok
(EpaSpan { Test20297.ppr.hs:9:3-7 })))
@@ -1023,8 +1011,7 @@
((,)
(FromSource)
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[]))
(L
(EpAnn
@@ -1095,9 +1082,8 @@
((,)
(Right
(AnnList
- (AnnListLayout
+ (EpVirtualBraces
(EpaSpan { Test20297.ppr.hs:10:20-24 }))
- (ListNone)
[]))
(EpaSpan { Test20297.ppr.hs:10:17-18 }))
(DoExpr
@@ -1167,8 +1153,7 @@
((,)
(FromSource)
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[]))
(L
(EpAnn
@@ -1240,9 +1225,8 @@
(EpTok
(EpaSpan { Test20297.ppr.hs:11:5-6 }))
(AnnList
- (AnnListLayout
+ (EpVirtualBraces
(EpaSpan { Test20297.ppr.hs:11:8 }))
- (ListNone)
[]))
(:|
(L
=====================================
testsuite/tests/printer/Test24533.stdout
=====================================
@@ -65,8 +65,7 @@
(EpTok
(EpaSpan { <no location info> }))
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[])))
[]
(L
@@ -320,8 +319,7 @@
(EpTok
(EpaSpan { <no location info> }))
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[]))
(EpNoLayout))
[]
@@ -454,9 +452,8 @@
(EpTok
(EpaSpan { Test24533.hs:14:17-21 }))
(AnnList
- (AnnListLayout
+ (EpVirtualBraces
(EpaSpan { Test24533.hs:16:3 }))
- (ListNone)
[])))
[]
(L
@@ -538,8 +535,7 @@
((,)
(FromSource)
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[]))
(L
(EpAnn
@@ -735,8 +731,7 @@
(EpTok
(EpaSpan { <no location info> }))
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[])))
[]
(L
@@ -964,8 +959,7 @@
(EpTok
(EpaSpan { <no location info> }))
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[]))
(EpNoLayout))
[]
@@ -1051,9 +1045,8 @@
(EpTok
(EpaSpan { Test24533.ppr.hs:5:17-21 }))
(AnnList
- (AnnListLayout
+ (EpVirtualBraces
(EpaSpan { Test24533.ppr.hs:6:3 }))
- (ListNone)
[])))
[]
(L
@@ -1135,8 +1128,7 @@
((,)
(FromSource)
(AnnList
- (AnnListNoLayout)
- (ListNone)
+ (EpNoLayout)
[]))
(L
(EpAnn
=====================================
utils/check-exact/ExactPrint.hs
=====================================
@@ -967,23 +967,17 @@ markExternalSourceTextA ann src txt = do
-- ---------------------------------------------------------------------
-markLensBracketsO :: (Monad m, Monoid w)
- => a -> Lens a AnnListBrackets -> EP w m a
-markLensBracketsO a l =
- case view l a of
- ListBraces o c -> do
- o' <- markEpToken o
- return (set l (ListBraces o' c) a)
- ListNone -> return (set l ListNone a)
-
-markLensBracketsC :: (Monad m, Monoid w)
- => a -> Lens a AnnListBrackets -> EP w m a
-markLensBracketsC a l =
- case view l a of
- ListBraces o c -> do
- c' <- markEpToken c
- return (set l (ListBraces o c') a)
- ListNone -> return (set l ListNone a)
+markEpLayoutO :: (Monad m, Monoid w) => EpLayout -> EP w m EpLayout
+markEpLayoutO (EpExplicitBraces o c) = do
+ o' <- markEpToken o
+ return (EpExplicitBraces o' c)
+markEpLayoutO ep = return ep
+
+markEpLayoutC :: (Monad m, Monoid w) => EpLayout -> EP w m EpLayout
+markEpLayoutC (EpExplicitBraces o c) = do
+ c' <- markEpToken c
+ return (EpExplicitBraces o c')
+markEpLayoutC ep = return ep
-- -------------------------------------
@@ -1148,26 +1142,6 @@ limportDeclAnnPackage k annImp = fmap (\new -> annImp { importDeclAnnPackage = n
-- -------------------------------------
--- data AnnList
--- = AnnList {
--- al_layout :: !AnnListLayout,
--- al_brackets :: !AnnListBrackets,
--- al_semis :: [EpToken ";"], -- decls
--- al_trailing :: [TrailingAnn] -- ^ items appearing after the
--- -- list, such as '=>' for a
--- -- context
--- } deriving (Data,Eq)
-
-lal_brackets :: Lens AnnList AnnListBrackets
-lal_brackets k parent = fmap (\new -> parent { al_brackets = new })
- (k (al_brackets parent))
-
-lal_semis :: Lens AnnList [EpToken ";"]
-lal_semis k parent = fmap (\new -> parent { al_semis = new })
- (k (al_semis parent))
-
--- -------------------------------------
-
lfst :: Lens (a,b) a
lfst k parent = fmap (\new -> (new, snd parent))
(k (fst parent))
@@ -1427,12 +1401,6 @@ markLensFun a l f = do
-- -------------------------------------
-markEpAnnAllLT :: (Monad m, Monoid w, KnownSymbol tok)
- => ann -> Lens ann [EpToken tok] -> EP w m ann
-markEpAnnAllLT a l = do
- anns <- mapM markEpToken (view l a)
- return (set l anns a)
-
markEpaLocationAll :: (Monad m, Monoid w)
=> [EpaLocation] -> String -> EP w m [EpaLocation]
markEpaLocationAll locs str = mapM (\l -> printStringAtAA l str) locs
@@ -1468,12 +1436,12 @@ markAnnListA :: (Monad m, Monoid w)
=> AnnList
-> EP w m a
-> EP w m (AnnList, a)
-markAnnListA an action = do
- an0 <- markLensBracketsO an lal_brackets
- an1 <- markEpAnnAllLT an0 lal_semis
+markAnnListA (AnnList la semis) action = do
+ la0 <- markEpLayoutO la
+ semis' <- mapM markEpToken semis
r <- action
- an2 <- markLensBracketsC an1 lal_brackets
- return (an2, r)
+ la1 <- markEpLayoutC la0
+ return ((AnnList la1 semis'), r)
-- ---------------------------------------------------------------------
@@ -2638,7 +2606,7 @@ instance ExactPrint (HsLocalBinds GhcPs) where
w' <- markEpToken w -- 'where'
case al_layout an0 of
- AnnListLayout anc -> do
+ EpVirtualBraces anc -> do
when (not $ isEmptyValBinds valbinds) $ setExtraDP (Just anc)
_ -> return ()
@@ -2649,7 +2617,7 @@ instance ExactPrint (HsLocalBinds GhcPs) where
Nothing -> return an1
Just (ss,dp) -> do
setExtraDPReturn Nothing
- return $ an1 { al_layout = AnnListLayout (EpaDelta ss dp []) }
+ return $ an1 { al_layout = EpVirtualBraces (EpaDelta ss dp []) }
return (HsValBinds (an2, w') valbinds')
exact (HsIPBinds (an,w) bs) = do
=====================================
utils/check-exact/Main.hs
=====================================
@@ -520,8 +520,8 @@ changeLocalDecls libdir (L l p) = do
let oldDecls' = captureLineSpacing oldDecls
let (VbSig o:oldBinds) = map wrapValBind oldDecls'
o' = setEntryDP o (DifferentLine 2 0)
- let (AnnList (AnnListLayout _) a b) = van
- let van' = AnnList (AnnListLayout (EpaDelta noSrcSpan (DifferentLine 1 4) [])) a b
+ let (AnnList _ b) = van
+ let van' = AnnList (EpVirtualBraces (EpaDelta noSrcSpan (DifferentLine 1 4) [])) b
let binds' = L lb (HsValBinds (van',w)
(ValBinds noExtField (VbSig sig':VbBind decl':VbSig o':oldBinds)))
return (L lm (Match an mln pats (GRHSs emptyComments rhs binds')))
@@ -546,7 +546,7 @@ changeLocalDecls2 libdir (L l p) = do
replaceLocalBinds (L lm (Match ma mln pats (GRHSs _ rhs (L _ EmptyLocalBinds{})))) = do
let anc = (EpaDelta noSrcSpan (DifferentLine 1 2) [])
let anc2 = (EpaDelta noSrcSpan (DifferentLine 1 4) [])
- let an = ( AnnList (AnnListLayout anc2) ListNone []
+ let an = ( AnnList (EpVirtualBraces anc2) []
, EpTok (EpaDelta noSrcSpan (SameLine 0) []))
let lb = EpAnn anc noAnn emptyComments
let decls = [VbSig sig', VbBind decl']
=====================================
utils/check-exact/Transform.hs
=====================================
@@ -1021,15 +1021,13 @@ replaceDeclsValbinds w (L l (EmptyLocalBinds _)) new
oldWhereAnnotation :: (AnnList, EpToken "where")
-> WithWhere -> (AnnList, EpToken "where")
-oldWhereAnnotation (an, _w) ww = an'
+oldWhereAnnotation (an, _w) ww = (an, w')
-- TODO: when we set DP (0,0) for the HsValBinds EpEpaLocation,
-- change the AnnList anchor to have the correct DP too
where
- (AnnList ancl p s) = an
- w = case ww of
+ w' = case ww of
WithWhere -> EpTok (EpaDelta noSrcSpan (SameLine 0) [])
WithoutWhere -> noEpTok
- an' = (AnnList ancl p s, w)
newWhereAnnotation :: WithWhere -> (AnnList, EpToken "where")
newWhereAnnotation ww = (an, w)
@@ -1038,7 +1036,7 @@ newWhereAnnotation ww = (an, w)
w = case ww of
WithWhere -> EpTok (EpaDelta noSrcSpan (SameLine 0) [])
WithoutWhere -> noEpTok
- an = AnnList (AnnListLayout anc2) ListNone []
+ an = AnnList (EpVirtualBraces anc2) []
-- ---------------------------------------------------------------------
=====================================
utils/check-exact/Utils.hs
=====================================
@@ -341,10 +341,6 @@ insertTopLevelCppComments (HsModule (XModulePs an lo mdeprec mbDoc) mmn mexports
cs4' = workInComments cs4 these
(xs',rest') = allocPreceding xs rest
-annListBracketsLocs :: AnnListBrackets -> (EpaLocation,EpaLocation)
-annListBracketsLocs (ListBraces o c) = (getEpTokenLoc o, getEpTokenLoc c)
-annListBracketsLocs ListNone = (noAnn, noAnn)
-
data SplitWhere = Before | After
splitOnWhere :: SplitWhere -> EpToken "where" -> [LEpaComment] -> ([LEpaComment], [LEpaComment])
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/56bb91d95f89509cb351a5eb4a74068…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/56bb91d95f89509cb351a5eb4a74068…
You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1
0
[Git][ghc/ghc][master] rts: Fix unwinding information for StgRun
by Marge Bot (@marge-bot) 24 Nov '26
by Marge Bot (@marge-bot) 24 Nov '26
24 Nov '26
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
1340d255 by ARATA Mizuki at 2026-11-23T20:13:03-05:00
rts: Fix unwinding information for StgRun
The unwinding rule for rsp updated in a5ec467ee3d4e77c026437a545981269acde3434
was wrong. It gave the value of rsp _after_ the call instruction (i.e.
on entry to StgRun), whereas it should give the value _before_ the call
instruction (i.e. the caller's rsp).
Fixes #27637
- - - - -
2 changed files:
- + changelog.d/T27637
- rts/StgCRun.c
Changes:
=====================================
changelog.d/T27637
=====================================
@@ -0,0 +1,10 @@
+section: rts
+synopsis: Fix DWARF unwinding information for ``StgRun`` on x86-64
+issues: #27637
+mrs: !16665
+description: {
+ A previous change that aligns the C stack to a 64-byte boundary in ``StgRun``
+ on x86-64 (!15473) introduced an incorrect unwinding rule for ``rsp``.
+ As a result, DWARF-based unwinders such as ``gdb`` could produce broken
+ backtraces through ``StgRun``. This has been fixed.
+}
=====================================
rts/StgCRun.c
=====================================
@@ -516,37 +516,44 @@ StgRunIsImplementedInAssembler(void)
".cfi_offset r14, %c6\n\t"
".cfi_offset r15, %c7\n\t"
/*
- * The original rsp is saved at RESERVED_C_STACK_BYTES + 56 from
- * current rsp. We use DW_CFA_expression to indicate that rsp's
- * value can be found by loading from that stack location.
+ * The rsp value _on entrance_ is saved at
+ * RESERVED_C_STACK_BYTES + 56 from current rsp.
+ * We use DW_CFA_val_expression to indicate that rsp's value can be
+ * found by loading from that stack location. We add 8 to that value
+ * to recover the rsp value _before the call instruction_.
+ * previous_rsp = saved_rsp + 8
+ * = *(rsp + 8 + RESERVED_C_STACK_BYTES + 48) + 8.
*/
#define RSP_DELTA (RESERVED_C_STACK_BYTES + 56)
".cfi_escape "
- "0x10, " // DW_CFA_expression
+ "0x16, " // DW_CFA_val_expression
"0x07, " // register num 7 - rsp
#if (RSP_DELTA >> 20) > 0
- "0x05, " // block length = 5
+ "0x08, " // block length = 8
#elif (RSP_DELTA >> 13) > 0
- "0x04, " // block length = 4
+ "0x07, " // block length = 7
#elif (RSP_DELTA >> 6) > 0
- "0x03, " // block length = 3
+ "0x06, " // block length = 6
#else
- "0x02, " // block length = 2
+ "0x05, " // block length = 5
#endif
"0x77, " // DW_OP_breg7 (rsp + offset)
- "%c8" // signed LEB128 offset to saved rsp (RESERVED_C_STACK_BYTES + 56)
+ "%c8, " // signed LEB128 offset to saved rsp (RESERVED_C_STACK_BYTES + 56)
#if (RSP_DELTA >> 6) > 0
- ", %c9" // signed LEB128 encoded delta - byte 2
+ "%c9, " // signed LEB128 encoded delta - byte 2
#endif
#if (RSP_DELTA >> 13) > 0
- ", %c10" // signed LEB128 encoded delta - byte 3
+ "%c10, " // signed LEB128 encoded delta - byte 3
#endif
#if (RSP_DELTA >> 20) > 0
- ", %c11" // signed LEB128 encoded delta - byte 4
+ "%c11, " // signed LEB128 encoded delta - byte 4
#endif
#if (RSP_DELTA >> 27) > 0
#error "RSP_DELTA too big"
#endif
+ "0x06, " // DW_OP_deref
+ "0x38, " // DW_OP_lit8
+ "0x22" // DW_OP_plus
"\n\t"
/*
* The return address (rip) is at the original rsp location.
@@ -566,17 +573,17 @@ StgRunIsImplementedInAssembler(void)
"0x03, " // block length = 3
#endif
"0x77, " // DW_OP_breg7 (rsp + offset)
- "%c8" // signed LEB128 offset to saved rsp
+ "%c8, " // signed LEB128 offset to saved rsp
#if (RSP_DELTA >> 6) > 0
- ", %c9" // signed LEB128 encoded delta - byte 2
+ "%c9, " // signed LEB128 encoded delta - byte 2
#endif
#if (RSP_DELTA >> 13) > 0
- ", %c10" // signed LEB128 encoded delta - byte 3
+ "%c10, " // signed LEB128 encoded delta - byte 3
#endif
#if (RSP_DELTA >> 20) > 0
- ", %c11" // signed LEB128 encoded delta - byte 4
+ "%c11, " // signed LEB128 encoded delta - byte 4
#endif
- ", 0x06" // DW_OP_deref
+ "0x06" // DW_OP_deref
"\n\t"
#endif /* defined(ENABLE_UNWINDING) */
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1340d25541ba28abac3ae0e9bd24be6…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1340d25541ba28abac3ae0e9bd24be6…
You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1
0
[Git][ghc/ghc][wip/mangoiv/clone-shallow-default] ci: make shallow cloning the default
by Magnus (@MangoIV) 23 Nov '26
by Magnus (@MangoIV) 23 Nov '26
23 Nov '26
Magnus pushed to branch wip/mangoiv/clone-shallow-default at Glasgow Haskell Compiler / GHC
Commits:
ff8e5097 by mangoiv at 2026-11-23T20:17:27+01:00
ci: make shallow cloning the default
We disabled shallow cloning because linters sometimes need deep clones.
We now clone shallowly and just enable deep cloning on lint jobs that we
know need them (see b2f106f5544e4c71bb07df4acb9d2b5ed184a7e3)
Fixes #28157
- - - - -
2 changed files:
- .gitlab-ci.yml
- testsuite/driver/perf_notes.py
Changes:
=====================================
.gitlab-ci.yml
=====================================
@@ -17,8 +17,7 @@ variables:
# Bump to invalidate GitLab CI cache.
CACHE_REV: 12
- # Disable shallow clones; they break our linting rules
- GIT_DEPTH: 0
+ GIT_DEPTH: 1
# Always start with a fresh clone to avoid non-hermetic builds
GIT_STRATEGY: clone
@@ -267,6 +266,7 @@ ghc-linters:
extends: .lint-params
variables:
BUILD_FLAVOUR: default
+ GIT_DEPTH: 0
script:
- .gitlab/ci.sh configure
- timeout 10m .gitlab/ci.sh run_hadrian test --test-root-dirs="testsuite/tests/linters"
@@ -282,7 +282,6 @@ lint-changelog:
extends: .lint-ghc-toolchain
variables:
CHANGELOG_EXPECT_MR: "$CI_MERGE_REQUEST_IID"
- GIT_DEPTH: 1
GIT_SUBMODULE_STRATEGY: none
script:
- .gitlab/ci.sh lint_changelog
@@ -297,7 +296,6 @@ lint-changelog:
lint-linters:
extends: .lint-python
variables:
- GIT_DEPTH: 1
GIT_SUBMODULE_STRATEGY: none
script:
- mypy testsuite/tests/linters/regex-linters/*.py
@@ -307,7 +305,6 @@ lint-linters:
lint-testsuite:
extends: .lint-ghc-toolchain
variables:
- GIT_DEPTH: 1
GIT_SUBMODULE_STRATEGY: none
script:
- make -Ctestsuite list_broken TEST_HC=$(which ghc)
@@ -317,7 +314,6 @@ lint-testsuite:
typecheck-testsuite:
extends: .lint-python
variables:
- GIT_DEPTH: 1
GIT_SUBMODULE_STRATEGY: none
script:
- mypy testsuite/driver/runtests.py
@@ -330,6 +326,7 @@ typecheck-testsuite:
extends: .lint-params
variables:
BUILD_FLAVOUR: default
+ GIT_DEPTH: 0
GIT_SUBMODULE_DEPTH: 0 # full history
script:
- .gitlab/ci.sh configure
@@ -346,6 +343,7 @@ typecheck-testsuite:
lint-author:
extends: .lint-python
variables:
+ GIT_DEPTH: 0
GIT_SUBMODULE_STRATEGY: none
script:
- git fetch "$CI_MERGE_REQUEST_PROJECT_URL" $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
@@ -362,7 +360,6 @@ lint-ci-config:
extends: .lint
# We don't need history/submodules in this job
variables:
- GIT_DEPTH: 1
GIT_SUBMODULE_STRATEGY: none
before_script:
- echo "experimental-features = nix-command flakes" >> /etc/nix/nix.conf
=====================================
testsuite/driver/perf_notes.py
=====================================
@@ -433,6 +433,13 @@ def baseline_commit_log(commit: Union[GitHash,GitRef]) -> List[GitHash]:
# including the input commit. The output commits are all commit hashes.
# str -> [str]
def commit_log(commitOrRange, n=None):
+ # default gitlab git cloning is shallow: for git perf notes we still need to be able
+ # to catch up on history. This unshallows the repository and fetches a blobless tree.
+ if subprocess.call(['git', 'rev-parse', '--is-shallow-repository']) == 0:
+ notes_refs = [ns for ns in (LocalNamespace, CiNamespace) if ns]
+ refspecs = ['+refs/notes/%s:refs/notes/%s' % (ns, ns) for ns in notes_refs]
+ subprocess.check_call(['git', 'fetch', '--quiet', '--unshallow', '--filter=blob:none', 'origin'] + refspecs)
+
nArgs = ['-n' + str(n)] if n != None else []
output = subprocess.check_output(['git', 'log', '--format=%H'] + nArgs + [commitOrRange]).decode()
hashes = list(filter(is_commit_hash, output.split('\n')))
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ff8e50970d3cefdedb77a8402819ed3…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ff8e50970d3cefdedb77a8402819ed3…
You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1
0
[Git][ghc/ghc][wip/romes/async-rpc] Clean up GHCi.Message.Async lower-level interface
by Rodrigo Mesquita (@alt-romes) 23 Nov '26
by Rodrigo Mesquita (@alt-romes) 23 Nov '26
23 Nov '26
Rodrigo Mesquita pushed to branch wip/romes/async-rpc at Glasgow Haskell Compiler / GHC
Commits:
bad96e95 by Rodrigo Mesquita at 2026-11-23T17:27:00+00:00
Clean up GHCi.Message.Async lower-level interface
- - - - -
1 changed file:
- libraries/ghci/GHCi/Message/Async.hs
Changes:
=====================================
libraries/ghci/GHCi/Message/Async.hs
=====================================
@@ -12,10 +12,13 @@ module GHCi.Message.Async
-- * Interface for async bidirectional RPC
, remoteAsyncReq, handleAsyncReq
- , remoteAsyncReqWithResponse
- , AsyncReqResult(..), getAsyncReqReply
, RemoteProcessException(..), DecodeAsyncReqException(..)
+ -- ** Lower-level req/reply interface
+ , AsyncReqResult(..)
+ , remoteAsyncReqWithResponse
+ , getAsyncReqReply
+
-- ** Mailboxes
, InboxId(..)
, newMailbox
@@ -203,11 +206,6 @@ instance Exception PipeClosedException
-- All messages on the wire are 'IddMsg', which contain a correlation header
-- and identify whether they are requests or replies.
-_writePipe :: Pipe -> IddMsg -> IO ()
-_writePipe p msg = do
- var <- maybe (throwIO PipeWriteClosedException) pure =<< atomically (writePipeAsync p msg)
- either throwIO pure =<< atomically (takeTMVar var)
-
-- | Enqueues the message for writing.
--
-- The returned TMVar can be checked for the outcome.
@@ -270,58 +268,6 @@ remoteAsyncReq :: Pipe -> Put -> Maybe InboxId
remoteAsyncReq pipe msg ii dispose = mask_ $
getAsyncReqReply (pure ()) dispose =<< remoteAsyncReqWithResponse pipe msg ii
-
-getAsyncReqReply :: IO ()
- -> (Either SomeException LB.ByteString -> IO ())
- -> AsyncReqResult
- -> IO (Either SomeException LB.ByteString)
-getAsyncReqReply middle dispose = \case
- NotWritten e -> throwIO e
- MaybeWritten written waitRes cancel ->
- (do atomically (written >>= either throwSTM pure)
- middle
- atomically waitRes)
- `onException` do
- -- Do not care about write outcome, since reply could be coming either way.
- void $ atomically cancel
- -- exception must be happening while stuck in waitRes at the latest,
- -- so waitRes can be called again.
- --
- -- We forkIO to wait, to keep cleanup bounded. If the pipe is
- -- irrecoverable it will close eventually and this thread will terminate.
- void $ forkIO (atomically waitRes >>= dispose)
-
-
-data AsyncReqResult
- = NotWritten PipeClosedException
- | MaybeWritten
- (STM (Either SomeException ())) -- ^ block for write outcome
- (STM (Either SomeException LB.ByteString)) -- ^ block for reply
- (STM (Maybe (STM (Either SomeException ())))) -- ^ send cancel
-
-
-remoteAsyncReqWithResponse :: Pipe
- -> Put
- -> Maybe InboxId
- -> IO AsyncReqResult
-remoteAsyncReqWithResponse pipe msg ii = do
- -- Mark pending request
- uq <- freshId (pipeAsyncMngr pipe)
- wv <- newEmptyTMVarIO
-
- atomically $ readTVar (pipeReadStatus pipe) >>= \ readEnd -> case isActive readEnd of
- False -> pure $ NotWritten PipeReadClosedException
- True -> writePipeAsync pipe (Request uq ii (runPut msg)) >>= \case
- Nothing -> pure $ NotWritten PipeWriteClosedException
- Just waitWritten -> do
- -- request queued, so we register a pending reply. After this tx we
- -- always expect a reply, and when it arrives 'drainPipe' will clean up 'pendingReplies'.
- modifyTVar pendingReplies (IntMap.insert uq wv)
- pure (MaybeWritten (takeTMVar waitWritten) (takeTMVar wv)
- (fmap takeTMVar <$> writePipeAsync pipe (Cancel uq)))
- where
- pendingReplies = pendingReply (pipeAsyncMngr pipe)
-
-- | Receive a single asynchronous request and send a matching reply
-- asynchronously (the handler may fork a computation that eventually replies
-- and can return before actually replying, as long as it eventually does).
@@ -384,6 +330,10 @@ handleAsyncReq pipe getit mii k = mask $ \restore -> do
void $ reply (Left e)
throwIO e
+-- | 'handleSyncReq' failed to decode an incoming request payload using the given @'Get' a@
+newtype DecodeAsyncReqException = DecodeAsyncReqException String deriving Show
+instance Exception DecodeAsyncReqException
+
replyToReqAsync :: Pipe -> CorrelationId -> Either SomeException Put
-> STM (Maybe (TMVar (Either SomeException ())))
replyToReqAsync pipe uq p = do
@@ -392,15 +342,61 @@ replyToReqAsync pipe uq p = do
where
am = pipeAsyncMngr pipe
-_replyToReq :: Pipe -> CorrelationId -> Either SomeException Put -> IO ()
-_replyToReq pipe uq p = atomically (replyToReqAsync pipe uq p) >>= \case
- Nothing -> throwIO PipeWriteClosedException
- Just written -> atomically (readTMVar written) >>= either throwIO pure
+-- ** Lower-level req/reply interface ------------------------------------------
--- | 'handleSyncReq' failed to decode an incoming request payload using the given @'Get' a@
-newtype DecodeAsyncReqException = DecodeAsyncReqException String deriving Show
-instance Exception DecodeAsyncReqException
+data AsyncReqResult
+ = NotWritten PipeClosedException
+ | MaybeWritten
+ (STM (Either SomeException ())) -- ^ block for write outcome
+ (STM (Either SomeException LB.ByteString)) -- ^ block for reply
+ (STM (Maybe (STM (Either SomeException ())))) -- ^ send cancel
+
+-- | Like 'remoteAsyncReq', but instead of blocking waiting for a reply, return
+-- the 'AsyncReqResult' which can be given to 'getAsyncReqReply' to block
+-- waiting for a reply later.
+remoteAsyncReqWithResponse :: Pipe
+ -> Put
+ -> Maybe InboxId
+ -> IO AsyncReqResult
+remoteAsyncReqWithResponse pipe msg ii = do
+ -- Mark pending request
+ uq <- freshId (pipeAsyncMngr pipe)
+ wv <- newEmptyTMVarIO
+
+ atomically $ readTVar (pipeReadStatus pipe) >>= \ readEnd -> case isActive readEnd of
+ False -> pure $ NotWritten PipeReadClosedException
+ True -> writePipeAsync pipe (Request uq ii (runPut msg)) >>= \case
+ Nothing -> pure $ NotWritten PipeWriteClosedException
+ Just waitWritten -> do
+ -- request queued, so we register a pending reply. After this tx we
+ -- always expect a reply, and when it arrives 'drainPipe' will clean up 'pendingReplies'.
+ modifyTVar pendingReplies (IntMap.insert uq wv)
+ pure (MaybeWritten (takeTMVar waitWritten) (takeTMVar wv)
+ (fmap takeTMVar <$> writePipeAsync pipe (Cancel uq)))
+ where
+ pendingReplies = pendingReply (pipeAsyncMngr pipe)
+-- | Block waiting for the given 'AsyncReqResult': a result which will be
+-- delivered asynchronously in reply to a 'remoteAsyncReqWithResponse' request.
+getAsyncReqReply :: IO ()
+ -> (Either SomeException LB.ByteString -> IO ())
+ -> AsyncReqResult
+ -> IO (Either SomeException LB.ByteString)
+getAsyncReqReply middle dispose = \case
+ NotWritten e -> throwIO e
+ MaybeWritten written waitRes cancel ->
+ (do atomically (written >>= either throwSTM pure)
+ middle
+ atomically waitRes)
+ `onException` do
+ -- Do not care about write outcome, since reply could be coming either way.
+ void $ atomically cancel
+ -- exception must be happening while stuck in waitRes at the latest,
+ -- so waitRes can be called again.
+ --
+ -- We forkIO to wait, to keep cleanup bounded. If the pipe is
+ -- irrecoverable it will close eventually and this thread will terminate.
+ void $ forkIO (atomically waitRes >>= dispose)
-- ** Mailboxes ----------------------------------------------------------------
@@ -640,11 +636,9 @@ receivedRequest am uq = do
Just Canceling -> error "impossible"
-
{-
Note [Exceptions during serialization]
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
For efficiency reasons, any `IddMsg` to be sent is forced only when already
writing onto the Pipe, so we cannot discern whether a partial write already
occurred. The only option then is to tear down the write end of the pipe.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/bad96e9594b9dfe4c11f2d51472d33f…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/bad96e9594b9dfe4c11f2d51472d33f…
You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1
0
[Git][ghc/ghc][wip/teo/T27547] Skip tests that excercise forkProcess when using non-moving GC
by Teo Camarasu (@teo) 23 Nov '26
by Teo Camarasu (@teo) 23 Nov '26
23 Nov '26
Teo Camarasu pushed to branch wip/teo/T27547 at Glasgow Haskell Compiler / GHC
Commits:
9889cac0 by Teo Camarasu at 2026-11-23T17:11:09+00:00
Skip tests that excercise forkProcess when using non-moving GC
The non-moving GC creates a persistent marker thread. This causes issues
when users use forkProcess, since the child process ends up in a strange
state.
forkProcess is documented to not work well with the threaded Haskell
runtime. So, it's not surprising that it doesn't work with the
non-moving GC which is inherently threaded.
We should one day add support for forkProcess, but, for now, we just
disable these tests when using the non-moving GC.
The underlying issue is tracked by #27547.
- - - - -
3 changed files:
- testsuite/tests/hpc/fork/test.T
- testsuite/tests/lib/base/all.T
- testsuite/tests/rts/all.T
Changes:
=====================================
testsuite/tests/hpc/fork/test.T
=====================================
@@ -9,5 +9,7 @@ test('hpc_fork',
# and #8862.
req_process,
omit_ways(prof_ways),
- cmd_prefix(hpc_prefix)],
+ cmd_prefix(hpc_prefix),
+ # The nonmoving-gc doesn't support forkProcess. See #27547
+ omit_ways(['nonmoving_thr', 'nonmoving_thr_ghc', 'nonmoving_thr_sanity'])],
compile_and_run, ['-fhpc'])
=====================================
testsuite/tests/lib/base/all.T
=====================================
@@ -2,7 +2,13 @@ test('DataTypeOrd', normal, compile_and_run, [''])
test('T16586', normal, compile_and_run, ['-O2'])
# Event-manager not supported on Windows
test('T16916', [when(opsys('mingw32'), skip), js_broken(22261), fragile(16966), req_ghc_with_threaded_rts], compile_and_run, ['-O2 -threaded -with-rtsopts="-I0" -rtsopts'])
-test('T24672', [when(opsys('mingw32'), skip), js_broken(22261),req_process], compile_and_run, [''])
+test('T24672',
+ [ when(opsys('mingw32'), skip)
+ , js_broken(22261)
+ , req_process
+ # The nonmoving-gc doesn't support forkProcess. See #27547
+ , omit_ways(['nonmoving_thr', 'nonmoving_thr_ghc', 'nonmoving_thr_sanity'])]
+ , compile_and_run, [''])
test('T17310', normal, compile, [''])
test('T19691', normal, compile, [''])
test('executablePath', [extra_run_opts(config.os), js_broken(22261), when(arch('wasm32'), fragile(23248)), omit_ghci], compile_and_run, [''])
=====================================
testsuite/tests/rts/all.T
=====================================
@@ -451,6 +451,8 @@ test('T13617', [ unless(opsys('mingw32'), skip)],
# its history.
test('T12903', [ fragile(21184)
, js_broken(22374)
+ # The nonmoving-gc doesn't support forkProcess. See #27547
+ , omit_ways(['nonmoving_thr', 'nonmoving_thr_ghc', 'nonmoving_thr_sanity'])
, req_process]
, compile_and_run, [''])
@@ -687,7 +689,12 @@ test('IOManager', [js_skip, when(arch('wasm32'), skip), when(opsys('mingw32'), s
test('T24142', [req_target_smp], compile_and_run, ['-threaded -with-rtsopts "-N2"'])
test('T25232', [unless(have_profiling(), skip), only_ways(['normal','nonmoving','nonmoving_prof','nonmoving_thr_prof']), extra_ways(['nonmoving', 'nonmoving_prof'] + (['nonmoving_thr_prof'] if have_threaded() else []))], compile_and_run, [''])
-test('T25280', [unless(opsys('linux'),skip),req_process,js_skip], compile_and_run, [''])
+test('T25280',
+ [unless(opsys('linux'),skip)
+ ,req_process,js_skip
+ # The nonmoving-gc doesn't support forkProcess. See #27547
+ , omit_ways(['nonmoving_thr', 'nonmoving_thr_ghc', 'nonmoving_thr_sanity'])]
+ , compile_and_run , [''])
# N.B. This will likely issue a warning on stderr but we merely care that the
# program doesn't crash.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/9889cac0a05cd16e88d6d042fdb22e4…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/9889cac0a05cd16e88d6d042fdb22e4…
You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1
0
[Git][ghc/ghc][wip/mangoiv/28038] fixup! typechecker: use safe lookup for lookupMBI
by Magnus (@MangoIV) 23 Nov '26
by Magnus (@MangoIV) 23 Nov '26
23 Nov '26
Magnus pushed to branch wip/mangoiv/28038 at Glasgow Haskell Compiler / GHC
Commits:
e7a83e73 by mangoiv at 2026-11-23T17:58:10+01:00
fixup! typechecker: use safe lookup for lookupMBI
- - - - -
4 changed files:
- changelog.d/28038
- compiler/GHC/Tc/Gen/Bind.hs
- compiler/GHC/Tc/TyCl/PatSyn.hs
- compiler/GHC/Tc/Utils/Env.hs
Changes:
=====================================
changelog.d/28038
=====================================
@@ -1,12 +1,8 @@
section: compiler
synopsis:
- Fix a panic when trying to bind a type variable in patterns.
+ When encountering a required type argument in a pattern binding, don't panic, report an error instead.
description:
- GHC currently does not allow to bind type variables in patterns. When
- a user would try that, in some situations, we didn't abort eagerly
- enough after discovering the error and thus ran into a panic looking up
- the type in the env while trying to update the local context. Instead,
- when discovering the error,
- we now abort eagerly.
+ GHC does not currently support pattern bindings that bind a required type argument. Now GHC reports an
+ error in that situation, instead of panicking.
mrs: !16868
issues: #28038
=====================================
compiler/GHC/Tc/Gen/Bind.hs
=====================================
@@ -1557,8 +1557,8 @@ lookupMBI :: Name -> TcM MonoBindInfo
lookupMBI name
= do { mono_id_e <- tcLookupTermBndr name
; case mono_id_e of
- Left _ -> failIllegalTyVar (noUserRdr name)
- Right mono_id ->
+ TyVarBndr _ -> failIllegalTyVar (noUserRdr name)
+ TermBndr mono_id ->
return (MBI { mbi_poly_name = name
, mbi_sig = Nothing
, mbi_mono_id = mono_id
=====================================
compiler/GHC/Tc/TyCl/PatSyn.hs
=====================================
@@ -652,8 +652,8 @@ collectPatSynArgInfo details =
tcLookupPatSynArg :: Name -> TcM Id
tcLookupPatSynArg arg_name
= do { tcLookupTermBndr arg_name >>= \ case
- Left (ButATyVar _var) -> failIllegalTyVar (noUserRdr arg_name)
- Right id -> return id }
+ TyVarBndr{} -> failIllegalTyVar (noUserRdr arg_name)
+ TermBndr id -> return id }
wrongNumberOfParmsErr :: Name -> Arity -> Arity -> TcM a
wrongNumberOfParmsErr name decl_arity missing
=====================================
compiler/GHC/Tc/Utils/Env.hs
=====================================
@@ -43,7 +43,7 @@ module GHC.Tc.Utils.Env(
tcLookup, tcLookupLocated, tcLookupLocalIds,
tcLookupId, tcLookupIdMaybe, tcLookupTyVar,
- tcLookupTermBndr, NotATermBndr (..),
+ tcLookupTermBndr, TermBndr (..),
tcLookupTcTyCon,
tcLookupLcl_maybe,
getInLocalScope,
@@ -769,16 +769,17 @@ tcLookupIdMaybe name
-- | Encountered a thing that is not a term binder when
-- calling 'tcLookupTermBndr'.
-newtype NotATermBndr
- = ButATyVar TcTyVar
+data TermBndr
+ = TermBndr !Id
+ | TyVarBndr !TcTyVar
-tcLookupTermBndr :: Name -> TcM (Either NotATermBndr Id)
+tcLookupTermBndr :: Name -> TcM TermBndr
tcLookupTermBndr name = do
thing <- tcLookup name
case thing of
- ATcId { tct_id } -> pure $ Right $! tct_id
- AGlobal (AnId id) -> pure $ Right $! id
- ATyVar _ var -> pure $ Left $! ButATyVar var
+ ATcId { tct_id } -> pure $ TermBndr tct_id
+ AGlobal (AnId id) -> pure $ TermBndr id
+ ATyVar _ var -> pure $ TyVarBndr var
_ -> pprPanic "tcLookupTermBndr: unexpected thing" (ppr thing)
tcLookupLocalIds :: [Name] -> TcM [TcId]
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e7a83e73266b58ed6f8d237ee60626c…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e7a83e73266b58ed6f8d237ee60626c…
You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1
0