Skip to content

Remove references to driver from GHC.Core.Opt.Simplify

Dominik Peteler requested to merge wip/refactor-latecc into master

This PR is part of #21872.

Changes not directly related to GHC.Core.Opt.Simplify:

  • Removed references to driver from GHC.Core.LateCC
  • Moved CoreToDo to new module GHC.Core.Opt.Pipeline.Types and moved the counting stuff from GHC.Core.Opt.Monad to a new module GHC.Core.Opt.Counting. This is similar to the changes incorporated in !8341.
  • Removed DynFlags from counting functions in GHC.Core.Opt.Counting
  • Removed CoreToDo from GHC.Core.Lint and GHC.CoreToStg.Prep. These changes are also included in !8341.

Changes to the Simplify pass:

  • Renamed GHC.Core.Opt.Simplify to GHC.Core.Opt.Simplify.Iteration and moved Simplify driver from GHC.Core.Opt.Pipeline to GHC.Core.Opt.Simplify
  • Moved SimplMode and FloatEnable to GHC.Core.Opt.Simplify.Env
  • Added TopEnvConfig, SimplifyOpts and SimplifyExprOpts and initialization functions for the latter two in GHC.Driver.Config.Core.Opt.Simplify
  • Also added initialization functions for SimplMode to that module and use those functions for the construction of the Core pipeline.
  • Inlined simplEnvForGHCi in GHC.Driver.Config.Core.Opt.Simplify
  • Removed driver references from all modules in the GHC.Core.Opt.Simplify namespace. In particular, removed DynFlags from SimplMode and SimplTopEnv.
  • Removed logger from SimplMode
  • Re-arranged fields of SimplEnv, SimplTopEnv and SimplMode, TopEnvConfig and wrote note [The environments of the Simplify pass] explaining what goes where.
  • Got rid of CoreDoSimplifyOpts
  • Added a note "The environments of the Simplify pass" explaining the design of SimplMode, TopEnvConfig, SimplEnv and SimplTopEnv
Edited by Dominik Peteler

Merge request reports