[Git][ghc/ghc][wip/bchinn-cvtlit-exhaustive] 6 commits: Decouple `L.S.H.Decls` from importing `GHC.Types.Basic`
Brandon Chinn pushed to branch wip/bchinn-cvtlit-exhaustive at Glasgow Haskell Compiler / GHC Commits: 631fa5ae by Recursion Ninja at 2026-01-31T22:30:11+00:00 Decouple `L.S.H.Decls` from importing `GHC.Types.Basic` Data-types within `GHC.Types.Basic` which describe components of the AST are migrated to `Language.Haskell.Syntax.Basic`. Related function definitions are also moved. Types moved to L.H.S. because they are part of the AST: * TopLevelFlag * RuleName Types moved from L.H.S. to GHC.Hs. because they are not needed in the AST: * TyConFlavour * TypeOrData * NewOrData Migrated instances: * `Outputable` instances moved to in `GHC.Utils.Outputable` * `Binary` instance of `Boxity` moved to to `GHC.Utils.Binary` * Other `Binary` instances are orphans to be migrated later. The `OverlapMode` data-type is given a TTG extension point. The `OverlapFlag` data-type, which depends on `OverlapMode`, is updated to support `OverlapMode` with a GHC "pass" type paramerter. In order to avoid module import cycles, `OverlapMode` and `OverlapFlag` are migrated to new modules (no way around this). * Migrated `OverlapMode` to new module `Language.Haskell.Syntax.Overlap` * Migrated `OverlapFlag` to new module `GHC.Hs.Decls.Overlap` - - - - - 9769cc03 by Simon Hengel at 2026-02-01T04:21:03-05:00 Update the documentation for MultiWayIf (fixes #25376) (so that it matches the implementation) - - - - - 5fc9442a by Peter Trommler at 2026-02-01T04:21:44-05:00 hadrian: Fix dependency generation for assembler Assembler files allow # for comments unless in column 1. A modern cpp for C treats those a preprocessor directives. We tell gcc that a .S file is assembler with cpp and not C. Fixes #26819 - - - - - 269c4087 by Simon Peyton Jones at 2026-02-01T19:38:10-05:00 Include current phase in the range for rule/unfoldings This MR fixes a bad loop in the compiler: #26826. The fix is to add (WAR2) to Note [What is active in the RHS of a RULE or unfolding?] in GHC.Core.Opt.Simplify.Utils - - - - - ddf1434f by Vladislav Zavialov at 2026-02-01T19:38:52-05:00 Refactor: merge HsMultilineString into HsString (#26860) Before this patch, HsLit defined two separate constructors to represent single-line and multi-line strings: data HsLit x ... | HsString (XHsString x) FastString | HsMultilineString (XHsMultilineString x) FastString I found this to be an unnecessary complication and an obstacle to unifying HsLit with HsTyLit. Now we use HsString for both kinds of literals. One user-facing change here is `ppr (HsString st s)` behaving differently for single-line strings containing newlines: x = "first line \ \asdf\n\ \second line" Previously, the literal was fed to `ftext` with its newlines, producing an ill-formed SDoc. This issue is now addressed by using `split` for both single-line and multi-line strings: vcat $ map text $ split '\n' (unpackFS src) See the parser/should_fail/T26860ppr test. In addition (and unrelatedly to the main payload of this patch), drop the unused pmPprHsLit helper. - - - - - 8ce9251e by Brandon Chinn at 2026-02-02T20:48:36-08:00 Refactor: make function patterns exhaustive Also added missing (==) logic for: * HsMultilineString * HsInt{8,16,32} * HsWord{8,16,32} - - - - - 61 changed files: - compiler/GHC/Core/InstEnv.hs - compiler/GHC/Core/Opt/OccurAnal.hs - compiler/GHC/Core/Opt/Simplify/Env.hs - compiler/GHC/Core/Opt/Simplify/Utils.hs - compiler/GHC/Core/Opt/WorkWrap.hs - compiler/GHC/Hs/Decls.hs - + compiler/GHC/Hs/Decls/Overlap.hs - compiler/GHC/Hs/Instances.hs - compiler/GHC/Hs/Lit.hs - compiler/GHC/Hs/Syn/Type.hs - compiler/GHC/Hs/Utils.hs - compiler/GHC/HsToCore/Errors/Types.hs - compiler/GHC/HsToCore/Match/Literal.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/Iface/Ext/Ast.hs - compiler/GHC/Iface/Syntax.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/String.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/Tc/Deriv.hs - compiler/GHC/Tc/Deriv/Utils.hs - compiler/GHC/Tc/Errors/Ppr.hs - compiler/GHC/Tc/Gen/Head.hs - compiler/GHC/Tc/Gen/HsType.hs - compiler/GHC/Tc/Utils/Env.hs - compiler/GHC/Tc/Utils/Instantiate.hs - compiler/GHC/Tc/Utils/Monad.hs - compiler/GHC/ThToHs.hs - compiler/GHC/Types/Basic.hs - compiler/GHC/Types/InlinePragma.hs - compiler/GHC/Types/Name.hs - compiler/GHC/Unit/Types.hs - compiler/GHC/Utils/Binary.hs - compiler/GHC/Utils/Outputable.hs - compiler/Language/Haskell/Syntax/Basic.hs - compiler/Language/Haskell/Syntax/Decls.hs - + compiler/Language/Haskell/Syntax/Decls/Overlap.hs - compiler/Language/Haskell/Syntax/Extension.hs - compiler/Language/Haskell/Syntax/Lit.hs - compiler/ghc.cabal.in - docs/users_guide/exts/multiway_if.rst - hadrian/src/Builder.hs - hadrian/src/Rules/Compile.hs - hadrian/src/Settings/Builders/Cc.hs - hadrian/src/Settings/Packages.hs - testsuite/tests/count-deps/CountDepsAst.stdout - testsuite/tests/count-deps/CountDepsParser.stdout - + testsuite/tests/parser/should_fail/T26860ppr.hs - + testsuite/tests/parser/should_fail/T26860ppr.stderr - testsuite/tests/parser/should_fail/all.T - + testsuite/tests/simplCore/should_compile/T26826.hs - testsuite/tests/simplCore/should_compile/all.T - utils/check-exact/ExactPrint.hs - utils/haddock/haddock-api/src/Haddock/Backends/Hoogle.hs - utils/haddock/haddock-api/src/Haddock/Convert.hs - utils/haddock/haddock-api/src/Haddock/Interface/Rename.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/fa20b0182bcdff042a19b72add11ce7... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/fa20b0182bcdff042a19b72add11ce7... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Brandon Chinn (@brandonchinn178)