
[Git][ghc/ghc][wip/spj-apporv-Oct24] exception for AppDo while making error ctxt
by Apoorv Ingle (@ani) 27 Apr '25
by Apoorv Ingle (@ani) 27 Apr '25
27 Apr '25
Apoorv Ingle pushed to branch wip/spj-apporv-Oct24 at Glasgow Haskell Compiler / GHC
Commits:
31224bab by Apoorv Ingle at 2025-04-27T19:31:28-05:00
exception for AppDo while making error ctxt
- - - - -
1 changed file:
- compiler/GHC/Tc/Utils/Monad.hs
Changes:
=====================================
compiler/GHC/Tc/Utils/Monad.hs
=====================================
@@ -1719,27 +1719,41 @@ mkErrCtxt env ctxts
-- if dbg -- In -dppr-debug style the output
-- then return empty -- just becomes too voluminous
-- else go dbg 0 env ctxts
- = go False 0 env ctxts
+ = do appDo <- xoptM LangExt.ApplicativeDo
+ if appDo
+ then go False 0 env ctxts
+ else go1 False 0 env ctxts
where
- go :: Bool -> Int -> TidyEnv -> [ErrCtxt] -> TcM [ErrCtxtMsg]
- go _ _ _ [] = return []
- go dbg n env ((is_landmark1, ctxt1) : (is_landmark2, ctxt2) : ctxts)
+ go1, go :: Bool -> Int -> TidyEnv -> [ErrCtxt] -> TcM [ErrCtxtMsg]
+ go1 _ _ _ [] = return []
+ go1 dbg n env ((is_landmark1, ctxt1) : (is_landmark2, ctxt2) : ctxts)
| is_landmark1 || n < mAX_CONTEXTS -- Too verbose || dbg
= do { (env', msg1) <- liftZonkM $ ctxt1 env
; (_, msg2) <- liftZonkM $ ctxt2 env'
; case (msg1, msg2) of
(ExprCtxt{}, StmtErrCtxt (HsDoStmt (DoExpr{})) _)
-> do { let n' = if is_landmark2 then n else n+1
- ; rest <- go dbg n' env' ctxts
+ ; rest <- go1 dbg n' env' ctxts
; return (msg2 : rest) }
_
-> do { let n' = if is_landmark1 then n else n+1
- ; rest <- go dbg n' env' ((is_landmark2, ctxt2) : ctxts)
+ ; rest <- go1 dbg n' env' ((is_landmark2, ctxt2) : ctxts)
; return (msg1 : rest) }
}
| otherwise
- = go dbg n env ((is_landmark2, ctxt2) : ctxts)
+ = go1 dbg n env ((is_landmark2, ctxt2) : ctxts)
+ go1 dbg n env ((is_landmark, ctxt) : ctxts)
+ | is_landmark || n < mAX_CONTEXTS -- Too verbose || dbg
+ = do { (env', msg) <- liftZonkM $ ctxt env
+ ; let n' = if is_landmark then n else n+1
+ ; rest <- go1 dbg n' env' ctxts
+ ; return (msg : rest) }
+ | otherwise
+ = go1 dbg n env ctxts
+
+ -- Applicative do doesn't use expansion yet
+ go _ _ _ [] = return []
go dbg n env ((is_landmark, ctxt) : ctxts)
| is_landmark || n < mAX_CONTEXTS -- Too verbose || dbg
= do { (env', msg) <- liftZonkM $ ctxt env
@@ -1749,13 +1763,6 @@ mkErrCtxt env ctxts
| otherwise
= go dbg n env ctxts
- -- filter_stmt_adj :: [ErrCtxtMsg] -> [ErrCtxtMsg]
- -- filter_stmt_adj = concat . map stmtAdj . tails
-
- -- stmtAdj :: [ErrCtxtMsg] -> [ErrCtxtMsg]
- -- stmtAdj (ExprCtxt{} : StmtErrCtxt{} : _ ) = []
- -- stmtAdj (s : _ ) = [s]
- -- stmtAdj xs = xs
mAX_CONTEXTS :: Int -- No more than this number of non-landmark contexts
mAX_CONTEXTS = 3
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/31224babec2e805ed494feebd544129…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/31224babec2e805ed494feebd544129…
You're receiving this email because of your account on gitlab.haskell.org.
1
0

27 Apr '25
Simon Peyton Jones pushed to branch wip/andreask/spec_tyfams at Glasgow Haskell Compiler / GHC
Commits:
ea554055 by Simon Peyton Jones at 2025-04-27T23:01:40+01:00
Wibbles
- - - - -
1 changed file:
- compiler/GHC/Core/Opt/Specialise.hs
Changes:
=====================================
compiler/GHC/Core/Opt/Specialise.hs
=====================================
@@ -1,3 +1,5 @@
+{-# LANGUAGE MultiWayIf #-}
+
{-
(c) The GRASP/AQUA Project, Glasgow University, 1993-1998
@@ -14,7 +16,6 @@ import GHC.Driver.Config.Diagnostic
import GHC.Driver.Config.Core.Rules ( initRuleOpts )
import GHC.Core.Type hiding( substTy, substCo, extendTvSubst, zapSubst )
--- import GHC.Core.Multiplicity
import GHC.Core.SimpleOpt( defaultSimpleOpts, simpleOptExprWith, exprIsConApp_maybe )
import GHC.Core.Predicate
import GHC.Core.Class( classMethods )
@@ -3072,7 +3073,7 @@ mkCallUDs' env f args
emptyUDs
where
- _trace_doc = vcat [ppr f, ppr args, ppr ci_key, ppr (se_subst env)]
+ _trace_doc = vcat [ppr f, ppr args, ppr ci_key]
pis = fst $ splitPiTys $ idType f
constrained_tyvars = tyCoVarsOfTypes $ getTheta pis
@@ -3097,7 +3098,7 @@ mkCallUDs' env f args
-- on this argument; if so, SpecDict, if not UnspecArg
mk_spec_arg arg (Anon _pred af)
| isInvisibleFunArg af
- , interestingDict (ISE (substInScopeSet $ se_subst env) realIdUnfolding) arg
+ , interestingDict env arg
-- , interestingDict arg (scaledThing pred)
-- See Note [Interesting dictionary arguments]
= SpecDict arg
@@ -3121,7 +3122,7 @@ site, so we only look through ticks that RULE matching looks through
-}
wantCallsFor :: SpecEnv -> Id -> Bool
-wantCallsFor _env _f = True
+wantCallsFor _env f = not (isDataConId f) -- Better version coming in !14242
-- We could reduce the size of the UsageDetails by being less eager
-- about collecting calls for LocalIds: there is no point for
-- ones that are lambda-bound. We can't decide this by looking at
@@ -3177,7 +3178,7 @@ case we can clearly specialise. But there are wrinkles:
whole it's only a small win: 2.2% improvement in allocation for ansi,
1.2% for bspt, but mostly 0.0! Average 0.1% increase in binary size.
-(ID4) We must be very careful not to specialise on a "dictionry" that is, or contains
+(ID4) We must be very careful not to specialise on a "dictionary" that is, or contains
an implicit parameter, because implicit parameters are emphatically not singleton
types. See #25999:
useImplicit :: (?i :: Int) => Int
@@ -3247,24 +3248,41 @@ in the NonRec case of specBind. (This is too exotic to trouble with
the Rec case.)
-}
-interestingDict :: InScopeEnv -> CoreExpr -> Bool
+interestingDict :: SpecEnv -> CoreExpr -> Bool
+-- This is a subtle and important function
-- See Note [Interesting dictionary arguments]
interestingDict env (Var v) -- See (ID3) and (ID5)
| Just rhs <- expandUnfolding_maybe (idUnfolding v)
= interestingDict env rhs
-interestingDict env (Cast arg _) -- See (ID5)
- = interestingDict env arg
+
interestingDict env arg -- Main Plan: use exprIsConApp_maybe
- | Just (_, _, data_con, _tys, args) <- exprIsConApp_maybe env arg
+ | Just (_, _, data_con, _tys, args) <- exprIsConApp_maybe in_scope_env arg
, Just cls <- tyConClass_maybe (dataConTyCon data_con)
- , (not . couldBeIPLike) (exprType arg) -- See (ID4)
- = if null (classMethods cls) -- See (ID6)
+ , (not . couldBeIPLike) arg_ty -- See (ID4)
+ = if null (classMethods cls) -- See (ID6)
then any (interestingDict env) args
else True
- | exprIsHNF arg -- See (ID7)
- = True
+
+ | Cast inner_arg _ <- arg -- See (ID5)
+ = if | isConstraintKind $ typeKind $ exprType inner_arg
+ -- If coercions were always homo-kinded, we'd know
+ -- that this would be the only case
+ -> interestingDict env inner_arg
+
+ -- Cheeck for an implicit parameter
+ | Just (cls,_) <- getClassPredTys_maybe arg_ty
+ , isIPClass cls -- See (ID4)
+ -> False
+
+ -- Otherwise we are unwrapping a unary type class
+ | otherwise
+ -> exprIsHNF arg -- See (ID7)
+
| otherwise
= False
+ where
+ arg_ty = exprType arg
+ in_scope_env = ISE (substInScopeSet $ se_subst env) realIdUnfolding
thenUDs :: UsageDetails -> UsageDetails -> UsageDetails
thenUDs (MkUD {ud_binds = db1, ud_calls = calls1})
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ea5540556ad257083dddc11ac068c17…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ea5540556ad257083dddc11ac068c17…
You're receiving this email because of your account on gitlab.haskell.org.
1
0

[Git][ghc/ghc][wip/T25965] 9 commits: ghci: Use loadInterfaceForModule rather than loadSrcInterface in mkTopLevEnv
by Simon Peyton Jones (@simonpj) 27 Apr '25
by Simon Peyton Jones (@simonpj) 27 Apr '25
27 Apr '25
Simon Peyton Jones pushed to branch wip/T25965 at Glasgow Haskell Compiler / GHC
Commits:
91564daf by Matthew Pickering at 2025-04-24T00:29:02-04:00
ghci: Use loadInterfaceForModule rather than loadSrcInterface in mkTopLevEnv
loadSrcInterface takes a user given `ModuleName` and resolves it to the
module which needs to be loaded (taking into account module
renaming/visibility etc).
loadInterfaceForModule takes a specific module and loads it.
The modules in `ImpDeclSpec` have already been resolved to the actual
module to get the information from during renaming. Therefore we just
need to fetch the precise interface from disk (and not attempt to rename
it again).
Fixes #25951
- - - - -
2e0c07ab by Simon Peyton Jones at 2025-04-24T00:29:43-04:00
Test for #23298
- - - - -
0eef99b0 by Sven Tennie at 2025-04-24T07:34:36-04:00
RV64: Introduce J instruction (non-local jumps) and don't deallocate stack slots for J_TBL (#25738)
J_TBL result in local jumps, there should not deallocate stack slots
(see Note [extra spill slots].)
J is for non-local jumps, these may need to deallocate stack slots.
- - - - -
1bd3d13e by fendor at 2025-04-24T07:35:17-04:00
Add `UnitId` to `EvalBreakpoint`
The `EvalBreakpoint` is used to communicate that a breakpoint was
encountered during code evaluation.
This `EvalBreakpoint` needs to be converted to an `InternalBreakpointId`
which stores a `Module` to uniquely find the correct `Module` in the
Home Package Table.
The `EvalBreakpoint` used to store only a `ModuleName` which is then
converted to a `Module` based on the currently active home unit.
This is incorrect in the face of multiple home units, the break point
could be in an entirely other home unit!
To fix this, we additionally store the `UnitId` of the `Module` in
`EvalBreakpoint` to later reconstruct the correct `Module`
All of the changes are the consequence of extending `EvalBreakpoint`
with the additional `ShortByteString` of the `UnitId`.
For performance reasons, we store the `ShortByteString` backing the
`UnitId` directly, avoiding marshalling overhead.
- - - - -
fe6ed8d9 by Sylvain Henry at 2025-04-24T18:04:12-04:00
Doc: add doc for JS interruptible calling convention (#24444)
- - - - -
6111c5e4 by Ben Gamari at 2025-04-24T18:04:53-04:00
compiler: Ensure that Panic.Plain.assertPanic' provides callstack
In 36cddd2ce1a3bc62ea8a1307d8bc6006d54109cf @alt-romes removed CallStack
output from `GHC.Utils.Panic.Plain.assertPanic'`. While this output is
redundant due to the exception backtrace proposal, we may be
bootstrapping with a compiler which does not yet include this machinery.
Reintroduce the output for now.
Fixes #25898.
- - - - -
217caad1 by Matthew Pickering at 2025-04-25T18:58:42+01:00
Implement Explicit Level Imports for Template Haskell
This commit introduces the `ExplicitLevelImports` and
`ImplicitStagePersistence` language extensions as proposed in GHC
Proposal #682.
Key Features
------------
- `ExplicitLevelImports` adds two new import modifiers - `splice` and
`quote` - allowing precise control over the level at which imported
identifiers are available
- `ImplicitStagePersistence` (enabled by default) preserves existing
path-based cross-stage persistence behavior
- `NoImplicitStagePersistence` disables implicit cross-stage
persistence, requiring explicit level imports
Benefits
--------
- Improved compilation performance by reducing unnecessary code generation
- Enhanced IDE experience with faster feedback in `-fno-code` mode
- Better dependency tracking by distinguishing compile-time and runtime dependencies
- Foundation for future cross-compilation improvements
This implementation enables the separation of modules needed at
compile-time from those needed at runtime, allowing for more efficient
compilation pipelines and clearer code organization in projects using
Template Haskell.
Implementation Notes
--------------------
The level which a name is availble at is stored in the 'GRE', in the normal
GlobalRdrEnv. The function `greLevels` returns the levels which a specific GRE
is imported at. The level information for a 'Name' is computed by `getCurrentAndBindLevel`.
The level validity is checked by `checkCrossLevelLifting`.
Instances are checked by `checkWellLevelledDFun`, which computes the level an
instance by calling `checkWellLevelledInstanceWhat`, which sees what is
available at by looking at the module graph.
Modifications to downsweep
--------------------------
Code generation is now only enabled for modules which are needed at
compile time.
See the Note [-fno-code mode] for more information.
Uniform error messages for level errors
---------------------------------------
All error messages to do with levels are now reported uniformly using
the `TcRnBadlyStaged` constructor.
Error messages are uniformly reported in terms of levels.
0 - top-level
1 - quote level
-1 - splice level
The only level hard-coded into the compiler is the top-level in
GHC.Types.ThLevelIndex.topLevelIndex.
Uniformly refer to levels and stages
------------------------------------
There was much confusion about levels vs stages in the compiler.
A level is a semantic concept, used by the typechecker to ensure a
program can be evaluated in a well-staged manner.
A stage is an operational construct, program evaluation proceeds in
stages.
Deprecate -Wbadly-staged-types
------------------------------
`-Wbadly-staged-types` is deprecated in favour of `-Wbadly-levelled-types`.
Lift derivation changed
-----------------------
Derived lift instances will now not generate code with expression
quotations.
Before:
```
data A = A Int deriving Lift
=>
lift (A x) = [| A $(lift x) |]
```
After:
```
lift (A x) = conE 'A `appE` (lift x)
```
This is because if you attempt to derive `Lift` in a module where
`NoImplicitStagePersistence` is enabled, you would get an infinite loop
where a constructor was attempted to be persisted using the instance you
are currently defining.
GHC API Changes
---------------
The ModuleGraph now contains additional information about the type of
the edges (normal, quote or splice) between modules. This is abstracted
using the `ModuleGraphEdge` data type.
Fixes #25828
-------------------------
Metric Increase:
MultiLayerModulesTH_Make
-------------------------
- - - - -
7641a74a by Simon Peyton Jones at 2025-04-26T22:05:19-04:00
Get a decent MatchContext for pattern synonym bindings
In particular when we have a pattern binding
K p1 .. pn = rhs
where K is a pattern synonym. (It might be nested.)
This small MR fixes #25995. It's a tiny fix, to an error message,
removing an always-dubious `unkSkol`.
The bug report was in the context of horde-ad, a big program,
and I didn't manage to make a small repro case quickly. I decided
not to bother further.
- - - - -
ce616f49 by Simon Peyton Jones at 2025-04-27T21:10:25+01:00
Fix infelicities in the Specialiser
On the way to #23109 (unary classes) I discovered some infelicities
(or maybe tiny bugs, I forget) in the type-class specialiser.
I also tripped over #25965, an outright bug in the rule matcher
Specifically:
* Refactor: I enhanced `wantCallsFor`, whih previously always said
`True`, to discard calls of class-ops, data constructors etc. This is
a bit more efficient; and it means we don't need to worry about
filtering them out later.
* Fix: I tidied up some tricky logic that eliminated redundant
specialisations. It wasn't working correctly. See the expanded
Note [Specialisations already covered], and
(MP3) in Note [Specialising polymorphic dictionaries].
See also the new top-level `alreadyCovered`
function, which now goes via `GHC.Core.Rules.ruleLhsIsMoreSpecific`
I also added a useful Note [The (CI-KEY) invariant]
* Fix #25965: fixed a tricky bug in the `go_fam_fam` in
`GHC.Core.Unify.uVarOrFam`, which allows matching to succeed
without binding all type varibles.
I enhanced Note [Apartness and type families] some more
* #25703. This ticket "just works" with -fpolymorphic-specialisation;
but I was surprised that it worked! In this MR I added documentation
to Note [Interesting dictionary arguments] to explain; and tests to
ensure it stays fixed.
- - - - -
299 changed files:
- compiler/GHC.hs
- compiler/GHC/ByteCode/Asm.hs
- compiler/GHC/ByteCode/Instr.hs
- compiler/GHC/ByteCode/Types.hs
- compiler/GHC/CmmToAsm/RV64/CodeGen.hs
- compiler/GHC/CmmToAsm/RV64/Instr.hs
- compiler/GHC/CmmToAsm/RV64/Ppr.hs
- compiler/GHC/Core/Opt/Specialise.hs
- compiler/GHC/Core/Rules.hs
- compiler/GHC/Core/Unify.hs
- compiler/GHC/Data/Graph/Directed/Reachability.hs
- compiler/GHC/Driver/Backpack.hs
- compiler/GHC/Driver/Downsweep.hs
- compiler/GHC/Driver/DynFlags.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/Make.hs
- compiler/GHC/Driver/MakeFile.hs
- compiler/GHC/Driver/Pipeline.hs
- compiler/GHC/Driver/Pipeline/Execute.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Hs/ImpExp.hs
- compiler/GHC/HsToCore/Breakpoints.hs
- compiler/GHC/Iface/Recomp.hs
- compiler/GHC/Iface/Tidy.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/Errors/Ppr.hs
- compiler/GHC/Parser/Errors/Types.hs
- compiler/GHC/Parser/Header.hs
- compiler/GHC/Parser/Lexer.x
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Rename/Env.hs
- compiler/GHC/Rename/Expr.hs
- compiler/GHC/Rename/Module.hs
- compiler/GHC/Rename/Names.hs
- compiler/GHC/Rename/Splice.hs
- compiler/GHC/Rename/Utils.hs
- compiler/GHC/Runtime/Eval.hs
- compiler/GHC/Runtime/Interpreter.hs
- compiler/GHC/Runtime/Loader.hs
- compiler/GHC/StgToByteCode.hs
- compiler/GHC/Tc/Deriv/Generate.hs
- compiler/GHC/Tc/Deriv/Utils.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Gen/App.hs
- compiler/GHC/Tc/Gen/Head.hs
- compiler/GHC/Tc/Gen/Pat.hs
- compiler/GHC/Tc/Gen/Splice.hs
- compiler/GHC/Tc/Module.hs
- compiler/GHC/Tc/Plugin.hs
- compiler/GHC/Tc/Solver/Dict.hs
- compiler/GHC/Tc/Solver/Equality.hs
- compiler/GHC/Tc/Solver/Monad.hs
- compiler/GHC/Tc/TyCl/Instance.hs
- compiler/GHC/Tc/Types.hs
- compiler/GHC/Tc/Types/LclEnv.hs
- compiler/GHC/Tc/Types/Origin.hs
- compiler/GHC/Tc/Types/TH.hs
- compiler/GHC/Tc/Utils/Backpack.hs
- compiler/GHC/Tc/Utils/Concrete.hs
- compiler/GHC/Tc/Utils/Env.hs
- compiler/GHC/Tc/Utils/Monad.hs
- compiler/GHC/Tc/Utils/TcMType.hs
- compiler/GHC/Types/Basic.hs
- compiler/GHC/Types/Error/Codes.hs
- compiler/GHC/Types/Name/Reader.hs
- + compiler/GHC/Types/ThLevelIndex.hs
- compiler/GHC/Unit/Home/PackageTable.hs
- compiler/GHC/Unit/Module/Deps.hs
- compiler/GHC/Unit/Module/Graph.hs
- compiler/GHC/Unit/Module/Imported.hs
- compiler/GHC/Unit/Module/ModSummary.hs
- + compiler/GHC/Unit/Module/Stage.hs
- compiler/GHC/Unit/Types.hs
- compiler/GHC/Utils/Binary.hs
- compiler/GHC/Utils/Outputable.hs
- compiler/GHC/Utils/Panic/Plain.hs
- compiler/Language/Haskell/Syntax/ImpExp.hs
- + compiler/Language/Haskell/Syntax/ImpExp/IsBoot.hs
- compiler/ghc.cabal.in
- docs/users_guide/exts/control.rst
- docs/users_guide/exts/template_haskell.rst
- docs/users_guide/javascript.rst
- docs/users_guide/phases.rst
- docs/users_guide/using-warnings.rst
- ghc/GHCi/UI.hs
- libraries/base/tests/IO/Makefile
- libraries/ghc-internal/src/GHC/Internal/LanguageExtensions.hs
- libraries/ghci/GHCi/Message.hs
- libraries/ghci/GHCi/Run.hs
- rts/Exception.cmm
- rts/Interpreter.c
- testsuite/tests/ado/ado004.stderr
- testsuite/tests/annotations/should_fail/annfail03.stderr
- testsuite/tests/annotations/should_fail/annfail04.stderr
- testsuite/tests/annotations/should_fail/annfail06.stderr
- testsuite/tests/annotations/should_fail/annfail09.stderr
- testsuite/tests/count-deps/CountDepsAst.stdout
- testsuite/tests/count-deps/CountDepsParser.stdout
- testsuite/tests/dependent/should_compile/T14729.stderr
- testsuite/tests/dependent/should_compile/T15743.stderr
- testsuite/tests/dependent/should_compile/T15743e.stderr
- testsuite/tests/deriving/should_compile/T14682.stderr
- testsuite/tests/determinism/determ021/determ021.stdout
- + testsuite/tests/driver/T4437.stdout
- testsuite/tests/driver/json2.stderr
- testsuite/tests/gadt/T19847a.stderr
- + testsuite/tests/gadt/T23298.hs
- + testsuite/tests/gadt/T23298.stderr
- testsuite/tests/gadt/all.T
- testsuite/tests/ghc-api/fixed-nodes/FixedNodes.hs
- testsuite/tests/ghc-api/fixed-nodes/ModuleGraphInvariants.hs
- + testsuite/tests/ghci/scripts/GhciPackageRename.hs
- + testsuite/tests/ghci/scripts/GhciPackageRename.script
- + testsuite/tests/ghci/scripts/GhciPackageRename.stdout
- testsuite/tests/ghci/scripts/all.T
- testsuite/tests/indexed-types/should_compile/T15711.stderr
- testsuite/tests/indexed-types/should_compile/T15852.stderr
- testsuite/tests/indexed-types/should_compile/T3017.stderr
- testsuite/tests/interface-stability/template-haskell-exports.stdout
- testsuite/tests/module/mod185.stderr
- testsuite/tests/parser/should_compile/DumpParsedAst.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/partial-sigs/should_compile/ADT.stderr
- testsuite/tests/partial-sigs/should_compile/AddAndOr1.stderr
- testsuite/tests/partial-sigs/should_compile/AddAndOr2.stderr
- testsuite/tests/partial-sigs/should_compile/AddAndOr3.stderr
- testsuite/tests/partial-sigs/should_compile/AddAndOr4.stderr
- testsuite/tests/partial-sigs/should_compile/AddAndOr5.stderr
- testsuite/tests/partial-sigs/should_compile/AddAndOr6.stderr
- testsuite/tests/partial-sigs/should_compile/BoolToBool.stderr
- testsuite/tests/partial-sigs/should_compile/DataFamilyInstanceLHS.stderr
- testsuite/tests/partial-sigs/should_compile/Defaulting1MROn.stderr
- testsuite/tests/partial-sigs/should_compile/Defaulting2MROff.stderr
- testsuite/tests/partial-sigs/should_compile/Defaulting2MROn.stderr
- testsuite/tests/partial-sigs/should_compile/Either.stderr
- testsuite/tests/partial-sigs/should_compile/EqualityConstraint.stderr
- testsuite/tests/partial-sigs/should_compile/Every.stderr
- testsuite/tests/partial-sigs/should_compile/EveryNamed.stderr
- testsuite/tests/partial-sigs/should_compile/ExpressionSig.stderr
- testsuite/tests/partial-sigs/should_compile/ExpressionSigNamed.stderr
- testsuite/tests/partial-sigs/should_compile/ExtraConstraints1.stderr
- testsuite/tests/partial-sigs/should_compile/ExtraConstraints2.stderr
- testsuite/tests/partial-sigs/should_compile/ExtraConstraints3.stderr
- testsuite/tests/partial-sigs/should_compile/ExtraNumAMROff.stderr
- testsuite/tests/partial-sigs/should_compile/ExtraNumAMROn.stderr
- testsuite/tests/partial-sigs/should_compile/Forall1.stderr
- testsuite/tests/partial-sigs/should_compile/GenNamed.stderr
- testsuite/tests/partial-sigs/should_compile/HigherRank1.stderr
- testsuite/tests/partial-sigs/should_compile/HigherRank2.stderr
- testsuite/tests/partial-sigs/should_compile/LocalDefinitionBug.stderr
- testsuite/tests/partial-sigs/should_compile/Meltdown.stderr
- testsuite/tests/partial-sigs/should_compile/MonoLocalBinds.stderr
- testsuite/tests/partial-sigs/should_compile/NamedTyVar.stderr
- testsuite/tests/partial-sigs/should_compile/NamedWildcardInDataFamilyInstanceLHS.stderr
- testsuite/tests/partial-sigs/should_compile/NamedWildcardInTypeFamilyInstanceLHS.stderr
- testsuite/tests/partial-sigs/should_compile/ParensAroundContext.stderr
- testsuite/tests/partial-sigs/should_compile/PatBind.stderr
- testsuite/tests/partial-sigs/should_compile/PatBind2.stderr
- testsuite/tests/partial-sigs/should_compile/PatternSig.stderr
- testsuite/tests/partial-sigs/should_compile/Recursive.stderr
- testsuite/tests/partial-sigs/should_compile/ScopedNamedWildcards.stderr
- testsuite/tests/partial-sigs/should_compile/ScopedNamedWildcardsGood.stderr
- testsuite/tests/partial-sigs/should_compile/ShowNamed.stderr
- testsuite/tests/partial-sigs/should_compile/SimpleGen.stderr
- testsuite/tests/partial-sigs/should_compile/SkipMany.stderr
- testsuite/tests/partial-sigs/should_compile/SomethingShowable.stderr
- testsuite/tests/partial-sigs/should_compile/TypeFamilyInstanceLHS.stderr
- testsuite/tests/partial-sigs/should_compile/Uncurry.stderr
- testsuite/tests/partial-sigs/should_compile/UncurryNamed.stderr
- testsuite/tests/partial-sigs/should_compile/WarningWildcardInstantiations.stderr
- testsuite/tests/polykinds/T15592.stderr
- testsuite/tests/polykinds/T15592b.stderr
- testsuite/tests/printer/T18052a.stderr
- testsuite/tests/quasiquotation/qq001/qq001.stderr
- testsuite/tests/quasiquotation/qq002/qq002.stderr
- testsuite/tests/quasiquotation/qq003/qq003.stderr
- testsuite/tests/quasiquotation/qq004/qq004.stderr
- + testsuite/tests/quotes/T5721.stderr
- testsuite/tests/roles/should_compile/Roles1.stderr
- testsuite/tests/roles/should_compile/Roles14.stderr
- testsuite/tests/roles/should_compile/Roles2.stderr
- testsuite/tests/roles/should_compile/Roles3.stderr
- testsuite/tests/roles/should_compile/Roles4.stderr
- testsuite/tests/roles/should_compile/T8958.stderr
- testsuite/tests/showIface/DocsInHiFile1.stdout
- testsuite/tests/showIface/DocsInHiFileTH.stdout
- testsuite/tests/showIface/HaddockIssue849.stdout
- testsuite/tests/showIface/HaddockOpts.stdout
- testsuite/tests/showIface/HaddockSpanIssueT24378.stdout
- testsuite/tests/showIface/LanguageExts.stdout
- testsuite/tests/showIface/MagicHashInHaddocks.stdout
- testsuite/tests/showIface/NoExportList.stdout
- testsuite/tests/showIface/PragmaDocs.stdout
- testsuite/tests/showIface/ReExports.stdout
- + testsuite/tests/simplCore/should_compile/T25703.hs
- + testsuite/tests/simplCore/should_compile/T25703.stderr
- + testsuite/tests/simplCore/should_compile/T25703a.hs
- + testsuite/tests/simplCore/should_compile/T25703a.stderr
- + testsuite/tests/simplCore/should_compile/T25965.hs
- testsuite/tests/simplCore/should_compile/all.T
- + testsuite/tests/splice-imports/ClassA.hs
- + testsuite/tests/splice-imports/InstanceA.hs
- + testsuite/tests/splice-imports/Makefile
- + testsuite/tests/splice-imports/SI01.hs
- + testsuite/tests/splice-imports/SI01A.hs
- + testsuite/tests/splice-imports/SI02.hs
- + testsuite/tests/splice-imports/SI03.hs
- + testsuite/tests/splice-imports/SI03.stderr
- + testsuite/tests/splice-imports/SI04.hs
- + testsuite/tests/splice-imports/SI05.hs
- + testsuite/tests/splice-imports/SI05.stderr
- + testsuite/tests/splice-imports/SI05A.hs
- + testsuite/tests/splice-imports/SI06.hs
- + testsuite/tests/splice-imports/SI07.hs
- + testsuite/tests/splice-imports/SI07.stderr
- + testsuite/tests/splice-imports/SI07A.hs
- + testsuite/tests/splice-imports/SI08.hs
- + testsuite/tests/splice-imports/SI08.stderr
- + testsuite/tests/splice-imports/SI08_oneshot.stderr
- + testsuite/tests/splice-imports/SI09.hs
- + testsuite/tests/splice-imports/SI10.hs
- + testsuite/tests/splice-imports/SI13.hs
- + testsuite/tests/splice-imports/SI14.hs
- + testsuite/tests/splice-imports/SI14.stderr
- + testsuite/tests/splice-imports/SI15.hs
- + testsuite/tests/splice-imports/SI15.stderr
- + testsuite/tests/splice-imports/SI16.hs
- + testsuite/tests/splice-imports/SI16.stderr
- + testsuite/tests/splice-imports/SI17.hs
- + testsuite/tests/splice-imports/SI18.hs
- + testsuite/tests/splice-imports/SI18.stderr
- + testsuite/tests/splice-imports/SI19.hs
- + testsuite/tests/splice-imports/SI19A.hs
- + testsuite/tests/splice-imports/SI20.hs
- + testsuite/tests/splice-imports/SI20.stderr
- + testsuite/tests/splice-imports/SI21.hs
- + testsuite/tests/splice-imports/SI21.stderr
- + testsuite/tests/splice-imports/SI22.hs
- + testsuite/tests/splice-imports/SI22.stderr
- + testsuite/tests/splice-imports/SI23.hs
- + testsuite/tests/splice-imports/SI23A.hs
- + testsuite/tests/splice-imports/SI24.hs
- + testsuite/tests/splice-imports/SI25.hs
- + testsuite/tests/splice-imports/SI25.stderr
- + testsuite/tests/splice-imports/SI25Helper.hs
- + testsuite/tests/splice-imports/SI26.hs
- + testsuite/tests/splice-imports/SI27.hs
- + testsuite/tests/splice-imports/SI27.stderr
- + testsuite/tests/splice-imports/SI28.hs
- + testsuite/tests/splice-imports/SI28.stderr
- + testsuite/tests/splice-imports/SI29.hs
- + testsuite/tests/splice-imports/SI29.stderr
- + testsuite/tests/splice-imports/SI30.script
- + testsuite/tests/splice-imports/SI30.stdout
- + testsuite/tests/splice-imports/SI31.script
- + testsuite/tests/splice-imports/SI31.stderr
- + testsuite/tests/splice-imports/SI32.script
- + testsuite/tests/splice-imports/SI32.stdout
- + testsuite/tests/splice-imports/SI33.script
- + testsuite/tests/splice-imports/SI33.stdout
- + testsuite/tests/splice-imports/SI34.hs
- + testsuite/tests/splice-imports/SI34.stderr
- + testsuite/tests/splice-imports/SI34M1.hs
- + testsuite/tests/splice-imports/SI34M2.hs
- + testsuite/tests/splice-imports/SI35.hs
- + testsuite/tests/splice-imports/SI35A.hs
- + testsuite/tests/splice-imports/SI36.hs
- + testsuite/tests/splice-imports/SI36.stderr
- + testsuite/tests/splice-imports/SI36_A.hs
- + testsuite/tests/splice-imports/SI36_B1.hs
- + testsuite/tests/splice-imports/SI36_B2.hs
- + testsuite/tests/splice-imports/SI36_B3.hs
- + testsuite/tests/splice-imports/SI36_C1.hs
- + testsuite/tests/splice-imports/SI36_C2.hs
- + testsuite/tests/splice-imports/SI36_C3.hs
- + testsuite/tests/splice-imports/all.T
- testsuite/tests/th/T16976z.stderr
- testsuite/tests/th/T17820a.stderr
- testsuite/tests/th/T17820b.stderr
- testsuite/tests/th/T17820c.stderr
- testsuite/tests/th/T17820d.stderr
- testsuite/tests/th/T17820e.stderr
- testsuite/tests/th/T21547.stderr
- testsuite/tests/th/T23829_hasty.stderr
- testsuite/tests/th/T23829_hasty_b.stderr
- testsuite/tests/th/T23829_tardy.ghc.stderr
- testsuite/tests/th/T5795.stderr
- testsuite/tests/th/TH_Roles2.stderr
- testsuite/tests/typecheck/should_compile/T12763.stderr
- testsuite/tests/typecheck/should_compile/T18406b.stderr
- testsuite/tests/typecheck/should_compile/T18529.stderr
- testsuite/tests/typecheck/should_compile/T21023.stderr
- utils/check-exact/ExactPrint.hs
- utils/count-deps/Main.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/04f7475e435da6574def389211d747…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/04f7475e435da6574def389211d747…
You're receiving this email because of your account on gitlab.haskell.org.
1
0

[Git][ghc/ghc][wip/az/ghc-cpp] Sort out expansion of no-arg macros, in a context with args
by Alan Zimmerman (@alanz) 27 Apr '25
by Alan Zimmerman (@alanz) 27 Apr '25
27 Apr '25
Alan Zimmerman pushed to branch wip/az/ghc-cpp at Glasgow Haskell Compiler / GHC
Commits:
186cff7e by Alan Zimmerman at 2025-04-27T20:16:04+01:00
Sort out expansion of no-arg macros, in a context with args
And make the expansion bottom out, in the case of recursion
- - - - -
4 changed files:
- compiler/GHC/Parser/PreProcess/Macro.hs
- testsuite/tests/ghc-cpp/GhcCpp01.hs
- utils/check-cpp/Macro.hs
- utils/check-cpp/Main.hs
Changes:
=====================================
compiler/GHC/Parser/PreProcess/Macro.hs
=====================================
@@ -65,15 +65,19 @@ expand s str = expanded
toks = case cppLex False str of
Left err -> error $ "expand:" ++ show (err, str)
Right tks -> tks
- expanded = combineToks $ map t_str $ expandToks s toks
+ expanded = combineToks $ map t_str $ expandToks maxExpansions s toks
-expandToks :: MacroDefines -> [Token] -> [Token]
-expandToks s ts =
+maxExpansions :: Int
+maxExpansions = 15
+
+expandToks :: Int -> MacroDefines -> [Token] -> [Token]
+expandToks 0 _ ts = error $ "macro_expansion limit (" ++ show maxExpansions ++ ") hit, aborting. ts=" ++ show ts
+expandToks cnt s ts =
let
- (expansionDone, r) = doExpandToks False s ts
+ (!expansionDone, !r) = doExpandToks False s ts
in
if expansionDone
- then expandToks s r
+ then expandToks (cnt -1) s r
else r
doExpandToks :: Bool -> MacroDefines -> [Token] -> (Bool, [Token])
@@ -100,13 +104,14 @@ doExpandToks ed s (TIdentifier n : ts) = (ed'', expanded ++ rest)
where
(ed', expanded, ts') = case Map.lookup n s of
Nothing -> (ed, [TIdentifier n], ts)
- Just defs -> (ed0, r, rest0)
+ Just defs -> (ed0, r, rest1)
where
(args, rest0) = getExpandArgs ts
- (m_args, rhs) = fromMaybe (Nothing, [TIdentifier n]) (Map.lookup (arg_arity args) defs)
- (ed0, r) = case m_args of
- Nothing -> (True, rhs)
- Just _ -> (True, replace_args args m_args rhs)
+ fallbackArgs = fromMaybe (Nothing, [TIdentifier n]) (Map.lookup Nothing defs)
+ (m_args, rhs) = fromMaybe fallbackArgs (Map.lookup (arg_arity args) defs)
+ (ed0, r, rest1) = case m_args of
+ Nothing -> (True, rhs, ts)
+ Just _ -> (True, replace_args args m_args rhs, rest0)
(ed'', rest) = doExpandToks ed' s ts'
doExpandToks ed s (t : ts) = (ed', t : r)
where
=====================================
testsuite/tests/ghc-cpp/GhcCpp01.hs
=====================================
@@ -33,3 +33,15 @@ complete junk!
#ifdef AA
aa = 1
#endif
+
+-- undef and rewrite base name only
+#define MIN_VERSION_Cabal(a,b,c) 1
+
+#ifdef MIN_VERSION_Cabal
+#undef CH_MIN_VERSION_Cabal
+#define CH_MIN_VERSION_Cabal MIN_VERSION_Cabal
+#endif
+
+#if CH_MIN_VERSION_Cabal(1,22,0)
+x = 1
+#endif
=====================================
utils/check-cpp/Macro.hs
=====================================
@@ -64,15 +64,19 @@ expand s str = expanded
toks = case cppLex False str of
Left err -> error $ "expand:" ++ show (err, str)
Right tks -> tks
- expanded = combineToks $ map t_str $ expandToks s toks
+ expanded = combineToks $ map t_str $ expandToks maxExpansions s toks
-expandToks :: MacroDefines -> [Token] -> [Token]
-expandToks s ts =
+maxExpansions :: Int
+maxExpansions = 15
+
+expandToks :: Int -> MacroDefines -> [Token] -> [Token]
+expandToks 0 _ ts = error $ "macro_expansion limit (" ++ show maxExpansions ++ ") hit, aborting. ts=" ++ show ts
+expandToks cnt s ts =
let
- (expansionDone, r) = doExpandToks False s ts
+ (!expansionDone, !r) = doExpandToks False s ts
in
if expansionDone
- then expandToks s r
+ then expandToks (cnt -1) s r
else r
doExpandToks :: Bool -> MacroDefines -> [Token] -> (Bool, [Token])
@@ -99,13 +103,14 @@ doExpandToks ed s (TIdentifier n : ts) = (ed'', expanded ++ rest)
where
(ed', expanded, ts') = case Map.lookup n s of
Nothing -> (ed, [TIdentifier n], ts)
- Just defs -> (ed0, r, rest0)
+ Just defs -> (ed0, r, rest1)
where
(args, rest0) = getExpandArgs ts
- (m_args, rhs) = fromMaybe (Nothing, [TIdentifier n]) (Map.lookup (arg_arity args) defs)
- (ed0, r) = case m_args of
- Nothing -> (True, rhs)
- Just _ -> (True, replace_args args m_args rhs)
+ fallbackArgs = fromMaybe (Nothing, [TIdentifier n]) (Map.lookup Nothing defs)
+ (m_args, rhs) = fromMaybe fallbackArgs (Map.lookup (arg_arity args) defs)
+ (ed0, r, rest1) = case m_args of
+ Nothing -> (True, rhs, ts)
+ Just _ -> (True, replace_args args m_args rhs, rest0)
(ed'', rest) = doExpandToks ed' s ts'
doExpandToks ed s (t : ts) = (ed', t : r)
where
=====================================
utils/check-cpp/Main.hs
=====================================
@@ -820,3 +820,21 @@ t35 = do
, "#endif"
, ""
]
+
+t36 :: IO ()
+t36 = do
+ dump
+ [ "{-# LANGUAGE GHC_CPP #-}"
+ , "module Example15 where"
+ , "#define MIN_VERSION_Cabal(a,b,c) 1"
+ , ""
+ , "#ifdef MIN_VERSION_Cabal"
+ , "#undef CH_MIN_VERSION_Cabal"
+ , "#define CH_MIN_VERSION_Cabal MIN_VERSION_Cabal"
+ , "#endif"
+ , ""
+ , "#if CH_MIN_VERSION_Cabal(1,22,0)"
+ , "x = 1"
+ , "#endif"
+ , ""
+ ]
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/186cff7e2725ff7e2c58fc62e5cbe85…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/186cff7e2725ff7e2c58fc62e5cbe85…
You're receiving this email because of your account on gitlab.haskell.org.
1
0

[Git][ghc/ghc][wip/az/ghc-cpp] Sort out expansion of no-arg macros, in a context with args
by Alan Zimmerman (@alanz) 27 Apr '25
by Alan Zimmerman (@alanz) 27 Apr '25
27 Apr '25
Alan Zimmerman pushed to branch wip/az/ghc-cpp at Glasgow Haskell Compiler / GHC
Commits:
8ad66d1c by Alan Zimmerman at 2025-04-27T19:52:56+01:00
Sort out expansion of no-arg macros, in a context with args
And make the expansion bottom out, in the case of recursion
- - - - -
2 changed files:
- utils/check-cpp/Macro.hs
- utils/check-cpp/Main.hs
Changes:
=====================================
utils/check-cpp/Macro.hs
=====================================
@@ -64,15 +64,19 @@ expand s str = expanded
toks = case cppLex False str of
Left err -> error $ "expand:" ++ show (err, str)
Right tks -> tks
- expanded = combineToks $ map t_str $ expandToks s toks
+ expanded = combineToks $ map t_str $ expandToks maxExpansions s toks
-expandToks :: MacroDefines -> [Token] -> [Token]
-expandToks s ts =
+maxExpansions :: Int
+maxExpansions = 15
+
+expandToks :: Int -> MacroDefines -> [Token] -> [Token]
+expandToks 0 _ ts = error $ "macro_expansion limit (" ++ show maxExpansions ++ ") hit, aborting. ts=" ++ show ts
+expandToks cnt s ts =
let
- (expansionDone, r) = doExpandToks False s ts
+ (!expansionDone, !r) = doExpandToks False s ts
in
if expansionDone
- then expandToks s r
+ then expandToks (cnt -1) s r
else r
doExpandToks :: Bool -> MacroDefines -> [Token] -> (Bool, [Token])
@@ -99,13 +103,14 @@ doExpandToks ed s (TIdentifier n : ts) = (ed'', expanded ++ rest)
where
(ed', expanded, ts') = case Map.lookup n s of
Nothing -> (ed, [TIdentifier n], ts)
- Just defs -> (ed0, r, rest0)
+ Just defs -> (ed0, r, rest1)
where
(args, rest0) = getExpandArgs ts
- (m_args, rhs) = fromMaybe (Nothing, [TIdentifier n]) (Map.lookup (arg_arity args) defs)
- (ed0, r) = case m_args of
- Nothing -> (True, rhs)
- Just _ -> (True, replace_args args m_args rhs)
+ fallbackArgs = fromMaybe (Nothing, [TIdentifier n]) (Map.lookup Nothing defs)
+ (m_args, rhs) = fromMaybe fallbackArgs (Map.lookup (arg_arity args) defs)
+ (ed0, r, rest1) = case m_args of
+ Nothing -> (True, rhs, ts)
+ Just _ -> (True, replace_args args m_args rhs, rest0)
(ed'', rest) = doExpandToks ed' s ts'
doExpandToks ed s (t : ts) = (ed', t : r)
where
=====================================
utils/check-cpp/Main.hs
=====================================
@@ -820,3 +820,21 @@ t35 = do
, "#endif"
, ""
]
+
+t36 :: IO ()
+t36 = do
+ dump
+ [ "{-# LANGUAGE GHC_CPP #-}"
+ , "module Example15 where"
+ , "#define MIN_VERSION_Cabal(a,b,c) 1"
+ , ""
+ , "#ifdef MIN_VERSION_Cabal"
+ , "#undef CH_MIN_VERSION_Cabal"
+ , "#define CH_MIN_VERSION_Cabal MIN_VERSION_Cabal"
+ , "#endif"
+ , ""
+ , "#if CH_MIN_VERSION_Cabal(1,22,0)"
+ , "x = 1"
+ , "#endif"
+ , ""
+ ]
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/8ad66d1c738f9c7014f3abaa734ab46…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/8ad66d1c738f9c7014f3abaa734ab46…
You're receiving this email because of your account on gitlab.haskell.org.
1
0

27 Apr '25
Alan Zimmerman pushed to branch wip/az/ghc-cpp at Glasgow Haskell Compiler / GHC
Commits:
53aa9b6a by Alan Zimmerman at 2025-04-27T13:28:33+01:00
Implement GHC_CPP undef
- - - - -
9 changed files:
- compiler/GHC/Parser/PreProcess.hs
- compiler/GHC/Parser/PreProcess/ParsePP.hs
- compiler/GHC/Parser/PreProcess/State.hs
- testsuite/tests/ghc-cpp/GhcCpp01.hs
- testsuite/tests/ghc-cpp/GhcCpp01.stderr
- utils/check-cpp/Main.hs
- utils/check-cpp/ParsePP.hs
- utils/check-cpp/PreProcess.hs
- utils/check-cpp/State.hs
Changes:
=====================================
compiler/GHC/Parser/PreProcess.hs
=====================================
@@ -264,6 +264,8 @@ processCpp ss = do
ppInclude filename
Right (CppDefine name args def) -> do
ppDefine (MacroName name args) def
+ Right (CppUndef name) -> do
+ ppUndef name
Right (CppIf cond) -> do
val <- cppCond cond
ar <- pushAccepting val
=====================================
compiler/GHC/Parser/PreProcess/ParsePP.hs
=====================================
@@ -29,6 +29,7 @@ parseDirective s =
Right toks ->
case toks of
(THash "#" : TIdentifier "define" : ts) -> cppDefine ts
+ (THash "#" : TIdentifier "undef" : ts) -> Right $ cppUndef (map t_str ts)
(THash "#" : TIdentifier "include" : ts) -> Right $ cppInclude (map t_str ts)
(THash "#" : TIdentifier "if" : ts) -> Right $ cppIf (map t_str ts)
(THash "#" : TIdentifier "ifndef" : ts) -> Right $ cppIfndef (map t_str ts)
@@ -54,6 +55,9 @@ cppDefine (TIdentifierLParen n : ts) = Right $ CppDefine (init n) args def
cppDefine (TIdentifier n : ts) = Right $ CppDefine n Nothing ts
cppDefine (t : _) = Left $ "#define: expecting an identifier, got :" ++ show t
+cppUndef :: [String] -> CppDirective
+cppUndef ts = CppUndef (combineToks ts)
+
cppInclude :: [String] -> CppDirective
cppInclude ts = CppInclude (combineToks ts)
=====================================
compiler/GHC/Parser/PreProcess/State.hs
=====================================
@@ -27,6 +27,7 @@ module GHC.Parser.PreProcess.State (
popContinuation,
ppDefine,
ppIsDefined,
+ ppUndef,
getCppState,
ghcCppEnabled,
setInLinePragma,
@@ -98,6 +99,7 @@ data CppDirective
= CppInclude String
| -- | name, optional args, replacement
CppDefine String (Maybe [String]) MacroDef
+ | CppUndef String
| CppIfdef String
| CppIfndef String
| CppIf String
@@ -332,9 +334,25 @@ addDefine' :: PpState -> MacroName -> MacroDef -> PpState
addDefine' s name def =
s{pp_defines = insertMacroDef name def (pp_defines s)}
+removeDefine :: String -> PP ()
+removeDefine name = do
+ accepting <- getAccepting
+ when accepting $ do
+ s <- getPpState
+ setPpState $ removeDefine' s name
+
+removeDefine' :: PpState -> String -> PpState
+removeDefine' s name =
+ s{pp_defines = Map.delete name (pp_defines s)}
+
+-- -------------------------------------
+
ppDefine :: MacroName -> MacroDef -> PP ()
ppDefine name val = addDefine name val
+ppUndef :: String -> PP ()
+ppUndef name = removeDefine name
+
ppIsDefined :: MacroName -> PP Bool
ppIsDefined name = do
s <- getPpState
=====================================
testsuite/tests/ghc-cpp/GhcCpp01.hs
=====================================
@@ -18,3 +18,18 @@ x = 5
#if defined(BAR) || defined FOO
y = 1
#endif
+
+#undef FOO
+#ifdef FOO
+complete junk!
+#endif
+
+-- nested undef
+#define AA
+#if 0
+#undef AA
+#endif
+
+#ifdef AA
+aa = 1
+#endif
=====================================
testsuite/tests/ghc-cpp/GhcCpp01.stderr
=====================================
@@ -4,8 +4,7 @@
------------------------------
-#define FOO(A,B) A + B
-#define FOO(A,B,C) A + B + C
+#define AA
#define MIN_VERSION_Cabal(major1,major2,minor) ( ( major1 ) < 3 || ( major1 ) == 3 && ( major2 ) < 14 || ( major1 ) == 3 && ( major2 ) == 14 && ( minor ) <= 1 )
@@ -216,6 +215,29 @@
|
- |#if de
+
+- |#endif
+
+- |
+
+- |#undef FOO
+
+- |#ifdef
+
+- |#endif
+
+- |
+
+- |-- ne
+- |#define A
+- |#if 0
+
+
+- |#endif
+
+ |
+
+- |#ifdef
|
------------------------------
=====================================
utils/check-cpp/Main.hs
=====================================
@@ -783,6 +783,7 @@ t33 = do
t34 :: IO ()
t34 = do
dump
+
[ "{-# LANGUAGE GHC_CPP #-}"
, "module Example4 where"
, ""
@@ -799,3 +800,23 @@ t34 = do
, "#endif"
, ""
]
+
+t35 :: IO ()
+t35 = do
+ dump
+ [ "{-# LANGUAGE GHC_CPP #-}"
+ , "module Example14 where"
+
+ , "#define FOO"
+ , "#define FOO(X) X"
+ , ""
+ , "#undef FOO"
+ , ""
+ , "foo ="
+ , "#ifdef FOO"
+ , " 'a'"
+ , "#else"
+ , " 'b'"
+ , "#endif"
+ , ""
+ ]
=====================================
utils/check-cpp/ParsePP.hs
=====================================
@@ -29,6 +29,7 @@ parseDirective s =
Right toks ->
case toks of
(THash "#" : TIdentifier "define" : ts) -> cppDefine ts
+ (THash "#" : TIdentifier "undef" : ts) -> Right $ cppUndef (map t_str ts)
(THash "#" : TIdentifier "include" : ts) -> Right $ cppInclude (map t_str ts)
(THash "#" : TIdentifier "if" : ts) -> Right $ cppIf (map t_str ts)
(THash "#" : TIdentifier "ifndef" : ts) -> Right $ cppIfndef (map t_str ts)
@@ -54,6 +55,9 @@ cppDefine (TIdentifierLParen n : ts) = Right $ CppDefine (init n) args def
cppDefine (TIdentifier n : ts) = Right $ CppDefine n Nothing ts
cppDefine (t : _) = Left $ "#define: expecting an identifier, got :" ++ show t
+cppUndef :: [String] -> CppDirective
+cppUndef ts = CppUndef (combineToks ts)
+
cppInclude :: [String] -> CppDirective
cppInclude ts = CppInclude (combineToks ts)
=====================================
utils/check-cpp/PreProcess.hs
=====================================
@@ -293,6 +293,8 @@ processCpp ss = do
ppInclude filename
Right (CppDefine name args def) -> do
ppDefine (MacroName name args) def
+ Right (CppUndef name) -> do
+ ppUndef name
Right (CppIf cond) -> do
val <- cppCond cond
ar <- pushAccepting val
=====================================
utils/check-cpp/State.hs
=====================================
@@ -27,6 +27,7 @@ module State (
popContinuation,
ppDefine,
ppIsDefined,
+ ppUndef,
getCppState,
ghcCppEnabled,
setInLinePragma,
@@ -99,6 +100,7 @@ data CppDirective
= CppInclude String
| -- | name, optional args, replacement
CppDefine String (Maybe [String]) MacroDef
+ | CppUndef String
| CppIfdef String
| CppIfndef String
| CppIf String
@@ -333,9 +335,25 @@ addDefine' :: PpState -> MacroName -> MacroDef -> PpState
addDefine' s name def =
s{pp_defines = insertMacroDef name def (pp_defines s)}
+removeDefine :: String -> PP ()
+removeDefine name = do
+ accepting <- getAccepting
+ when accepting $ do
+ s <- getPpState
+ setPpState $ removeDefine' s name
+
+removeDefine' :: PpState -> String -> PpState
+removeDefine' s name =
+ s{pp_defines = Map.delete name (pp_defines s)}
+
+-- -------------------------------------
+
ppDefine :: MacroName -> MacroDef -> PP ()
ppDefine name val = addDefine name val
+ppUndef :: String -> PP ()
+ppUndef name = removeDefine name
+
ppIsDefined :: MacroName -> PP Bool
ppIsDefined name = do
s <- getPpState
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/53aa9b6a95ca7b721c8ff0b90074f9d…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/53aa9b6a95ca7b721c8ff0b90074f9d…
You're receiving this email because of your account on gitlab.haskell.org.
1
0

[Git][ghc/ghc][wip/andreask/spec_tyfams] 2 commits: Typos
by Simon Peyton Jones (@simonpj) 27 Apr '25
by Simon Peyton Jones (@simonpj) 27 Apr '25
27 Apr '25
Simon Peyton Jones pushed to branch wip/andreask/spec_tyfams at Glasgow Haskell Compiler / GHC
Commits:
a76cbf2d by Simon Peyton Jones at 2025-04-27T12:55:52+01:00
Typos
- - - - -
752ecf79 by Simon Peyton Jones at 2025-04-27T12:56:00+01:00
Remove a special case that appears to do nothing
See the commented-out block of `specCase`
- - - - -
2 changed files:
- compiler/GHC/Core/Opt/Specialise.hs
- compiler/GHC/Tc/Solver/Monad.hs
Changes:
=====================================
compiler/GHC/Core/Opt/Specialise.hs
=====================================
@@ -65,7 +65,6 @@ import GHC.Unit.Module.ModGuts
import GHC.Core.Unfold
import Data.List( partition )
-import Data.List.NonEmpty ( NonEmpty (..) )
import GHC.Core.Subst (substTickish)
import GHC.Core.TyCon (tyConClass_maybe)
import GHC.Core.DataCon (dataConTyCon)
@@ -1280,6 +1279,36 @@ specCase :: SpecEnv
, OutId
, [OutAlt]
, UsageDetails)
+{-
+------------------
+SLPJ: I am commenting out this entire special case.
+Reading Note [Floating dictionaries out of cases] carefully, I just don't get it.
+* We never explicitly pattern-match on a dictionary; rather the class-op rules
+ select superclasses from it.
+* Calling `interestingDict` on every scrutinee is hardly sensible;
+ generally `interestingDict` is called only on Constraint-kinded things.
+* It was giving a Lint scope error in !14272
+
+So I think this code does no good; it's a waste of time and complexity.
+
+The commit that introduced it is back in 2010:
+
+ commit c107a00ccf1e641a2d008939cf477c71caa028d5
+ Author: Simon Peyton Jones <simonpj(a)microsoft.com>
+ Date: Thu Aug 12 13:11:33 2010 +0000
+
+ Improve the Specialiser, fixing Trac #4203
+
+ Simply fixing #4203 is a tiny fix: in case alterantives we should
+ do dumpUDs *including* the case binder.
+
+ But I realised that we can do better and wasted far too much time
+ implementing the idea. It's described in
+ Note [Floating dictionaries out of cases]
+
+There is no compelling motivation and no test case
+----------------------
+
specCase env scrut' case_bndr [Alt con args rhs]
| -- See Note [Floating dictionaries out of cases]
-- interestingDict scrut' (idType case_bndr)
@@ -1340,7 +1369,7 @@ specCase env scrut' case_bndr [Alt con args rhs]
&& tyCoVarsOfType var_ty `disjointVarSet` arg_set
where
var_ty = idType var
-
+-}
specCase env scrut case_bndr alts
= do { (alts', uds_alts) <- mapAndCombineSM spec_alt alts
=====================================
compiler/GHC/Tc/Solver/Monad.hs
=====================================
@@ -397,7 +397,7 @@ updInertDicts dict_ct@(DictCt { di_cls = cls, di_ev = ev, di_tys = tys })
does_not_mention_ip_for :: Type -> DictCt -> Bool
does_not_mention_ip_for str_ty (DictCt { di_cls = cls, di_tys = tys })
= not $ mightMentionIP (not . typesAreApart str_ty) (const True) cls tys
- -- See Note [Using typesAreApart when calling mightMmentionIP]
+ -- See Note [Using typesAreApart when calling mightMentionIP]
-- in GHC.Core.Predicate
updInertIrreds :: IrredCt -> TcS ()
@@ -586,7 +586,7 @@ Note [Using isCallStackTy in mightMentionIP]
To implement Note [Don't add HasCallStack constraints to the solved set],
we need to check whether a constraint contains a HasCallStack or HasExceptionContext
constraint. We do this using the 'mentionsIP' function, but as per
-Note [Using typesAreApart when calling mightMentions] we don't want to simply do:
+Note [Using typesAreApart when calling mightMentionIP] we don't want to simply do:
mightMentionIP
(const True) -- (ignore the implicit parameter string)
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/279442edcad54e8b5b23240c0354c8…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/279442edcad54e8b5b23240c0354c8…
You're receiving this email because of your account on gitlab.haskell.org.
1
0

[Git][ghc/ghc][wip/az/ghc-cpp] 115 commits: Doc: add doc for JS interruptible calling convention (#24444)
by Alan Zimmerman (@alanz) 27 Apr '25
by Alan Zimmerman (@alanz) 27 Apr '25
27 Apr '25
Alan Zimmerman pushed to branch wip/az/ghc-cpp at Glasgow Haskell Compiler / GHC
Commits:
fe6ed8d9 by Sylvain Henry at 2025-04-24T18:04:12-04:00
Doc: add doc for JS interruptible calling convention (#24444)
- - - - -
6111c5e4 by Ben Gamari at 2025-04-24T18:04:53-04:00
compiler: Ensure that Panic.Plain.assertPanic' provides callstack
In 36cddd2ce1a3bc62ea8a1307d8bc6006d54109cf @alt-romes removed CallStack
output from `GHC.Utils.Panic.Plain.assertPanic'`. While this output is
redundant due to the exception backtrace proposal, we may be
bootstrapping with a compiler which does not yet include this machinery.
Reintroduce the output for now.
Fixes #25898.
- - - - -
217caad1 by Matthew Pickering at 2025-04-25T18:58:42+01:00
Implement Explicit Level Imports for Template Haskell
This commit introduces the `ExplicitLevelImports` and
`ImplicitStagePersistence` language extensions as proposed in GHC
Proposal #682.
Key Features
------------
- `ExplicitLevelImports` adds two new import modifiers - `splice` and
`quote` - allowing precise control over the level at which imported
identifiers are available
- `ImplicitStagePersistence` (enabled by default) preserves existing
path-based cross-stage persistence behavior
- `NoImplicitStagePersistence` disables implicit cross-stage
persistence, requiring explicit level imports
Benefits
--------
- Improved compilation performance by reducing unnecessary code generation
- Enhanced IDE experience with faster feedback in `-fno-code` mode
- Better dependency tracking by distinguishing compile-time and runtime dependencies
- Foundation for future cross-compilation improvements
This implementation enables the separation of modules needed at
compile-time from those needed at runtime, allowing for more efficient
compilation pipelines and clearer code organization in projects using
Template Haskell.
Implementation Notes
--------------------
The level which a name is availble at is stored in the 'GRE', in the normal
GlobalRdrEnv. The function `greLevels` returns the levels which a specific GRE
is imported at. The level information for a 'Name' is computed by `getCurrentAndBindLevel`.
The level validity is checked by `checkCrossLevelLifting`.
Instances are checked by `checkWellLevelledDFun`, which computes the level an
instance by calling `checkWellLevelledInstanceWhat`, which sees what is
available at by looking at the module graph.
Modifications to downsweep
--------------------------
Code generation is now only enabled for modules which are needed at
compile time.
See the Note [-fno-code mode] for more information.
Uniform error messages for level errors
---------------------------------------
All error messages to do with levels are now reported uniformly using
the `TcRnBadlyStaged` constructor.
Error messages are uniformly reported in terms of levels.
0 - top-level
1 - quote level
-1 - splice level
The only level hard-coded into the compiler is the top-level in
GHC.Types.ThLevelIndex.topLevelIndex.
Uniformly refer to levels and stages
------------------------------------
There was much confusion about levels vs stages in the compiler.
A level is a semantic concept, used by the typechecker to ensure a
program can be evaluated in a well-staged manner.
A stage is an operational construct, program evaluation proceeds in
stages.
Deprecate -Wbadly-staged-types
------------------------------
`-Wbadly-staged-types` is deprecated in favour of `-Wbadly-levelled-types`.
Lift derivation changed
-----------------------
Derived lift instances will now not generate code with expression
quotations.
Before:
```
data A = A Int deriving Lift
=>
lift (A x) = [| A $(lift x) |]
```
After:
```
lift (A x) = conE 'A `appE` (lift x)
```
This is because if you attempt to derive `Lift` in a module where
`NoImplicitStagePersistence` is enabled, you would get an infinite loop
where a constructor was attempted to be persisted using the instance you
are currently defining.
GHC API Changes
---------------
The ModuleGraph now contains additional information about the type of
the edges (normal, quote or splice) between modules. This is abstracted
using the `ModuleGraphEdge` data type.
Fixes #25828
-------------------------
Metric Increase:
MultiLayerModulesTH_Make
-------------------------
- - - - -
7641a74a by Simon Peyton Jones at 2025-04-26T22:05:19-04:00
Get a decent MatchContext for pattern synonym bindings
In particular when we have a pattern binding
K p1 .. pn = rhs
where K is a pattern synonym. (It might be nested.)
This small MR fixes #25995. It's a tiny fix, to an error message,
removing an always-dubious `unkSkol`.
The bug report was in the context of horde-ad, a big program,
and I didn't manage to make a small repro case quickly. I decided
not to bother further.
- - - - -
cd6cd9d3 by Alan Zimmerman at 2025-04-27T09:42:33+01:00
GHC-CPP: first rough proof of concept
Processes
#define FOO
#ifdef FOO
x = 1
#endif
Into
[ITcppIgnored [L loc ITcppDefine]
,ITcppIgnored [L loc ITcppIfdef]
,ITvarid "x"
,ITequal
,ITinteger (IL {il_text = SourceText "1", il_neg = False, il_value = 1})
,ITcppIgnored [L loc ITcppEndif]
,ITeof]
In time, ITcppIgnored will be pushed into a comment
- - - - -
42fbb8d8 by Alan Zimmerman at 2025-04-27T09:42:37+01:00
Tidy up before re-visiting the continuation mechanic
- - - - -
406d80a0 by Alan Zimmerman at 2025-04-27T09:42:37+01:00
Switch preprocessor to continuation passing style
Proof of concept, needs tidying up
- - - - -
479e2847 by Alan Zimmerman at 2025-04-27T09:42:37+01:00
Small cleanup
- - - - -
7c8d33f0 by Alan Zimmerman at 2025-04-27T09:42:37+01:00
Get rid of some cruft
- - - - -
987dc05b by Alan Zimmerman at 2025-04-27T09:42:37+01:00
Starting to integrate.
Need to get the pragma recognised and set
- - - - -
8c1b61a9 by Alan Zimmerman at 2025-04-27T09:42:37+01:00
Make cppTokens extend to end of line, and process CPP comments
- - - - -
d520ffa6 by Alan Zimmerman at 2025-04-27T09:42:37+01:00
Remove unused ITcppDefined
- - - - -
2a402d8a by Alan Zimmerman at 2025-04-27T09:42:37+01:00
Allow spaces between # and keyword for preprocessor directive
- - - - -
5ac9db4b by Alan Zimmerman at 2025-04-27T09:42:37+01:00
Process CPP continuation lines
They are emited as separate ITcppContinue tokens.
Perhaps the processing should be more like a comment, and keep on
going to the end.
BUT, the last line needs to be slurped as a whole.
- - - - -
d6c6f169 by Alan Zimmerman at 2025-04-27T09:42:37+01:00
Accumulate CPP continuations, process when ready
Can be simplified further, we only need one CPP token
- - - - -
c39d12e1 by Alan Zimmerman at 2025-04-27T09:42:37+01:00
Simplify Lexer interface. Only ITcpp
We transfer directive lines through it, then parse them from scratch
in the preprocessor.
- - - - -
e1b6dc62 by Alan Zimmerman at 2025-04-27T09:42:37+01:00
Deal with directive on last line, with no trailing \n
- - - - -
bd137110 by Alan Zimmerman at 2025-04-27T09:42:37+01:00
Start parsing and processing the directives
- - - - -
b4e92dac by Alan Zimmerman at 2025-04-27T09:42:37+01:00
Prepare for processing include files
- - - - -
1ad6ec4e by Alan Zimmerman at 2025-04-27T09:43:51+01:00
Move PpState into PreProcess
And initParserState, initPragState too
- - - - -
e7ec1320 by Alan Zimmerman at 2025-04-27T09:43:53+01:00
Process nested include files
Also move PpState out of Lexer.x, so it is easy to evolve it in a ghci
session, loading utils/check-cpp/Main.hs
- - - - -
2a02f630 by Alan Zimmerman at 2025-04-27T09:43:53+01:00
Split into separate files
- - - - -
f9c13601 by Alan Zimmerman at 2025-04-27T09:43:53+01:00
Starting on expression parser.
But it hangs. Time for Text.Parsec.Expr
- - - - -
5d21a660 by Alan Zimmerman at 2025-04-27T09:43:53+01:00
Start integrating the ghc-cpp work
From https://github.com/alanz/ghc-cpp
- - - - -
f17c82b8 by Alan Zimmerman at 2025-04-27T09:43:54+01:00
WIP
- - - - -
2b7e8616 by Alan Zimmerman at 2025-04-27T09:44:33+01:00
Fixup after rebase
- - - - -
2bad789d by Alan Zimmerman at 2025-04-27T09:44:36+01:00
WIP
- - - - -
446f656e by Alan Zimmerman at 2025-04-27T09:44:36+01:00
Fixup after rebase, including all tests pass
- - - - -
a36ba3a6 by Alan Zimmerman at 2025-04-27T09:44:36+01:00
Change pragma usage to GHC_CPP from GhcCPP
- - - - -
2227185e by Alan Zimmerman at 2025-04-27T09:44:36+01:00
Some comments
- - - - -
ebbefb31 by Alan Zimmerman at 2025-04-27T09:44:36+01:00
Reformat
- - - - -
a76f409b by Alan Zimmerman at 2025-04-27T09:44:36+01:00
Delete unused file
- - - - -
75f1b629 by Alan Zimmerman at 2025-04-27T09:44:36+01:00
Rename module Parse to ParsePP
- - - - -
914c8ed2 by Alan Zimmerman at 2025-04-27T09:44:36+01:00
Clarify naming in the parser
- - - - -
f79218ae by Alan Zimmerman at 2025-04-27T09:44:36+01:00
WIP. Switching to alex/happy to be able to work in-tree
Since Parsec is not available
- - - - -
1201a517 by Alan Zimmerman at 2025-04-27T09:44:36+01:00
Layering is now correct
- GHC lexer, emits CPP tokens
- accumulated in Preprocessor state
- Lexed by CPP lexer, CPP command extracted, tokens concated with
spaces (to get rid of token pasting via comments)
- if directive lexed and parsed by CPP lexer/parser, and evaluated
- - - - -
2fdf808f by Alan Zimmerman at 2025-04-27T09:44:36+01:00
First example working
Loading Example1.hs into ghci, getting the right results
```
{-# LANGUAGE GHC_CPP #-}
module Example1 where
y = 3
x =
"hello"
"bye now"
foo = putStrLn x
```
- - - - -
7b56ff52 by Alan Zimmerman at 2025-04-27T09:44:36+01:00
Rebase, and all tests pass except whitespace for generated parser
- - - - -
0be8ae74 by Alan Zimmerman at 2025-04-27T09:44:36+01:00
More plumbing. Ready for testing tomorrow.
- - - - -
da4c51eb by Alan Zimmerman at 2025-04-27T09:44:36+01:00
Proress. Renamed module State from Types
And at first blush it seems to handle preprocessor scopes properly.
- - - - -
22065fab by Alan Zimmerman at 2025-04-27T09:45:37+01:00
Insert basic GHC version macros into parser
__GLASGOW_HASKELL__
__GLASGOW_HASKELL_FULL_VERSION__
__GLASGOW_HASKELL_PATCHLEVEL1__
__GLASGOW_HASKELL_PATCHLEVEL2__
- - - - -
fc538156 by Alan Zimmerman at 2025-04-27T09:45:43+01:00
Re-sync check-cpp for easy ghci work
- - - - -
6f4b8e0a by Alan Zimmerman at 2025-04-27T09:45:43+01:00
Get rid of warnings
- - - - -
e8a868b4 by Alan Zimmerman at 2025-04-27T09:45:43+01:00
Rework macro processing, in check-cpp
Macros kept at the top level, looked up via name, multiple arity
versions per name can be stored
- - - - -
da7b4bd7 by Alan Zimmerman at 2025-04-27T09:45:43+01:00
WIP. Can crack arguments for #define
Next step it to crack out args in an expansion
- - - - -
2cb5187f by Alan Zimmerman at 2025-04-27T09:45:43+01:00
WIP on arg parsing.
- - - - -
fd6219ba by Alan Zimmerman at 2025-04-27T09:45:43+01:00
Progress. Still screwing up nested parens.
- - - - -
a185cf05 by Alan Zimmerman at 2025-04-27T09:45:43+01:00
Seems to work, but has redundant code
- - - - -
add511d8 by Alan Zimmerman at 2025-04-27T09:45:43+01:00
Remove redundant code
- - - - -
92e3fb7b by Alan Zimmerman at 2025-04-27T09:45:44+01:00
Reformat
- - - - -
053762fa by Alan Zimmerman at 2025-04-27T09:45:44+01:00
Expand args, single pass
Still need to repeat until fixpoint
- - - - -
d6ba6e1c by Alan Zimmerman at 2025-04-27T09:45:44+01:00
Fixed point expansion
- - - - -
998a3449 by Alan Zimmerman at 2025-04-27T09:45:44+01:00
Sync the playground to compiler
- - - - -
49229bdb by Alan Zimmerman at 2025-04-27T09:45:44+01:00
Working on dumping the GHC_CPP result
But We need to keep the BufSpan in a comment
- - - - -
4af70371 by Alan Zimmerman at 2025-04-27T09:45:44+01:00
Keep BufSpan in queued comments in GHC.Parser.Lexer
- - - - -
74c76e32 by Alan Zimmerman at 2025-04-27T09:45:44+01:00
Getting close to being able to print the combined tokens
showing what is in and what is out
- - - - -
73131f6b by Alan Zimmerman at 2025-04-27T09:45:44+01:00
First implementation of dumpGhcCpp.
Example output
First dumps all macros in the state, then the source, showing which
lines are in and which are out
------------------------------
- |#define FOO(A,B) A + B
- |#define FOO(A,B,C) A + B + C
- |#if FOO(1,FOO(3,4)) == 8
- |-- a comment
|x = 1
- |#else
- |x = 5
- |#endif
- - - - -
6486091b by Alan Zimmerman at 2025-04-27T09:45:44+01:00
Clean up a bit
- - - - -
0e0b1812 by Alan Zimmerman at 2025-04-27T09:45:44+01:00
Add -ddump-ghc-cpp option and a test based on it
- - - - -
e6567926 by Alan Zimmerman at 2025-04-27T09:45:44+01:00
Restore Lexer.x rules, we need them for continuation lines
- - - - -
39204055 by Alan Zimmerman at 2025-04-27T09:45:44+01:00
Lexer.x: trying to sort out the span for continuations
- We need to match on \n at the end of the line
- We cannot simply back up for it
- - - - -
ee2ff3f9 by Alan Zimmerman at 2025-04-27T09:46:38+01:00
Inserts predefined macros. But does not dump properly
Because the cpp tokens have a trailing newline
- - - - -
112c7c67 by Alan Zimmerman at 2025-04-27T09:46:40+01:00
Remove unnecessary LExer rules
We *need* the ones that explicitly match to the end of the line.
- - - - -
ed24feed by Alan Zimmerman at 2025-04-27T09:46:40+01:00
Generate correct span for ITcpp
Dump now works, except we do not render trailing `\` for continuation
lines. This is good enough for use in test output.
- - - - -
7f963a43 by Alan Zimmerman at 2025-04-27T09:46:40+01:00
Reduce duplication in lexer
- - - - -
8d543de7 by Alan Zimmerman at 2025-04-27T09:46:40+01:00
Tweaks
- - - - -
aaa0c03e by Alan Zimmerman at 2025-04-27T09:46:40+01:00
Insert min_version predefined macros into state
The mechanism now works. Still need to flesh out the full set.
- - - - -
06342391 by Alan Zimmerman at 2025-04-27T09:46:40+01:00
Trying my alternative pragma syntax.
It works, but dumpGhcCpp is broken, I suspect from the ITcpp token
span update.
- - - - -
0e507bdb by Alan Zimmerman at 2025-04-27T09:46:40+01:00
Pragma extraction now works, with both CPP and GHC_CPP
For the following
{-# LANGUAGE CPP #-}
#if __GLASGOW_HASKELL__ >= 913
{-# LANGUAGE GHC_CPP #-}
#endif
We will enable GHC_CPP only
- - - - -
057bdfdb by Alan Zimmerman at 2025-04-27T09:46:40+01:00
Remove some tracing
- - - - -
d1c11ee8 by Alan Zimmerman at 2025-04-27T09:46:40+01:00
Fix test exes for changes
- - - - -
36192a2e by Alan Zimmerman at 2025-04-27T09:46:40+01:00
For GHC_CPP tests, normalise config-time-based macros
- - - - -
1570daca by Alan Zimmerman at 2025-04-27T09:46:40+01:00
WIP
- - - - -
72a9d4de by Alan Zimmerman at 2025-04-27T09:46:40+01:00
WIP again. What is wrong?
- - - - -
f6f73963 by Alan Zimmerman at 2025-04-27T09:46:40+01:00
Revert to dynflags for normal not pragma lexing
- - - - -
ddabab27 by Alan Zimmerman at 2025-04-27T09:46:41+01:00
Working on getting check-exact to work properly
- - - - -
db52fe62 by Alan Zimmerman at 2025-04-27T09:46:41+01:00
Passes CppCommentPlacement test
- - - - -
d4f4516c by Alan Zimmerman at 2025-04-27T09:46:41+01:00
Starting on exact printing with GHC_CPP
While overriding normal CPP
- - - - -
e60c902c by Alan Zimmerman at 2025-04-27T09:46:41+01:00
Correctly store CPP ignored tokens as comments
By populating the lexeme string in it, based on the bufpos
- - - - -
b89da516 by Alan Zimmerman at 2025-04-27T09:46:41+01:00
WIP
- - - - -
6cb6e97a by Alan Zimmerman at 2025-04-27T09:46:41+01:00
Simplifying
- - - - -
8c4cfec3 by Alan Zimmerman at 2025-04-27T09:46:41+01:00
Update the active state logic
- - - - -
b43896b3 by Alan Zimmerman at 2025-04-27T09:46:41+01:00
Work the new logic into the mainline code
- - - - -
1e38cea0 by Alan Zimmerman at 2025-04-27T09:46:41+01:00
Process `defined` operator
- - - - -
3ff7742a by Alan Zimmerman at 2025-04-27T09:46:41+01:00
Manage lexer state while skipping tokens
There is very intricate layout-related state used when lexing. If a
CPP directive blanks out some tokens, store this state when the
blanking starts, and restore it when they are no longer being blanked.
- - - - -
1f895269 by Alan Zimmerman at 2025-04-27T09:46:41+01:00
Track the last token buffer index, for ITCppIgnored
We need to attach the source being skipped in an ITCppIgnored token.
We cannot simply use its BufSpan as an index into the underlying
StringBuffer as it counts unicode chars, not bytes.
So we update the lexer state to store the starting StringBuffer
location for the last token, and use the already-stored length to
extract the correct portion of the StringBuffer being parsed.
- - - - -
99a485e0 by Alan Zimmerman at 2025-04-27T09:46:41+01:00
Process the ! operator in GHC_CPP expressions
- - - - -
2ea031c9 by Alan Zimmerman at 2025-04-27T09:46:41+01:00
Predefine a constant when GHC_CPP is being used.
- - - - -
6dd75f13 by Alan Zimmerman at 2025-04-27T09:46:41+01:00
WIP
- - - - -
55e84bc4 by Alan Zimmerman at 2025-04-27T09:46:41+01:00
Skip lines directly in the lexer when required
- - - - -
0d7ece26 by Alan Zimmerman at 2025-04-27T09:46:41+01:00
Properly manage location when accepting tokens again
- - - - -
bb5d5425 by Alan Zimmerman at 2025-04-27T09:46:41+01:00
Seems to be working now, for Example9
- - - - -
21dfdb8c by Alan Zimmerman at 2025-04-27T09:46:41+01:00
Remove tracing
- - - - -
33df63ea by Alan Zimmerman at 2025-04-27T09:46:41+01:00
Fix parsing '*' in block comments
Instead of replacing them with '-'
- - - - -
2348cf1d by Alan Zimmerman at 2025-04-27T09:46:41+01:00
Keep the trailing backslash in a ITcpp token
- - - - -
0e6359a2 by Alan Zimmerman at 2025-04-27T09:46:41+01:00
Deal with only enabling one section of a group.
A group is an instance of a conditional introduced by
#if/#ifdef/#ifndef,
and ending at the final #endif, including intermediate #elsif sections
- - - - -
03135712 by Alan Zimmerman at 2025-04-27T09:46:41+01:00
Replace remaining identifiers with 0 when evaluating
As per the spec
- - - - -
e7598666 by Alan Zimmerman at 2025-04-27T09:46:41+01:00
Snapshot before rebase
- - - - -
e6403756 by Alan Zimmerman at 2025-04-27T09:46:41+01:00
Skip non-processed lines starting with #
- - - - -
e397240c by Alan Zimmerman at 2025-04-27T09:46:41+01:00
Export generateMacros so we can use it in ghc-exactprint
- - - - -
4d68adb0 by Alan Zimmerman at 2025-04-27T09:46:41+01:00
Fix rebase
- - - - -
5ab88d91 by Alan Zimmerman at 2025-04-27T09:46:41+01:00
Expose initParserStateWithMacrosString
- - - - -
59cb7936 by Alan Zimmerman at 2025-04-27T09:46:41+01:00
Fix buggy lexer cppSkip
It was skipping all lines, not just ones prefixed by #
- - - - -
cc59ad68 by Alan Zimmerman at 2025-04-27T09:46:41+01:00
Fix evaluation of && to use the correct operator
- - - - -
3286f84a by Alan Zimmerman at 2025-04-27T09:46:41+01:00
Deal with closing #-} at the start of a line
- - - - -
1ce0abad by Alan Zimmerman at 2025-04-27T09:46:41+01:00
Add the MIN_VERSION_GLASGOW_HASKELL predefined macro
- - - - -
a15043e4 by Alan Zimmerman at 2025-04-27T09:46:41+01:00
Include MIN_VERSION_GLASGOW_HASKELL in GhcCpp01.stderr
- - - - -
a44dbcaa by Alan Zimmerman at 2025-04-27T09:46:41+01:00
Use a strict map for macro defines
- - - - -
22aa503a by Alan Zimmerman at 2025-04-27T09:46:41+01:00
Process TIdentifierLParen
Which only matters at the start of #define
- - - - -
a27faeab by Alan Zimmerman at 2025-04-27T09:46:41+01:00
Do not provide TIdentifierLParen paren twice
- - - - -
8e22cba6 by Alan Zimmerman at 2025-04-27T09:46:41+01:00
Handle whitespace between identifier and '(' for directive only
- - - - -
9bc48c1e by Alan Zimmerman at 2025-04-27T09:46:41+01:00
Expose some Lexer bitmap manipulation helpers
- - - - -
236800a6 by Alan Zimmerman at 2025-04-27T09:46:41+01:00
Deal with line pragmas as tokens
Blows up for dumpGhcCpp though
- - - - -
8f6ebfc0 by Alan Zimmerman at 2025-04-27T09:46:41+01:00
Allow strings delimited by a single quote too
- - - - -
9dbc3f96 by Alan Zimmerman at 2025-04-27T10:51:22+01:00
Allow leading whitespace on cpp directives
As per https://timsong-cpp.github.io/cppwp/n4140/cpp#1
- - - - -
329 changed files:
- compiler/GHC.hs
- compiler/GHC/Cmm/Lexer.x
- compiler/GHC/Cmm/Parser.y
- compiler/GHC/Cmm/Parser/Monad.hs
- compiler/GHC/Data/Graph/Directed/Reachability.hs
- compiler/GHC/Driver/Backpack.hs
- compiler/GHC/Driver/Config/Parser.hs
- compiler/GHC/Driver/Downsweep.hs
- compiler/GHC/Driver/DynFlags.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/Main.hs
- compiler/GHC/Driver/Make.hs
- compiler/GHC/Driver/MakeFile.hs
- compiler/GHC/Driver/Pipeline.hs
- compiler/GHC/Driver/Pipeline/Execute.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Hs/ImpExp.hs
- compiler/GHC/Iface/Recomp.hs
- compiler/GHC/Iface/Tidy.hs
- compiler/GHC/Parser.hs-boot
- compiler/GHC/Parser.y
- compiler/GHC/Parser/Annotation.hs
- compiler/GHC/Parser/Errors/Ppr.hs
- compiler/GHC/Parser/Errors/Types.hs
- compiler/GHC/Parser/HaddockLex.x
- compiler/GHC/Parser/Header.hs
- compiler/GHC/Parser/Lexer.x
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Parser/PostProcess/Haddock.hs
- + compiler/GHC/Parser/PreProcess.hs
- + compiler/GHC/Parser/PreProcess/Eval.hs
- + compiler/GHC/Parser/PreProcess/Lexer.x
- + compiler/GHC/Parser/PreProcess/Macro.hs
- + compiler/GHC/Parser/PreProcess/ParsePP.hs
- + compiler/GHC/Parser/PreProcess/Parser.y
- + compiler/GHC/Parser/PreProcess/ParserM.hs
- + compiler/GHC/Parser/PreProcess/State.hs
- compiler/GHC/Parser/Utils.hs
- compiler/GHC/Rename/Env.hs
- compiler/GHC/Rename/Expr.hs
- compiler/GHC/Rename/Module.hs
- compiler/GHC/Rename/Names.hs
- compiler/GHC/Rename/Splice.hs
- compiler/GHC/Rename/Utils.hs
- compiler/GHC/Runtime/Loader.hs
- compiler/GHC/SysTools/Cpp.hs
- compiler/GHC/Tc/Deriv/Generate.hs
- compiler/GHC/Tc/Deriv/Utils.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Gen/App.hs
- compiler/GHC/Tc/Gen/Head.hs
- compiler/GHC/Tc/Gen/Pat.hs
- compiler/GHC/Tc/Gen/Splice.hs
- compiler/GHC/Tc/Module.hs
- compiler/GHC/Tc/Plugin.hs
- compiler/GHC/Tc/Solver/Dict.hs
- compiler/GHC/Tc/Solver/Monad.hs
- compiler/GHC/Tc/TyCl/Instance.hs
- compiler/GHC/Tc/Types.hs
- compiler/GHC/Tc/Types/LclEnv.hs
- compiler/GHC/Tc/Types/Origin.hs
- compiler/GHC/Tc/Types/TH.hs
- compiler/GHC/Tc/Utils/Backpack.hs
- compiler/GHC/Tc/Utils/Concrete.hs
- compiler/GHC/Tc/Utils/Env.hs
- compiler/GHC/Tc/Utils/Monad.hs
- compiler/GHC/Tc/Utils/TcMType.hs
- compiler/GHC/Types/Basic.hs
- compiler/GHC/Types/Error/Codes.hs
- compiler/GHC/Types/Name/Reader.hs
- + compiler/GHC/Types/ThLevelIndex.hs
- compiler/GHC/Unit/Home/PackageTable.hs
- compiler/GHC/Unit/Module/Deps.hs
- compiler/GHC/Unit/Module/Graph.hs
- compiler/GHC/Unit/Module/Imported.hs
- compiler/GHC/Unit/Module/ModSummary.hs
- + compiler/GHC/Unit/Module/Stage.hs
- compiler/GHC/Unit/Types.hs
- compiler/GHC/Utils/Binary.hs
- compiler/GHC/Utils/Outputable.hs
- compiler/GHC/Utils/Panic/Plain.hs
- compiler/Language/Haskell/Syntax/ImpExp.hs
- + compiler/Language/Haskell/Syntax/ImpExp/IsBoot.hs
- compiler/ghc.cabal.in
- docs/users_guide/debugging.rst
- docs/users_guide/exts/control.rst
- docs/users_guide/exts/template_haskell.rst
- docs/users_guide/javascript.rst
- docs/users_guide/phases.rst
- docs/users_guide/using-warnings.rst
- ghc/GHCi/UI.hs
- hadrian/src/Rules/SourceDist.hs
- hadrian/stack.yaml.lock
- libraries/base/tests/IO/Makefile
- libraries/ghc-internal/src/GHC/Internal/LanguageExtensions.hs
- testsuite/tests/ado/ado004.stderr
- testsuite/tests/annotations/should_fail/annfail03.stderr
- testsuite/tests/annotations/should_fail/annfail04.stderr
- testsuite/tests/annotations/should_fail/annfail06.stderr
- testsuite/tests/annotations/should_fail/annfail09.stderr
- testsuite/tests/count-deps/CountDepsAst.stdout
- testsuite/tests/count-deps/CountDepsParser.stdout
- testsuite/tests/dependent/should_compile/T14729.stderr
- testsuite/tests/dependent/should_compile/T15743.stderr
- testsuite/tests/dependent/should_compile/T15743e.stderr
- testsuite/tests/deriving/should_compile/T14682.stderr
- testsuite/tests/determinism/determ021/determ021.stdout
- testsuite/tests/driver/T4437.hs
- + testsuite/tests/driver/T4437.stdout
- testsuite/tests/driver/json2.stderr
- testsuite/tests/gadt/T19847a.stderr
- testsuite/tests/ghc-api/T11579.hs
- testsuite/tests/ghc-api/fixed-nodes/FixedNodes.hs
- testsuite/tests/ghc-api/fixed-nodes/ModuleGraphInvariants.hs
- + testsuite/tests/ghc-cpp/GhcCpp01.hs
- + testsuite/tests/ghc-cpp/GhcCpp01.stderr
- + testsuite/tests/ghc-cpp/all.T
- testsuite/tests/indexed-types/should_compile/T15711.stderr
- testsuite/tests/indexed-types/should_compile/T15852.stderr
- testsuite/tests/indexed-types/should_compile/T3017.stderr
- testsuite/tests/interface-stability/template-haskell-exports.stdout
- testsuite/tests/module/mod185.stderr
- testsuite/tests/parser/should_compile/DumpParsedAst.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/partial-sigs/should_compile/ADT.stderr
- testsuite/tests/partial-sigs/should_compile/AddAndOr1.stderr
- testsuite/tests/partial-sigs/should_compile/AddAndOr2.stderr
- testsuite/tests/partial-sigs/should_compile/AddAndOr3.stderr
- testsuite/tests/partial-sigs/should_compile/AddAndOr4.stderr
- testsuite/tests/partial-sigs/should_compile/AddAndOr5.stderr
- testsuite/tests/partial-sigs/should_compile/AddAndOr6.stderr
- testsuite/tests/partial-sigs/should_compile/BoolToBool.stderr
- testsuite/tests/partial-sigs/should_compile/DataFamilyInstanceLHS.stderr
- testsuite/tests/partial-sigs/should_compile/Defaulting1MROn.stderr
- testsuite/tests/partial-sigs/should_compile/Defaulting2MROff.stderr
- testsuite/tests/partial-sigs/should_compile/Defaulting2MROn.stderr
- testsuite/tests/partial-sigs/should_compile/Either.stderr
- testsuite/tests/partial-sigs/should_compile/EqualityConstraint.stderr
- testsuite/tests/partial-sigs/should_compile/Every.stderr
- testsuite/tests/partial-sigs/should_compile/EveryNamed.stderr
- testsuite/tests/partial-sigs/should_compile/ExpressionSig.stderr
- testsuite/tests/partial-sigs/should_compile/ExpressionSigNamed.stderr
- testsuite/tests/partial-sigs/should_compile/ExtraConstraints1.stderr
- testsuite/tests/partial-sigs/should_compile/ExtraConstraints2.stderr
- testsuite/tests/partial-sigs/should_compile/ExtraConstraints3.stderr
- testsuite/tests/partial-sigs/should_compile/ExtraNumAMROff.stderr
- testsuite/tests/partial-sigs/should_compile/ExtraNumAMROn.stderr
- testsuite/tests/partial-sigs/should_compile/Forall1.stderr
- testsuite/tests/partial-sigs/should_compile/GenNamed.stderr
- testsuite/tests/partial-sigs/should_compile/HigherRank1.stderr
- testsuite/tests/partial-sigs/should_compile/HigherRank2.stderr
- testsuite/tests/partial-sigs/should_compile/LocalDefinitionBug.stderr
- testsuite/tests/partial-sigs/should_compile/Meltdown.stderr
- testsuite/tests/partial-sigs/should_compile/MonoLocalBinds.stderr
- testsuite/tests/partial-sigs/should_compile/NamedTyVar.stderr
- testsuite/tests/partial-sigs/should_compile/NamedWildcardInDataFamilyInstanceLHS.stderr
- testsuite/tests/partial-sigs/should_compile/NamedWildcardInTypeFamilyInstanceLHS.stderr
- testsuite/tests/partial-sigs/should_compile/ParensAroundContext.stderr
- testsuite/tests/partial-sigs/should_compile/PatBind.stderr
- testsuite/tests/partial-sigs/should_compile/PatBind2.stderr
- testsuite/tests/partial-sigs/should_compile/PatternSig.stderr
- testsuite/tests/partial-sigs/should_compile/Recursive.stderr
- testsuite/tests/partial-sigs/should_compile/ScopedNamedWildcards.stderr
- testsuite/tests/partial-sigs/should_compile/ScopedNamedWildcardsGood.stderr
- testsuite/tests/partial-sigs/should_compile/ShowNamed.stderr
- testsuite/tests/partial-sigs/should_compile/SimpleGen.stderr
- testsuite/tests/partial-sigs/should_compile/SkipMany.stderr
- testsuite/tests/partial-sigs/should_compile/SomethingShowable.stderr
- testsuite/tests/partial-sigs/should_compile/TypeFamilyInstanceLHS.stderr
- testsuite/tests/partial-sigs/should_compile/Uncurry.stderr
- testsuite/tests/partial-sigs/should_compile/UncurryNamed.stderr
- testsuite/tests/partial-sigs/should_compile/WarningWildcardInstantiations.stderr
- testsuite/tests/polykinds/T15592.stderr
- testsuite/tests/polykinds/T15592b.stderr
- + testsuite/tests/printer/CppCommentPlacement.hs
- testsuite/tests/printer/T18052a.stderr
- testsuite/tests/quasiquotation/qq001/qq001.stderr
- testsuite/tests/quasiquotation/qq002/qq002.stderr
- testsuite/tests/quasiquotation/qq003/qq003.stderr
- testsuite/tests/quasiquotation/qq004/qq004.stderr
- + testsuite/tests/quotes/T5721.stderr
- testsuite/tests/roles/should_compile/Roles1.stderr
- testsuite/tests/roles/should_compile/Roles14.stderr
- testsuite/tests/roles/should_compile/Roles2.stderr
- testsuite/tests/roles/should_compile/Roles3.stderr
- testsuite/tests/roles/should_compile/Roles4.stderr
- testsuite/tests/roles/should_compile/T8958.stderr
- testsuite/tests/showIface/DocsInHiFile1.stdout
- testsuite/tests/showIface/DocsInHiFileTH.stdout
- testsuite/tests/showIface/HaddockIssue849.stdout
- testsuite/tests/showIface/HaddockOpts.stdout
- testsuite/tests/showIface/HaddockSpanIssueT24378.stdout
- testsuite/tests/showIface/LanguageExts.stdout
- testsuite/tests/showIface/MagicHashInHaddocks.stdout
- testsuite/tests/showIface/NoExportList.stdout
- testsuite/tests/showIface/PragmaDocs.stdout
- testsuite/tests/showIface/ReExports.stdout
- + testsuite/tests/splice-imports/ClassA.hs
- + testsuite/tests/splice-imports/InstanceA.hs
- + testsuite/tests/splice-imports/Makefile
- + testsuite/tests/splice-imports/SI01.hs
- + testsuite/tests/splice-imports/SI01A.hs
- + testsuite/tests/splice-imports/SI02.hs
- + testsuite/tests/splice-imports/SI03.hs
- + testsuite/tests/splice-imports/SI03.stderr
- + testsuite/tests/splice-imports/SI04.hs
- + testsuite/tests/splice-imports/SI05.hs
- + testsuite/tests/splice-imports/SI05.stderr
- + testsuite/tests/splice-imports/SI05A.hs
- + testsuite/tests/splice-imports/SI06.hs
- + testsuite/tests/splice-imports/SI07.hs
- + testsuite/tests/splice-imports/SI07.stderr
- + testsuite/tests/splice-imports/SI07A.hs
- + testsuite/tests/splice-imports/SI08.hs
- + testsuite/tests/splice-imports/SI08.stderr
- + testsuite/tests/splice-imports/SI08_oneshot.stderr
- + testsuite/tests/splice-imports/SI09.hs
- + testsuite/tests/splice-imports/SI10.hs
- + testsuite/tests/splice-imports/SI13.hs
- + testsuite/tests/splice-imports/SI14.hs
- + testsuite/tests/splice-imports/SI14.stderr
- + testsuite/tests/splice-imports/SI15.hs
- + testsuite/tests/splice-imports/SI15.stderr
- + testsuite/tests/splice-imports/SI16.hs
- + testsuite/tests/splice-imports/SI16.stderr
- + testsuite/tests/splice-imports/SI17.hs
- + testsuite/tests/splice-imports/SI18.hs
- + testsuite/tests/splice-imports/SI18.stderr
- + testsuite/tests/splice-imports/SI19.hs
- + testsuite/tests/splice-imports/SI19A.hs
- + testsuite/tests/splice-imports/SI20.hs
- + testsuite/tests/splice-imports/SI20.stderr
- + testsuite/tests/splice-imports/SI21.hs
- + testsuite/tests/splice-imports/SI21.stderr
- + testsuite/tests/splice-imports/SI22.hs
- + testsuite/tests/splice-imports/SI22.stderr
- + testsuite/tests/splice-imports/SI23.hs
- + testsuite/tests/splice-imports/SI23A.hs
- + testsuite/tests/splice-imports/SI24.hs
- + testsuite/tests/splice-imports/SI25.hs
- + testsuite/tests/splice-imports/SI25.stderr
- + testsuite/tests/splice-imports/SI25Helper.hs
- + testsuite/tests/splice-imports/SI26.hs
- + testsuite/tests/splice-imports/SI27.hs
- + testsuite/tests/splice-imports/SI27.stderr
- + testsuite/tests/splice-imports/SI28.hs
- + testsuite/tests/splice-imports/SI28.stderr
- + testsuite/tests/splice-imports/SI29.hs
- + testsuite/tests/splice-imports/SI29.stderr
- + testsuite/tests/splice-imports/SI30.script
- + testsuite/tests/splice-imports/SI30.stdout
- + testsuite/tests/splice-imports/SI31.script
- + testsuite/tests/splice-imports/SI31.stderr
- + testsuite/tests/splice-imports/SI32.script
- + testsuite/tests/splice-imports/SI32.stdout
- + testsuite/tests/splice-imports/SI33.script
- + testsuite/tests/splice-imports/SI33.stdout
- + testsuite/tests/splice-imports/SI34.hs
- + testsuite/tests/splice-imports/SI34.stderr
- + testsuite/tests/splice-imports/SI34M1.hs
- + testsuite/tests/splice-imports/SI34M2.hs
- + testsuite/tests/splice-imports/SI35.hs
- + testsuite/tests/splice-imports/SI35A.hs
- + testsuite/tests/splice-imports/SI36.hs
- + testsuite/tests/splice-imports/SI36.stderr
- + testsuite/tests/splice-imports/SI36_A.hs
- + testsuite/tests/splice-imports/SI36_B1.hs
- + testsuite/tests/splice-imports/SI36_B2.hs
- + testsuite/tests/splice-imports/SI36_B3.hs
- + testsuite/tests/splice-imports/SI36_C1.hs
- + testsuite/tests/splice-imports/SI36_C2.hs
- + testsuite/tests/splice-imports/SI36_C3.hs
- + testsuite/tests/splice-imports/all.T
- testsuite/tests/th/T16976z.stderr
- testsuite/tests/th/T17820a.stderr
- testsuite/tests/th/T17820b.stderr
- testsuite/tests/th/T17820c.stderr
- testsuite/tests/th/T17820d.stderr
- testsuite/tests/th/T17820e.stderr
- testsuite/tests/th/T21547.stderr
- testsuite/tests/th/T23829_hasty.stderr
- testsuite/tests/th/T23829_hasty_b.stderr
- testsuite/tests/th/T23829_tardy.ghc.stderr
- testsuite/tests/th/T5795.stderr
- testsuite/tests/th/TH_Roles2.stderr
- testsuite/tests/typecheck/should_compile/T12763.stderr
- testsuite/tests/typecheck/should_compile/T18406b.stderr
- testsuite/tests/typecheck/should_compile/T18529.stderr
- testsuite/tests/typecheck/should_compile/T21023.stderr
- + utils/check-cpp/.ghci
- + utils/check-cpp/.gitignore
- + utils/check-cpp/Eval.hs
- + utils/check-cpp/Example1.hs
- + utils/check-cpp/Example10.hs
- + utils/check-cpp/Example11.hs
- + utils/check-cpp/Example12.hs
- + utils/check-cpp/Example13.hs
- + utils/check-cpp/Example2.hs
- + utils/check-cpp/Example3.hs
- + utils/check-cpp/Example4.hs
- + utils/check-cpp/Example5.hs
- + utils/check-cpp/Example6.hs
- + utils/check-cpp/Example7.hs
- + utils/check-cpp/Example8.hs
- + utils/check-cpp/Example9.hs
- + utils/check-cpp/Lexer.x
- + utils/check-cpp/Macro.hs
- + utils/check-cpp/Main.hs
- + utils/check-cpp/ParsePP.hs
- + utils/check-cpp/ParseSimulate.hs
- + utils/check-cpp/Parser.y
- + utils/check-cpp/ParserM.hs
- + utils/check-cpp/PreProcess.hs
- + utils/check-cpp/README.md
- + utils/check-cpp/State.hs
- + utils/check-cpp/run.sh
- utils/check-exact/ExactPrint.hs
- utils/check-exact/Main.hs
- utils/check-exact/Parsers.hs
- utils/check-exact/Preprocess.hs
- utils/check-exact/Utils.hs
- utils/count-deps/Main.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs
- utils/haddock/haddock-api/src/Haddock/Parser.hs
- utils/haddock/haddock-api/src/Haddock/Types.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/cb0c0ee9f65ab237270ba9c9997907…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/cb0c0ee9f65ab237270ba9c9997907…
You're receiving this email because of your account on gitlab.haskell.org.
1
0

[Git][ghc/ghc][master] Get a decent MatchContext for pattern synonym bindings
by Marge Bot (@marge-bot) 26 Apr '25
by Marge Bot (@marge-bot) 26 Apr '25
26 Apr '25
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
7641a74a by Simon Peyton Jones at 2025-04-26T22:05:19-04:00
Get a decent MatchContext for pattern synonym bindings
In particular when we have a pattern binding
K p1 .. pn = rhs
where K is a pattern synonym. (It might be nested.)
This small MR fixes #25995. It's a tiny fix, to an error message,
removing an always-dubious `unkSkol`.
The bug report was in the context of horde-ad, a big program,
and I didn't manage to make a small repro case quickly. I decided
not to bother further.
- - - - -
1 changed file:
- compiler/GHC/Tc/Gen/Pat.hs
Changes:
=====================================
compiler/GHC/Tc/Gen/Pat.hs
=====================================
@@ -1265,9 +1265,10 @@ tcPatSynPat (L con_span con_name) pat_syn pat_ty penv arg_pats thing_inside
; let all_arg_tys = ty : prov_theta ++ (map scaledThing arg_tys)
; checkGADT (PatSynCon pat_syn) ex_tvs all_arg_tys penv
- ; skol_info <- case pe_ctxt penv of
- LamPat mc -> mkSkolemInfo (PatSkol (PatSynCon pat_syn) mc)
- LetPat {} -> return unkSkol -- Doesn't matter
+ ; let match_ctxt = case pe_ctxt penv of
+ LamPat mc -> mc
+ LetPat {} -> PatBindRhs
+ ; skol_info <- mkSkolemInfo (PatSkol (PatSynCon pat_syn) match_ctxt)
; (tenv, ex_tvs') <- tcInstSuperSkolTyVarsX skol_info subst ex_tvs
-- This freshens: Note [Freshen existentials]
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7641a74a21eb7fb6c60b0cd94fc5fd2…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7641a74a21eb7fb6c60b0cd94fc5fd2…
You're receiving this email because of your account on gitlab.haskell.org.
1
0

[Git][ghc/ghc][master] Implement Explicit Level Imports for Template Haskell
by Marge Bot (@marge-bot) 26 Apr '25
by Marge Bot (@marge-bot) 26 Apr '25
26 Apr '25
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
217caad1 by Matthew Pickering at 2025-04-25T18:58:42+01:00
Implement Explicit Level Imports for Template Haskell
This commit introduces the `ExplicitLevelImports` and
`ImplicitStagePersistence` language extensions as proposed in GHC
Proposal #682.
Key Features
------------
- `ExplicitLevelImports` adds two new import modifiers - `splice` and
`quote` - allowing precise control over the level at which imported
identifiers are available
- `ImplicitStagePersistence` (enabled by default) preserves existing
path-based cross-stage persistence behavior
- `NoImplicitStagePersistence` disables implicit cross-stage
persistence, requiring explicit level imports
Benefits
--------
- Improved compilation performance by reducing unnecessary code generation
- Enhanced IDE experience with faster feedback in `-fno-code` mode
- Better dependency tracking by distinguishing compile-time and runtime dependencies
- Foundation for future cross-compilation improvements
This implementation enables the separation of modules needed at
compile-time from those needed at runtime, allowing for more efficient
compilation pipelines and clearer code organization in projects using
Template Haskell.
Implementation Notes
--------------------
The level which a name is availble at is stored in the 'GRE', in the normal
GlobalRdrEnv. The function `greLevels` returns the levels which a specific GRE
is imported at. The level information for a 'Name' is computed by `getCurrentAndBindLevel`.
The level validity is checked by `checkCrossLevelLifting`.
Instances are checked by `checkWellLevelledDFun`, which computes the level an
instance by calling `checkWellLevelledInstanceWhat`, which sees what is
available at by looking at the module graph.
Modifications to downsweep
--------------------------
Code generation is now only enabled for modules which are needed at
compile time.
See the Note [-fno-code mode] for more information.
Uniform error messages for level errors
---------------------------------------
All error messages to do with levels are now reported uniformly using
the `TcRnBadlyStaged` constructor.
Error messages are uniformly reported in terms of levels.
0 - top-level
1 - quote level
-1 - splice level
The only level hard-coded into the compiler is the top-level in
GHC.Types.ThLevelIndex.topLevelIndex.
Uniformly refer to levels and stages
------------------------------------
There was much confusion about levels vs stages in the compiler.
A level is a semantic concept, used by the typechecker to ensure a
program can be evaluated in a well-staged manner.
A stage is an operational construct, program evaluation proceeds in
stages.
Deprecate -Wbadly-staged-types
------------------------------
`-Wbadly-staged-types` is deprecated in favour of `-Wbadly-levelled-types`.
Lift derivation changed
-----------------------
Derived lift instances will now not generate code with expression
quotations.
Before:
```
data A = A Int deriving Lift
=>
lift (A x) = [| A $(lift x) |]
```
After:
```
lift (A x) = conE 'A `appE` (lift x)
```
This is because if you attempt to derive `Lift` in a module where
`NoImplicitStagePersistence` is enabled, you would get an infinite loop
where a constructor was attempted to be persisted using the instance you
are currently defining.
GHC API Changes
---------------
The ModuleGraph now contains additional information about the type of
the edges (normal, quote or splice) between modules. This is abstracted
using the `ModuleGraphEdge` data type.
Fixes #25828
-------------------------
Metric Increase:
MultiLayerModulesTH_Make
-------------------------
- - - - -
265 changed files:
- compiler/GHC.hs
- compiler/GHC/Data/Graph/Directed/Reachability.hs
- compiler/GHC/Driver/Backpack.hs
- compiler/GHC/Driver/Downsweep.hs
- compiler/GHC/Driver/DynFlags.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/Make.hs
- compiler/GHC/Driver/MakeFile.hs
- compiler/GHC/Driver/Pipeline.hs
- compiler/GHC/Driver/Pipeline/Execute.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Hs/ImpExp.hs
- compiler/GHC/Iface/Recomp.hs
- compiler/GHC/Iface/Tidy.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/Errors/Ppr.hs
- compiler/GHC/Parser/Errors/Types.hs
- compiler/GHC/Parser/Header.hs
- compiler/GHC/Parser/Lexer.x
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Rename/Env.hs
- compiler/GHC/Rename/Expr.hs
- compiler/GHC/Rename/Module.hs
- compiler/GHC/Rename/Names.hs
- compiler/GHC/Rename/Splice.hs
- compiler/GHC/Rename/Utils.hs
- compiler/GHC/Runtime/Loader.hs
- compiler/GHC/Tc/Deriv/Generate.hs
- compiler/GHC/Tc/Deriv/Utils.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Gen/App.hs
- compiler/GHC/Tc/Gen/Head.hs
- compiler/GHC/Tc/Gen/Splice.hs
- compiler/GHC/Tc/Module.hs
- compiler/GHC/Tc/Plugin.hs
- compiler/GHC/Tc/Solver/Dict.hs
- compiler/GHC/Tc/Solver/Monad.hs
- compiler/GHC/Tc/TyCl/Instance.hs
- compiler/GHC/Tc/Types.hs
- compiler/GHC/Tc/Types/LclEnv.hs
- compiler/GHC/Tc/Types/Origin.hs
- compiler/GHC/Tc/Types/TH.hs
- compiler/GHC/Tc/Utils/Backpack.hs
- compiler/GHC/Tc/Utils/Concrete.hs
- compiler/GHC/Tc/Utils/Env.hs
- compiler/GHC/Tc/Utils/Monad.hs
- compiler/GHC/Tc/Utils/TcMType.hs
- compiler/GHC/Types/Basic.hs
- compiler/GHC/Types/Error/Codes.hs
- compiler/GHC/Types/Name/Reader.hs
- + compiler/GHC/Types/ThLevelIndex.hs
- compiler/GHC/Unit/Home/PackageTable.hs
- compiler/GHC/Unit/Module/Deps.hs
- compiler/GHC/Unit/Module/Graph.hs
- compiler/GHC/Unit/Module/Imported.hs
- compiler/GHC/Unit/Module/ModSummary.hs
- + compiler/GHC/Unit/Module/Stage.hs
- compiler/GHC/Unit/Types.hs
- compiler/GHC/Utils/Binary.hs
- compiler/GHC/Utils/Outputable.hs
- compiler/Language/Haskell/Syntax/ImpExp.hs
- + compiler/Language/Haskell/Syntax/ImpExp/IsBoot.hs
- compiler/ghc.cabal.in
- docs/users_guide/exts/control.rst
- docs/users_guide/exts/template_haskell.rst
- docs/users_guide/phases.rst
- docs/users_guide/using-warnings.rst
- ghc/GHCi/UI.hs
- libraries/base/tests/IO/Makefile
- libraries/ghc-internal/src/GHC/Internal/LanguageExtensions.hs
- testsuite/tests/ado/ado004.stderr
- testsuite/tests/annotations/should_fail/annfail03.stderr
- testsuite/tests/annotations/should_fail/annfail04.stderr
- testsuite/tests/annotations/should_fail/annfail06.stderr
- testsuite/tests/annotations/should_fail/annfail09.stderr
- testsuite/tests/count-deps/CountDepsAst.stdout
- testsuite/tests/count-deps/CountDepsParser.stdout
- testsuite/tests/dependent/should_compile/T14729.stderr
- testsuite/tests/dependent/should_compile/T15743.stderr
- testsuite/tests/dependent/should_compile/T15743e.stderr
- testsuite/tests/deriving/should_compile/T14682.stderr
- testsuite/tests/determinism/determ021/determ021.stdout
- + testsuite/tests/driver/T4437.stdout
- testsuite/tests/driver/json2.stderr
- testsuite/tests/gadt/T19847a.stderr
- testsuite/tests/ghc-api/fixed-nodes/FixedNodes.hs
- testsuite/tests/ghc-api/fixed-nodes/ModuleGraphInvariants.hs
- testsuite/tests/indexed-types/should_compile/T15711.stderr
- testsuite/tests/indexed-types/should_compile/T15852.stderr
- testsuite/tests/indexed-types/should_compile/T3017.stderr
- testsuite/tests/interface-stability/template-haskell-exports.stdout
- testsuite/tests/module/mod185.stderr
- testsuite/tests/parser/should_compile/DumpParsedAst.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/partial-sigs/should_compile/ADT.stderr
- testsuite/tests/partial-sigs/should_compile/AddAndOr1.stderr
- testsuite/tests/partial-sigs/should_compile/AddAndOr2.stderr
- testsuite/tests/partial-sigs/should_compile/AddAndOr3.stderr
- testsuite/tests/partial-sigs/should_compile/AddAndOr4.stderr
- testsuite/tests/partial-sigs/should_compile/AddAndOr5.stderr
- testsuite/tests/partial-sigs/should_compile/AddAndOr6.stderr
- testsuite/tests/partial-sigs/should_compile/BoolToBool.stderr
- testsuite/tests/partial-sigs/should_compile/DataFamilyInstanceLHS.stderr
- testsuite/tests/partial-sigs/should_compile/Defaulting1MROn.stderr
- testsuite/tests/partial-sigs/should_compile/Defaulting2MROff.stderr
- testsuite/tests/partial-sigs/should_compile/Defaulting2MROn.stderr
- testsuite/tests/partial-sigs/should_compile/Either.stderr
- testsuite/tests/partial-sigs/should_compile/EqualityConstraint.stderr
- testsuite/tests/partial-sigs/should_compile/Every.stderr
- testsuite/tests/partial-sigs/should_compile/EveryNamed.stderr
- testsuite/tests/partial-sigs/should_compile/ExpressionSig.stderr
- testsuite/tests/partial-sigs/should_compile/ExpressionSigNamed.stderr
- testsuite/tests/partial-sigs/should_compile/ExtraConstraints1.stderr
- testsuite/tests/partial-sigs/should_compile/ExtraConstraints2.stderr
- testsuite/tests/partial-sigs/should_compile/ExtraConstraints3.stderr
- testsuite/tests/partial-sigs/should_compile/ExtraNumAMROff.stderr
- testsuite/tests/partial-sigs/should_compile/ExtraNumAMROn.stderr
- testsuite/tests/partial-sigs/should_compile/Forall1.stderr
- testsuite/tests/partial-sigs/should_compile/GenNamed.stderr
- testsuite/tests/partial-sigs/should_compile/HigherRank1.stderr
- testsuite/tests/partial-sigs/should_compile/HigherRank2.stderr
- testsuite/tests/partial-sigs/should_compile/LocalDefinitionBug.stderr
- testsuite/tests/partial-sigs/should_compile/Meltdown.stderr
- testsuite/tests/partial-sigs/should_compile/MonoLocalBinds.stderr
- testsuite/tests/partial-sigs/should_compile/NamedTyVar.stderr
- testsuite/tests/partial-sigs/should_compile/NamedWildcardInDataFamilyInstanceLHS.stderr
- testsuite/tests/partial-sigs/should_compile/NamedWildcardInTypeFamilyInstanceLHS.stderr
- testsuite/tests/partial-sigs/should_compile/ParensAroundContext.stderr
- testsuite/tests/partial-sigs/should_compile/PatBind.stderr
- testsuite/tests/partial-sigs/should_compile/PatBind2.stderr
- testsuite/tests/partial-sigs/should_compile/PatternSig.stderr
- testsuite/tests/partial-sigs/should_compile/Recursive.stderr
- testsuite/tests/partial-sigs/should_compile/ScopedNamedWildcards.stderr
- testsuite/tests/partial-sigs/should_compile/ScopedNamedWildcardsGood.stderr
- testsuite/tests/partial-sigs/should_compile/ShowNamed.stderr
- testsuite/tests/partial-sigs/should_compile/SimpleGen.stderr
- testsuite/tests/partial-sigs/should_compile/SkipMany.stderr
- testsuite/tests/partial-sigs/should_compile/SomethingShowable.stderr
- testsuite/tests/partial-sigs/should_compile/TypeFamilyInstanceLHS.stderr
- testsuite/tests/partial-sigs/should_compile/Uncurry.stderr
- testsuite/tests/partial-sigs/should_compile/UncurryNamed.stderr
- testsuite/tests/partial-sigs/should_compile/WarningWildcardInstantiations.stderr
- testsuite/tests/polykinds/T15592.stderr
- testsuite/tests/polykinds/T15592b.stderr
- testsuite/tests/printer/T18052a.stderr
- testsuite/tests/quasiquotation/qq001/qq001.stderr
- testsuite/tests/quasiquotation/qq002/qq002.stderr
- testsuite/tests/quasiquotation/qq003/qq003.stderr
- testsuite/tests/quasiquotation/qq004/qq004.stderr
- + testsuite/tests/quotes/T5721.stderr
- testsuite/tests/roles/should_compile/Roles1.stderr
- testsuite/tests/roles/should_compile/Roles14.stderr
- testsuite/tests/roles/should_compile/Roles2.stderr
- testsuite/tests/roles/should_compile/Roles3.stderr
- testsuite/tests/roles/should_compile/Roles4.stderr
- testsuite/tests/roles/should_compile/T8958.stderr
- testsuite/tests/showIface/DocsInHiFile1.stdout
- testsuite/tests/showIface/DocsInHiFileTH.stdout
- testsuite/tests/showIface/HaddockIssue849.stdout
- testsuite/tests/showIface/HaddockOpts.stdout
- testsuite/tests/showIface/HaddockSpanIssueT24378.stdout
- testsuite/tests/showIface/LanguageExts.stdout
- testsuite/tests/showIface/MagicHashInHaddocks.stdout
- testsuite/tests/showIface/NoExportList.stdout
- testsuite/tests/showIface/PragmaDocs.stdout
- testsuite/tests/showIface/ReExports.stdout
- + testsuite/tests/splice-imports/ClassA.hs
- + testsuite/tests/splice-imports/InstanceA.hs
- + testsuite/tests/splice-imports/Makefile
- + testsuite/tests/splice-imports/SI01.hs
- + testsuite/tests/splice-imports/SI01A.hs
- + testsuite/tests/splice-imports/SI02.hs
- + testsuite/tests/splice-imports/SI03.hs
- + testsuite/tests/splice-imports/SI03.stderr
- + testsuite/tests/splice-imports/SI04.hs
- + testsuite/tests/splice-imports/SI05.hs
- + testsuite/tests/splice-imports/SI05.stderr
- + testsuite/tests/splice-imports/SI05A.hs
- + testsuite/tests/splice-imports/SI06.hs
- + testsuite/tests/splice-imports/SI07.hs
- + testsuite/tests/splice-imports/SI07.stderr
- + testsuite/tests/splice-imports/SI07A.hs
- + testsuite/tests/splice-imports/SI08.hs
- + testsuite/tests/splice-imports/SI08.stderr
- + testsuite/tests/splice-imports/SI08_oneshot.stderr
- + testsuite/tests/splice-imports/SI09.hs
- + testsuite/tests/splice-imports/SI10.hs
- + testsuite/tests/splice-imports/SI13.hs
- + testsuite/tests/splice-imports/SI14.hs
- + testsuite/tests/splice-imports/SI14.stderr
- + testsuite/tests/splice-imports/SI15.hs
- + testsuite/tests/splice-imports/SI15.stderr
- + testsuite/tests/splice-imports/SI16.hs
- + testsuite/tests/splice-imports/SI16.stderr
- + testsuite/tests/splice-imports/SI17.hs
- + testsuite/tests/splice-imports/SI18.hs
- + testsuite/tests/splice-imports/SI18.stderr
- + testsuite/tests/splice-imports/SI19.hs
- + testsuite/tests/splice-imports/SI19A.hs
- + testsuite/tests/splice-imports/SI20.hs
- + testsuite/tests/splice-imports/SI20.stderr
- + testsuite/tests/splice-imports/SI21.hs
- + testsuite/tests/splice-imports/SI21.stderr
- + testsuite/tests/splice-imports/SI22.hs
- + testsuite/tests/splice-imports/SI22.stderr
- + testsuite/tests/splice-imports/SI23.hs
- + testsuite/tests/splice-imports/SI23A.hs
- + testsuite/tests/splice-imports/SI24.hs
- + testsuite/tests/splice-imports/SI25.hs
- + testsuite/tests/splice-imports/SI25.stderr
- + testsuite/tests/splice-imports/SI25Helper.hs
- + testsuite/tests/splice-imports/SI26.hs
- + testsuite/tests/splice-imports/SI27.hs
- + testsuite/tests/splice-imports/SI27.stderr
- + testsuite/tests/splice-imports/SI28.hs
- + testsuite/tests/splice-imports/SI28.stderr
- + testsuite/tests/splice-imports/SI29.hs
- + testsuite/tests/splice-imports/SI29.stderr
- + testsuite/tests/splice-imports/SI30.script
- + testsuite/tests/splice-imports/SI30.stdout
- + testsuite/tests/splice-imports/SI31.script
- + testsuite/tests/splice-imports/SI31.stderr
- + testsuite/tests/splice-imports/SI32.script
- + testsuite/tests/splice-imports/SI32.stdout
- + testsuite/tests/splice-imports/SI33.script
- + testsuite/tests/splice-imports/SI33.stdout
- + testsuite/tests/splice-imports/SI34.hs
- + testsuite/tests/splice-imports/SI34.stderr
- + testsuite/tests/splice-imports/SI34M1.hs
- + testsuite/tests/splice-imports/SI34M2.hs
- + testsuite/tests/splice-imports/SI35.hs
- + testsuite/tests/splice-imports/SI35A.hs
- + testsuite/tests/splice-imports/SI36.hs
- + testsuite/tests/splice-imports/SI36.stderr
- + testsuite/tests/splice-imports/SI36_A.hs
- + testsuite/tests/splice-imports/SI36_B1.hs
- + testsuite/tests/splice-imports/SI36_B2.hs
- + testsuite/tests/splice-imports/SI36_B3.hs
- + testsuite/tests/splice-imports/SI36_C1.hs
- + testsuite/tests/splice-imports/SI36_C2.hs
- + testsuite/tests/splice-imports/SI36_C3.hs
- + testsuite/tests/splice-imports/all.T
- testsuite/tests/th/T16976z.stderr
- testsuite/tests/th/T17820a.stderr
- testsuite/tests/th/T17820b.stderr
- testsuite/tests/th/T17820c.stderr
- testsuite/tests/th/T17820d.stderr
- testsuite/tests/th/T17820e.stderr
- testsuite/tests/th/T21547.stderr
- testsuite/tests/th/T23829_hasty.stderr
- testsuite/tests/th/T23829_hasty_b.stderr
- testsuite/tests/th/T23829_tardy.ghc.stderr
- testsuite/tests/th/T5795.stderr
- testsuite/tests/th/TH_Roles2.stderr
- testsuite/tests/typecheck/should_compile/T12763.stderr
- testsuite/tests/typecheck/should_compile/T18406b.stderr
- testsuite/tests/typecheck/should_compile/T18529.stderr
- testsuite/tests/typecheck/should_compile/T21023.stderr
- utils/check-exact/ExactPrint.hs
- utils/count-deps/Main.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/217caad163283c37fb5560188a56511…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/217caad163283c37fb5560188a56511…
You're receiving this email because of your account on gitlab.haskell.org.
1
0