[Git][ghc/ghc][wip/soulomoon/25647-allow-newtype-instance-in-gadt-syntax] 12 commits: driver: Store an ExternalModuleGraph in the EPS
Patrick (@soulomoon)
gitlab at gitlab.haskell.org
Mon Jan 20 18:52:25 UTC 2025
Patrick pushed to branch wip/soulomoon/25647-allow-newtype-instance-in-gadt-syntax at Glasgow Haskell Compiler / GHC
Commits:
44778963 by Matthew Pickering at 2025-01-20T11:23:08+00:00
driver: Store an ExternalModuleGraph in the EPS
We now store an ExternalModuleGraph in the EPS. When an new interface is
loaded, the module graph is extended with a node for the loaded
interface. The result is a partial module graph. If you want to run
a transitive closure query on the graph you must first force the
transitive closure to be loaded by using `loadExternalGraphBelow`.
The primary advantage (for now) is that the transitive dependency
calculation does not have to be repeated in getLinkDeps. If your module
had many dependencies and many splices, performing this calculation at
every splice site took a significant amount of time.
We might also want to use this module graph in future for considering
questions such as reachability of rules or accessibilty of instance
imported by levelled imported.
This patch removes another place in the compiler where transitive
dependency is calculated in an ad-hoc manner. In general, the transitive
dependency calculation should be cached and computed using a ModuleGraph
abstraction.
The transitive dependency query required by getLinkDeps operates on a
graph without hs-boot nodes. If a linkable from a module in a loop is
needed, then all modules in the loop are necessary to be available to
execute that module. Therefore there is a query in `ModuleGraph` and
`ExternalModuleGraph` which allows a transitive closure query to be
performed on a graph without loops.
Fixes #25634
-------------------------
Metric Decrease:
MultiLayerModulesTH_Make
MultiLayerModulesTH_OneShot
Metric Increase:
mhu-perf
-------------------------
Co-authored-by: Rodrigo Mesquita <rodrigo.m.mesquita at gmail.com>
- - - - -
b3c0acfc by Cheng Shao at 2025-01-20T11:53:10-05:00
hie: fix hie.yaml to use default hie-bios script
!13778 accidentally changed hie.yaml to use hie-bios.bat as the
default hie-bios script, which completely breaks hie support on
non-Windows platforms. This patch reverts that change.
- - - - -
1ef54f86 by Patrick at 2025-01-20T18:52:22+00:00
update kcConDecl to also consider the result type
in newtype GADT instance
- - - - -
f53f514f by Patrick at 2025-01-20T18:52:22+00:00
peek at the result kind
- - - - -
4bc78319 by Patrick at 2025-01-20T18:52:22+00:00
test if gadt has UserSuppliedResultKind in lhs, we let tc_res_kind to unify with rhs result kind if not to gain more inference
- - - - -
879894ca by Patrick at 2025-01-20T18:52:22+00:00
format and remove getTyConResultKind
- - - - -
f92cb619 by Patrick at 2025-01-20T18:52:22+00:00
format
- - - - -
744c6d52 by Patrick at 2025-01-20T18:52:22+00:00
add comment
- - - - -
7cc65698 by Patrick at 2025-01-20T18:52:22+00:00
cleanup
- - - - -
18c9c462 by Patrick at 2025-01-20T18:52:22+00:00
cleanup
- - - - -
a6c0ed8f by Patrick at 2025-01-20T18:52:22+00:00
update T25611a
- - - - -
1cdef684 by Patrick at 2025-01-20T18:52:22+00:00
rename and add note
- - - - -
30 changed files:
- compiler/GHC/Driver/Backpack.hs
- compiler/GHC/Driver/Errors/Ppr.hs
- compiler/GHC/Driver/Main.hs
- compiler/GHC/Driver/Make.hs
- compiler/GHC/Driver/MakeFile.hs
- compiler/GHC/Iface/Load.hs
- compiler/GHC/Linker/Deps.hs
- compiler/GHC/Linker/Loader.hs
- compiler/GHC/Tc/TyCl.hs
- compiler/GHC/Tc/TyCl/Instance.hs
- compiler/GHC/Unit/External.hs
- + compiler/GHC/Unit/Module/External/Graph.hs
- compiler/GHC/Unit/Module/Graph.hs
- + compiler/GHC/Unit/Module/ModNodeKey.hs
- compiler/ghc.cabal.in
- hie.yaml
- testsuite/tests/backpack/reexport/bkpreex02.stderr
- testsuite/tests/backpack/reexport/bkpreex03.stdout
- testsuite/tests/backpack/should_compile/bkp09.stderr
- testsuite/tests/backpack/should_compile/bkp14.stderr
- testsuite/tests/backpack/should_compile/bkp15.stderr
- testsuite/tests/backpack/should_compile/bkp31.stderr
- testsuite/tests/backpack/should_compile/bkp32.stderr
- testsuite/tests/backpack/should_compile/bkp47.stderr
- testsuite/tests/backpack/should_compile/bkp51.stderr
- testsuite/tests/backpack/should_compile/bkp61.stderr
- testsuite/tests/backpack/should_fail/bkpfail07.stderr
- testsuite/tests/backpack/should_fail/bkpfail09.stderr
- testsuite/tests/backpack/should_fail/bkpfail12.stderr
- testsuite/tests/backpack/should_fail/bkpfail13.stderr
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/370ccc3e1a4fec17f1046b1e89f9c4e7e05f7f28...1cdef6841ac7d3ce7753df7125f70e5e509f3b5f
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/370ccc3e1a4fec17f1046b1e89f9c4e7e05f7f28...1cdef6841ac7d3ce7753df7125f70e5e509f3b5f
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20250120/111e4c5c/attachment.html>
More information about the ghc-commits
mailing list