diff options
author | David Feuer <david.feuer@gmail.com> | 2017-12-11 13:03:52 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-12-11 13:03:53 -0500 |
commit | 708ed9ca4dbf372817fe84a2fe486940123bddfb (patch) | |
tree | 30d67b789552b9f017674d4e9f2b6341cc75eede /ghc | |
parent | cafe98345cb5d4b11f2059d60d2f20e976ef4f2a (diff) | |
download | haskell-708ed9ca4dbf372817fe84a2fe486940123bddfb.tar.gz |
Allow users to ignore optimization changes
* Add a new flag, `-fignore-optim-changes`, allowing them to avoid
recompilation if the only changes are to the `-O` level or to
flags controlling optimizations.
* When `-fignore-optim-changes` is *off*, recompile when optimization
flags (e.g., `-fno-full-laziness`) change. Previously, we ignored
these unconditionally when deciding whether to recompile a module.
Reviewers: austin, bgamari, simonmar
Reviewed By: simonmar
Subscribers: duog, carter, simonmar, rwbarton, thomie
GHC Trac Issues: #13604
Differential Revision: https://phabricator.haskell.org/D4123
Diffstat (limited to 'ghc')
-rw-r--r-- | ghc/Main.hs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/ghc/Main.hs b/ghc/Main.hs index 74b017a489..b720dea3db 100644 --- a/ghc/Main.hs +++ b/ghc/Main.hs @@ -179,10 +179,16 @@ main' postLoadMode dflags0 args flagWarnings = do -- can be overriden from the command-line -- XXX: this should really be in the interactive DynFlags, but -- we don't set that until later in interactiveUI - dflags2 | DoInteractive <- postLoadMode = imp_qual_enabled - | DoEval _ <- postLoadMode = imp_qual_enabled + -- We also set -fignore-optim-changes and -fignore-hpc-changes, + -- which are program-level options. Again, this doesn't really + -- feel like the right place to handle this, but we don't have + -- a great story for the moment. + dflags2 | DoInteractive <- postLoadMode = def_ghci_flags + | DoEval _ <- postLoadMode = def_ghci_flags | otherwise = dflags1 - where imp_qual_enabled = dflags1 `gopt_set` Opt_ImplicitImportQualified + where def_ghci_flags = dflags1 `gopt_set` Opt_ImplicitImportQualified + `gopt_set` Opt_IgnoreOptimChanges + `gopt_set` Opt_IgnoreHpcChanges -- The rest of the arguments are "dynamic" -- Leftover ones are presumably files |