Ditch static flags
authorSylvain Henry <sylvain@haskus.fr>
Thu, 2 Feb 2017 19:37:24 +0000 (14:37 -0500)
committerBen Gamari <ben@smart-cactus.org>
Fri, 3 Feb 2017 03:13:53 +0000 (22:13 -0500)
commitbbd3c399939311ec3e308721ab87ca6b9443f358
tree1a398f3857502ab42f350008f83b7c67f0d9ff1e
parent6128b2ffbe36ed2779583e05ee9d817eaafc1c9c
Ditch static flags

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
51 files changed:
compiler/backpack/DriverBkp.hs
compiler/basicTypes/BasicTypes.hs
compiler/basicTypes/Id.hs
compiler/basicTypes/RdrName.hs
compiler/basicTypes/VarEnv.hs
compiler/cmm/CmmParse.y
compiler/coreSyn/CoreLint.hs
compiler/deSugar/Coverage.hs
compiler/ghc.cabal.in
compiler/ghc.mk
compiler/ghci/Linker.hs
compiler/ghci/RtClosureInspect.hs
compiler/hsSyn/HsExpr.hs
compiler/hsSyn/HsTypes.hs
compiler/iface/BinIface.hs
compiler/iface/IfaceSyn.hs
compiler/iface/IfaceType.hs
compiler/iface/LoadIface.hs
compiler/llvmGen/LlvmCodeGen/Base.hs
compiler/main/CmdLineParser.hs
compiler/main/CodeOutput.hs
compiler/main/DriverPipeline.hs
compiler/main/DynFlags.hs
compiler/main/DynFlags.hs-boot
compiler/main/ErrUtils.hs
compiler/main/GHC.hs
compiler/main/StaticFlags.hs [deleted file]
compiler/main/StaticFlags.hs-boot [deleted file]
compiler/main/SysTools.hs
compiler/main/TidyPgm.hs
compiler/simplCore/CoreMonad.hs
compiler/simplCore/SimplCore.hs
compiler/simplStg/SimplStg.hs
compiler/specialise/Rules.hs
compiler/specialise/SpecConstr.hs
compiler/typecheck/TcBackpack.hs
compiler/typecheck/TcDeriv.hs
compiler/typecheck/TcDerivUtils.hs
compiler/typecheck/TcErrors.hs
compiler/typecheck/TcGenDeriv.hs
compiler/typecheck/TcRnDriver.hs
compiler/typecheck/TcRnDriver.hs-boot
compiler/typecheck/TcRnMonad.hs
compiler/typecheck/TcSMonad.hs
compiler/types/OptCoercion.hs
compiler/utils/Outputable.hs
ghc/Main.hs
rts/RtsSymbols.c
testsuite/tests/ghc-api/T10052/T10052.hs
testsuite/tests/plugins/LinkerTicklingPlugin.hs
utils/haddock