DynFlags: Initialize unsafeGlobalDynFlags enough to be useful
authorBen Gamari <bgamari.foss@gmail.com>
Fri, 25 Mar 2016 23:42:11 +0000 (00:42 +0100)
committerBen Gamari <ben@smart-cactus.org>
Fri, 25 Mar 2016 23:42:12 +0000 (00:42 +0100)
commit4e98b4ff98e127aa9ef4fa1e85bdf0efa41f0902
tree9b98d9243dd3c5b4c63291977c9cf5ba09a54e84
parent454585c6802f0de4d23f9f16de591596533503b7
DynFlags: Initialize unsafeGlobalDynFlags enough to be useful

Previously unsafeGlobalDynFlags would bottom if used prior to
initialization. This meant that any attempt to use the pretty-printer
early in the initialization process of the compiler would fail. This is
quite inconvenient.

Here we initialize unsafeGlobalDynFlags with defaultDynFlags, bottoming
only if settings is accessed.

See #11755.

Test Plan: Validate

Reviewers: austin

Reviewed By: austin

Subscribers: thomie, gridaphobe

Differential Revision: https://phabricator.haskell.org/D2036

GHC Trac Issues: #11755
compiler/main/DynFlags.hs