Refactor ModuleGraph interface
The 'ModuleGraph' abstraction represents the relationship and strucutre of the modules being compiled. This structure is meant to be constructed once at the start of compilation, and never changed again. However, it's exposed interface was confusing and exposed too many footguns which led to inneficient usages of the ModuleGraph. This commit improves significantly the exported interface of ModuleGraph, taking into consideration the recent improvements around reachability queries. Since the ModuleGraph graphs and related structures (HPT, EPS) are performance critical in the sense that somewhat simple mistakes can cause bad leaks and non-linear memory usage, we want to have proper APIs that guide efficient usage. This is a good step in that direction.
Showing
- compiler/GHC.hs 2 additions, 2 deletionscompiler/GHC.hs
- compiler/GHC/Driver/Env.hs 7 additions, 5 deletionscompiler/GHC/Driver/Env.hs
- compiler/GHC/Driver/Main.hs 2 additions, 2 deletionscompiler/GHC/Driver/Main.hs
- compiler/GHC/Driver/Make.hs 44 additions, 41 deletionscompiler/GHC/Driver/Make.hs
- compiler/GHC/Unit/Module/Graph.hs 357 additions, 242 deletionscompiler/GHC/Unit/Module/Graph.hs
- compiler/GHC/Unit/Module/ModSummary.hs 8 additions, 1 deletioncompiler/GHC/Unit/Module/ModSummary.hs
- testsuite/tests/ghc-api/downsweep/OldModLocation.hs 1 addition, 1 deletiontestsuite/tests/ghc-api/downsweep/OldModLocation.hs
- testsuite/tests/ghc-api/downsweep/PartialDownsweep.hs 1 addition, 1 deletiontestsuite/tests/ghc-api/downsweep/PartialDownsweep.hs
Loading
Please register or sign in to comment