Break up `Settings` into smaller structs
authorJohn Ericson <git@JohnEricson.me>
Wed, 22 May 2019 03:00:27 +0000 (23:00 -0400)
committerMarge Bot <ben+marge-bot@smart-cactus.org>
Wed, 29 May 2019 20:06:45 +0000 (16:06 -0400)
commitace2e3350fa7da1f7ebcdb882f1241da10a90c26
treea6ea9a688e3bf1230e8775e9f41a86576a9523b4
parent2d2aa2031b9abc3bff7b5585ab4201948c8bba7d
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.
compiler/ghc.cabal.in
compiler/main/CliOption.hs [new file with mode: 0644]
compiler/main/DynFlags.hs
compiler/main/FileSettings.hs [new file with mode: 0644]
compiler/main/GhcNameVersion.hs [new file with mode: 0644]
compiler/main/Settings.hs [new file with mode: 0644]
compiler/main/SysTools.hs
compiler/main/ToolSettings.hs [new file with mode: 0644]
compiler/utils/Platform.hs