[Git][ghc/ghc][wip/ani/kill-CodeSrcFlag] 38 commits: Work for #25001
Apoorv Ingle pushed to branch wip/ani/kill-CodeSrcFlag at Glasgow Haskell Compiler / GHC Commits: 505b57cf by Apoorv Ingle at 2026-03-09T16:27:08-05:00 Work for #25001 Notes added [Error Context Stack] [Typechecking by expansion: overview] Notes updated Note [Expanding HsDo with XXExprGhcRn] ------------------------- Metric Decrease: T9020 ------------------------- * Streamlines implementations of `tcExpr` and `tcXExpr` to work on `XExpr` * Kills `VACtxt` (and its associated `VAExpansion` and `VACall`) datatype, it is subsumed by simply a `SrcSpan`. * Kills the function `addHeadCtxt` as it is now mearly setting a location * The function `tcValArgs` does its own argument number management * Makes `splitHsApps` not look through `XExpr` * `tcExprSigma` is called if the head of the expression after calling `splitHsApps` turns out to be an `XExpr` * Removes location information from `OrigPat` payload * Removes special case of tcBody from `tcLambdaMatches` * Removes special case of `dsExpr` for `ExpandedThingTc` * Rename `HsThingRn` to `SrcCodeCtxt` * Kills `tcl_in_gen_code` and `tcl_err_ctxt`. It is subsumed by `ErrCtxtStack` * Kills `ExpectedFunTyOrig`. It is subsumed by `CtOrigin` * Fixes `CtOrigin` for `HsProjection` case in `exprCtOrigin`. It was previously assigned to be `SectionOrigin`. It is now just the expression * Adds a new `CtOrigin.ExpansionOrigin` for storing the original syntax * Adds a new `CtOrigin.ExpectedTySyntax` as a replacement for `ExpectedTySyntaxOp`. Cannot kill the former yet because of `ApplicativeDo` * Renames `tcMonoExpr` -> `tcMonoLExpr`, `tcMonoExprNC` -> `tcMonoLExpr` * Renames `EValArg`, `EValArgQL` fields: `ea_ctxt` -> `ea_loc_span` and `eaql_ctx` -> `eaql_loc_span` * kill `PopErrCtxt` from `XXExprGhcRn` * simplify `addArgCtxt` and push `setSrcSpan` inside `addLExprCtxt`. Make sure addExprCtxt is not called by itself * fun_orig in tcApp depends on the SrcSpan of the head of the application chain (similar to addArgCtxt) * rename fun_ctxt to fun_lspan, fun_orig passed in tcInstFun to default to app chain head if its user located, fall back to srcCodeOrigin if it's a generated location * fix quickLookArg function to blame the correct application chain head. The arguments application chain head should be blamed, not the original head when we quick look arg * Make sure only expression wrapped around generated src span are ignored while adding them to the error context stack * `getDeepSubsumptionFlag_DataConHead` performs a non-trivial traversal if the expression passed to it is complex. This traversal is necessary if the head of the function is an `XExpr` and `splitHsApps` does not look through them - The deepsubsumption flag is stored in EVAlArgQL to reduce the need to call `getDeepSubsumptionFlag_DataConHead` - `getDeepSubsumptionFlag_DataConHead` is called in `tcExprSigma` and `tcInferAppHead` to reduce AST traversals * Make a new variant `GeneratedSrcSpan` in `SrcSpan` for HIEAst Nodes * wrap `fromListN` with a generated src span with GeneratedSrcSpanDetails field to store the original srcspan * remove `UnhelpfulGenerated` from `UnhelpfulSpanReason` and into new datatype `GeneratedSrcSpanDetails` - - - - - faaeb7b9 by Apoorv Ingle at 2026-03-09T16:27:37-05:00 trying to remove SrcCodeOrigin - - - - - c675c814 by Simon Peyton Jones at 2026-03-09T16:27:38-05:00 Improvements in ErrCtxt - - - - - af429f43 by Apoorv Ingle at 2026-03-09T16:27:39-05:00 ErrCtxtMsg to CtOrigin - - - - - 1ff61903 by Apoorv Ingle at 2026-03-09T16:27:39-05:00 remove CtOrigin.ExpansionOrigin in favour of errCtxtCtOrigin, remove CtOrign from ErrMsgCtxt.FunTysCtxt - - - - - ba2b691f by Apoorv Ingle at 2026-03-09T16:27:39-05:00 trying out ErrCtxtMsg zonking - - - - - 8f52b02f by Apoorv Ingle at 2026-03-09T16:27:40-05:00 route the correct ExpectedFunTyCtxt SDoc. Add missing RecordUpdCtxt to errCtxtCtOrigin - - - - - f921f0d3 by Apoorv Ingle at 2026-03-09T16:27:40-05:00 print the correct exprs for warnings for do discards - - - - - c6f2ab89 by Apoorv Ingle at 2026-03-09T19:16:59-05:00 fixes for error message diffs for RepPolyBinds etc. - - - - - d0f2dc6f by Apoorv Ingle at 2026-03-09T22:17:16-05:00 add zonking for PatSigErrCtxt, fix err string for pprExpectedFunTyCtxt - - - - - dd34f3ec by Apoorv Ingle at 2026-03-11T17:23:53-05:00 make Data instance for ErrCtxtMsg, accept test cases - - - - - 18772d5c by Apoorv Ingle at 2026-03-11T17:59:39-05:00 rename ErrCtxtMsg -> HsCtxt - - - - - 8780dc92 by Apoorv Ingle at 2026-03-11T19:26:22-05:00 remove add***ErrM variants as they are no longer monadic. remove DoStmtErrCtxt from HsCtxt. - - - - - a4df18d0 by Rajkumar Natarajan at 2026-03-12T16:25:17-05:00 chore: Merge GHC.Internal.TH.Quote into GHC.Internal.TH.Monad Move the QuasiQuoter datatype from GHC.Internal.TH.Quote to GHC.Internal.TH.Monad and delete the Quote module. Update submodule template-haskell-quasiquoter to use the merged upstream version that imports from the correct module. Co-authored-by: Cursor <cursoragent@cursor.com> - - - - - 1f234da7 by Simon Jakobi at 2026-03-12T16:25:17-05:00 Add regression test for #16122 - - - - - 9572f6e9 by Cheng Shao at 2026-03-12T16:25:17-05:00 hadrian: remove the broken bench flavour This patch removes the bench flavour from hadrian which has been broken for years and not used for actual benchmarking (for which `perf`/`release` is used instead). Closes #26825. - - - - - db174d15 by Simon Jakobi at 2026-03-12T16:25:17-05:00 Add regression test for #18186 The original TypeInType language extension is replaced with DataKinds+PolyKinds for compatibility. Closes #18186. - - - - - d4d44c32 by Andreas Klebinger at 2026-03-12T16:25:17-05:00 Bump nofib submodule. We accrued a number of nofib fixes we want to have here. - - - - - b72bd0e2 by Simon Jakobi at 2026-03-12T16:25:17-05:00 Add regression test for #15907 Closes #15907. - - - - - f652da00 by Simon Jakobi at 2026-03-12T16:25:17-05:00 Ensure T14272 is run in optasm way Closes #16539. - - - - - f71b8aba by Simon Jakobi at 2026-03-12T16:25:17-05:00 Add regression test for #24632 Closes #24632. - - - - - c1c0c687 by Simon Jakobi at 2026-03-12T16:25:17-05:00 Fix module name of T9675: T6975 -> T9675 - - - - - 66d0f48a by Andreas Klebinger at 2026-03-12T16:25:17-05:00 User guide: Clarify phase control on INLINEABLE[foo] pragmas. Fixes #26851 - - - - - 179ef220 by Simon Jakobi at 2026-03-12T16:25:17-05:00 Add regression test for #12694 Closes #12694. - - - - - a8b7332c by Simon Jakobi at 2026-03-12T16:25:17-05:00 Add regression test for #16275 Closes #16275. - - - - - ca98d28d by Simon Jakobi at 2026-03-12T16:25:17-05:00 Add regression test for #14908 Closes #14908. - - - - - 999b7fdf by Simon Jakobi at 2026-03-12T16:25:17-05:00 Add regression test for #14151 Closes #14151. - - - - - c1be3e34 by Simon Jakobi at 2026-03-12T16:25:17-05:00 Add regression test for #12640 Closes #12640. - - - - - bf3183ae by Simon Jakobi at 2026-03-12T16:25:17-05:00 Add regression test for #15588 Closes #15588. - - - - - 84ca0079 by Simon Jakobi at 2026-03-12T16:25:17-05:00 Add regression test for #9445 Closes #9445. - - - - - e4d81164 by Cheng Shao at 2026-03-12T16:25:17-05:00 compiler: implement string interning logic for BCONPtrFS This patch adds a `FastStringEnv`-based cache of `MallocStrings` requests to `Interp`, so that when we load bytecode with many breakpoints that share the same module names & unit ids, we reuse the allocated remote pointers instead of issuing duplicte `MallocStrings` requests and bloating the C heap. Closes #26995. - - - - - 8684a569 by Simon Jakobi at 2026-03-12T16:25:17-05:00 Add perf test for #1216 Closes #1216. - - - - - c77df83d by Sylvain Henry at 2026-03-12T16:25:17-05:00 JS: check that tuple constructors are linked (#23709) Test js-mk_tup was failing before because tuple constructors weren't linked in. It's no longer an issue after the linker fixes. - - - - - 68304361 by Matthew Pickering at 2026-03-12T16:25:17-05:00 testsuite: Add test for foreign import prim with unboxed tuple return This commit just adds a test that foreign import prim works with unboxed sums. - - - - - 76e50eab by Matthew Pickering at 2026-03-12T16:25:17-05:00 Return a valid pointer in advanceStackFrameLocationzh When there is no next stack chunk, `advanceStackFrameLocationzh` used to return NULL in the pointer-typed StackSnapshot# result slot. Even though the caller treats that case as "no next frame", the result is still materialized in a GC-visible pointer slot. If a GC observes the raw NULL there, stack decoding can crash. Fix this by ensuring the dead pointer slot contains a valid closure pointer. Also make the optional result explicit by returning an unboxed sum instead of a tuple with a separate tag. Fixes #27009 - - - - - 3399557a by Cheng Shao at 2026-03-12T16:25:17-05:00 hadrian: build profiled dynamic objects with -dynamic-too This patch enables hadrian to build profiled dynamic objects with `-dynamic-too`, addressing a build parallelism bottleneck in release pipelines. Closes #27010. - - - - - 5be3e1de by Apoorv Ingle at 2026-03-12T16:25:17-05:00 hie refactoring - - - - - 59c5e841 by Apoorv Ingle at 2026-03-12T17:33:52-05:00 remove dependencies on CodeSrcFlag make VDQWarningCtxt landmark make addExpansionErrCtxt also sets tcl_in_gen_code - - - - - 176 changed files: - compiler/GHC.hs - compiler/GHC/Builtin/Names/TH.hs - compiler/GHC/ByteCode/Linker.hs - compiler/GHC/Driver/Main.hs - compiler/GHC/Hs/DocString.hs - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Expr.hs-boot - compiler/GHC/Hs/Instances.hs - compiler/GHC/HsToCore/Expr.hs - compiler/GHC/HsToCore/Match.hs - compiler/GHC/HsToCore/Monad.hs - compiler/GHC/HsToCore/Pmc.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/HsToCore/Ticks.hs - compiler/GHC/Iface/Ext/Ast.hs - compiler/GHC/Iface/Ext/Utils.hs - compiler/GHC/Parser/HaddockLex.x - compiler/GHC/Rename/Expr.hs - compiler/GHC/Rename/Names.hs - compiler/GHC/Rename/Utils.hs - compiler/GHC/Runtime/Debugger/Breakpoints.hs - compiler/GHC/Runtime/Interpreter/Init.hs - compiler/GHC/Runtime/Interpreter/Types.hs - compiler/GHC/Tc/Deriv.hs - compiler/GHC/Tc/Deriv/Infer.hs - compiler/GHC/Tc/Deriv/Utils.hs - compiler/GHC/Tc/Errors.hs - compiler/GHC/Tc/Errors/Ppr.hs - compiler/GHC/Tc/Errors/Types.hs - compiler/GHC/Tc/Gen/App.hs - + compiler/GHC/Tc/Gen/App.hs-boot - compiler/GHC/Tc/Gen/Bind.hs - compiler/GHC/Tc/Gen/Do.hs - compiler/GHC/Tc/Gen/Export.hs - compiler/GHC/Tc/Gen/Expr.hs - compiler/GHC/Tc/Gen/Expr.hs-boot - compiler/GHC/Tc/Gen/Head.hs - compiler/GHC/Tc/Gen/HsType.hs - compiler/GHC/Tc/Gen/Match.hs - compiler/GHC/Tc/Gen/Match.hs-boot - compiler/GHC/Tc/Gen/Pat.hs - compiler/GHC/Tc/Gen/Sig.hs - compiler/GHC/Tc/Gen/Splice.hs - compiler/GHC/Tc/Instance/Class.hs - compiler/GHC/Tc/Module.hs - compiler/GHC/Tc/Solver/Solve.hs - compiler/GHC/Tc/TyCl.hs - compiler/GHC/Tc/TyCl/Class.hs - compiler/GHC/Tc/TyCl/Instance.hs - compiler/GHC/Tc/TyCl/PatSyn.hs - compiler/GHC/Tc/Types.hs - compiler/GHC/Tc/Types/BasicTypes.hs - compiler/GHC/Tc/Types/Constraint.hs - compiler/GHC/Tc/Types/CtLoc.hs - compiler/GHC/Tc/Types/ErrCtxt.hs - compiler/GHC/Tc/Types/LclEnv.hs - compiler/GHC/Tc/Types/Origin.hs - compiler/GHC/Tc/Types/Origin.hs-boot - compiler/GHC/Tc/Utils/Instantiate.hs - compiler/GHC/Tc/Utils/Monad.hs - compiler/GHC/Tc/Utils/TcType.hs-boot - compiler/GHC/Tc/Utils/Unify.hs - compiler/GHC/Tc/Validity.hs - compiler/GHC/Tc/Zonk/TcType.hs - compiler/GHC/Tc/Zonk/Type.hs - compiler/GHC/Types/Error.hs - + compiler/GHC/Types/Error.hs-boot - compiler/GHC/Types/Hint/Ppr.hs - compiler/GHC/Types/Name/Reader.hs - compiler/GHC/Types/SrcLoc.hs - + compiler/GHC/Unit/State.hs-boot - compiler/GHC/Utils/Binary.hs - compiler/GHC/Utils/Logger.hs - docs/users_guide/exts/pragmas.rst - docs/users_guide/exts/rewrite_rules.rst - ghc/GHCi/UI.hs - ghc/GHCi/UI/Info.hs - hadrian/doc/flavours.md - hadrian/hadrian.cabal - hadrian/src/Rules/Compile.hs - hadrian/src/Settings.hs - hadrian/src/Settings/Builders/Ghc.hs - − hadrian/src/Settings/Flavours/Benchmark.hs - libraries/ghc-boot-th/GHC/Boot/TH/Quote.hs - libraries/ghc-internal/cbits/Stack.cmm - libraries/ghc-internal/ghc-internal.cabal.in - libraries/ghc-internal/src/GHC/Internal/Stack/Decode.hs - libraries/ghc-internal/src/GHC/Internal/TH/Monad.hs - − libraries/ghc-internal/src/GHC/Internal/TH/Quote.hs - libraries/template-haskell-quasiquoter - nofib - + testsuite/tests/corelint/T15907.hs - + testsuite/tests/corelint/T15907A.hs - testsuite/tests/corelint/all.T - testsuite/tests/count-deps/CountDepsAst.stdout - testsuite/tests/count-deps/CountDepsParser.stdout - + testsuite/tests/dependent/should_fail/T15588.hs - + testsuite/tests/dependent/should_fail/T15588.stderr - testsuite/tests/dependent/should_fail/all.T - + testsuite/tests/ffi/should_run/PrimFFIUnboxedSum.hs - + testsuite/tests/ffi/should_run/PrimFFIUnboxedSum.stdout - + testsuite/tests/ffi/should_run/PrimFFIUnboxedSum_cmm.cmm - testsuite/tests/ffi/should_run/all.T - + testsuite/tests/ghci/scripts/T24632.hs - + testsuite/tests/ghci/scripts/T24632.script - + testsuite/tests/ghci/scripts/T24632.stdout - testsuite/tests/ghci/scripts/all.T - testsuite/tests/indexed-types/should_fail/T2693.stderr - testsuite/tests/indexed-types/should_fail/T5439.stderr - testsuite/tests/javascript/js-mk_tup.hs - testsuite/tests/javascript/js-mk_tup.stdout - testsuite/tests/linters/Makefile - testsuite/tests/monadfail/MonadFailErrors.stderr - testsuite/tests/overloadedrecflds/should_fail/T26480b.stderr - testsuite/tests/parser/should_fail/RecordDotSyntaxFail10.stderr - testsuite/tests/parser/should_fail/RecordDotSyntaxFail11.stderr - testsuite/tests/parser/should_fail/RecordDotSyntaxFail8.stderr - testsuite/tests/parser/should_fail/RecordDotSyntaxFail9.stderr - testsuite/tests/perf/compiler/T9675.hs - + testsuite/tests/perf/should_run/T1216.hs - + testsuite/tests/perf/should_run/T1216.stdout - testsuite/tests/perf/should_run/all.T - testsuite/tests/plugins/plugins10.stdout - testsuite/tests/plugins/test-defaulting-plugin.stderr - + testsuite/tests/polykinds/T18186.hs - + testsuite/tests/polykinds/T18186.stderr - testsuite/tests/polykinds/all.T - testsuite/tests/printer/T17697.stderr - testsuite/tests/quotes/QQError.stderr - testsuite/tests/rebindable/rebindable6.stderr - testsuite/tests/rep-poly/RepPolyDoBind.stderr - testsuite/tests/rep-poly/RepPolyDoBody1.stderr - testsuite/tests/rep-poly/RepPolyDoBody2.stderr - testsuite/tests/rep-poly/RepPolyRecordUpdate.stderr - + testsuite/tests/simplCore/should_compile/T12640.hs - + testsuite/tests/simplCore/should_compile/T12640.stderr - + testsuite/tests/simplCore/should_compile/T14908.hs - + testsuite/tests/simplCore/should_compile/T14908_Deps.hs - + testsuite/tests/simplCore/should_compile/T16122.hs - + testsuite/tests/simplCore/should_compile/T16122.stderr - + testsuite/tests/simplCore/should_compile/T9445.hs - testsuite/tests/simplCore/should_compile/all.T - testsuite/tests/th/QQTopError.stderr - + testsuite/tests/typecheck/should_compile/ExpansionQLIm.hs - + testsuite/tests/typecheck/should_compile/T14151.hs - testsuite/tests/typecheck/should_compile/T14590.stderr - testsuite/tests/typecheck/should_compile/all.T - testsuite/tests/typecheck/should_compile/valid_hole_fits.stderr - testsuite/tests/typecheck/should_fail/DoExpansion1.stderr - testsuite/tests/typecheck/should_fail/DoExpansion2.stderr - testsuite/tests/typecheck/should_fail/T10971d.stderr - + testsuite/tests/typecheck/should_fail/T12694.hs - + testsuite/tests/typecheck/should_fail/T12694.stderr - testsuite/tests/typecheck/should_fail/T13311.stderr - + testsuite/tests/typecheck/should_fail/T16275.stderr - + testsuite/tests/typecheck/should_fail/T16275A.hs - + testsuite/tests/typecheck/should_fail/T16275B.hs - + testsuite/tests/typecheck/should_fail/T16275B.hs-boot - testsuite/tests/typecheck/should_fail/T3323.stderr - testsuite/tests/typecheck/should_fail/T3613.stderr - testsuite/tests/typecheck/should_fail/T6069.stderr - testsuite/tests/typecheck/should_fail/T7851.stderr - testsuite/tests/typecheck/should_fail/T7857.stderr - testsuite/tests/typecheck/should_fail/T8603.stderr - testsuite/tests/typecheck/should_fail/T9612.stderr - testsuite/tests/typecheck/should_fail/all.T - testsuite/tests/typecheck/should_fail/tcfail102.stderr - testsuite/tests/typecheck/should_fail/tcfail128.stderr - testsuite/tests/typecheck/should_fail/tcfail140.stderr - testsuite/tests/typecheck/should_fail/tcfail181.stderr - utils/check-exact/ExactPrint.hs - utils/check-exact/Parsers.hs - utils/check-exact/Transform.hs - utils/check-exact/Utils.hs - utils/haddock/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs - utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Utils.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/575ad32e32d76d6c4be7f1d695a4e18... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/575ad32e32d76d6c4be7f1d695a4e18... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Apoorv Ingle (@ani)