hadrian: eliminate most of the remaining big rule enumerations
authorAlp Mestanogullari <alpmestan@gmail.com>
Sat, 8 Dec 2018 04:19:36 +0000 (23:19 -0500)
committerBen Gamari <ben@smart-cactus.org>
Sat, 8 Dec 2018 04:19:38 +0000 (23:19 -0500)
commit665f8b0c778b3a5dac4696f81da0cea88b101ea9
tree1e31d663b6de8468cd064e798efb13d32f5d45a2
parentcb882fc993b4972f7f212b291229ef9e9ade0af9
hadrian: eliminate most of the remaining big rule enumerations

Following what was done to Rules.Library some time ago and to
Rules.Compile recently (D5412), this patch moves more rules away from
the "enumerate a lot of contexts and generate one rule for each" style
and instead uses the "parse data from file path to recover context"
approach. In fact, the only rules left to convert seem to be the ones
from Rules.Generate.

This effectively decreases the pauses described in #15938 further as
well as the amount of allocations and GC that we do, unsurprisingly.
Nowhere as drastically as D5412, though.

Test Plan: perform full build and generate docs

Reviewers: snowleopard, bgamari

Reviewed By: snowleopard

Subscribers: rwbarton, carter

GHC Trac Issues: #15938

Differential Revision: https://phabricator.haskell.org/D5422
hadrian/src/Rules.hs
hadrian/src/Rules/Dependencies.hs
hadrian/src/Rules/Documentation.hs
hadrian/src/Rules/Program.hs
hadrian/src/Rules/Register.hs
hadrian/src/Settings/Default.hs