• Sylvain Henry's avatar
    Ditch static flags · bbd3c399
    Sylvain Henry authored
    This patch converts the 4 lasting static flags (read from the command
    line and unsafely stored in immutable global variables) into dynamic
    flags. Most use cases have been converted into reading them from a DynFlags.
    In cases for which we don't have easy access to a DynFlags, we read from
    'unsafeGlobalDynFlags' that is set at the beginning of each 'runGhc'.
    It's not perfect (not thread-safe) but it is still better as we can
    set/unset these 4 flags before each run when using GHC API.
    Updates haddock submodule.
    Rebased and finished by: bgamari
    Test Plan: validate
    Reviewers: goldfire, erikd, hvr, austin, simonmar, bgamari
    Reviewed By: simonmar
    Subscribers: thomie
    Differential Revision: https://phabricator.haskell.org/D2839
    GHC Trac Issues: #8440
DynFlags.hs 217 KB