Break up `Settings` into smaller structs
As far as I can tell, the fields within `Settings` aren't *intrinsicly* related. They just happen to be initialized the same way (in particular prior to the rest of `DynFlags`), and that is why they are grouped together. Within `Settings`, however, there are groups of settings that clearly do share something in common, regardless of how they anything is initialized. In the spirit of GHC being a library, where the end cosumer may choose to initialize this configuration in arbitrary ways, I made some new data types for thoses groups internal to `Settings`, and used them to define `Settings` instead. Hopefully this is a baby step towards a general decoupling of the stateful and stateless parts of GHC.
Showing
- compiler/ghc.cabal.in 5 additions, 0 deletionscompiler/ghc.cabal.in
- compiler/main/CliOption.hs 27 additions, 0 deletionscompiler/main/CliOption.hs
- compiler/main/DynFlags.hs 110 additions, 128 deletionscompiler/main/DynFlags.hs
- compiler/main/FileSettings.hs 16 additions, 0 deletionscompiler/main/FileSettings.hs
- compiler/main/GhcNameVersion.hs 11 additions, 0 deletionscompiler/main/GhcNameVersion.hs
- compiler/main/Settings.hs 203 additions, 0 deletionscompiler/main/Settings.hs
- compiler/main/SysTools.hs 77 additions, 62 deletionscompiler/main/SysTools.hs
- compiler/main/ToolSettings.hs 64 additions, 0 deletionscompiler/main/ToolSettings.hs
- compiler/utils/Platform.hs 28 additions, 0 deletionscompiler/utils/Platform.hs
Loading
Please register or sign in to comment