diff options
author | Ömer Sinan Ağacan <omeragacan@gmail.com> | 2016-06-17 07:54:28 +0000 |
---|---|---|
committer | Ömer Sinan Ağacan <omeragacan@gmail.com> | 2016-06-17 08:31:52 +0000 |
commit | 930a525a5906fdd65ab0c3e804085d5875517a20 (patch) | |
tree | 32e8c25be234f9fd6c2668d94d9bd1a32670af84 /ghc/Main.hs | |
parent | c56f8bd0cfd44a4a6812b62fc5dca3190d3e749f (diff) | |
download | haskell-930a525a5906fdd65ab0c3e804085d5875517a20.tar.gz |
Abort the build when a Core plugin pass is specified in stage1 compiler
This also makes the behavior the same with frontend plugin errors --
frontend was failing with an exception (`CmdLineError`) while the
simplifier was just ignoring plugins. Now we abort with `CmdLineError`
in both cases with a slightly improved error message.
Test Plan:
- add tests (will add tests once #12197 is implemented)
- validate (done)
Reviewers: austin, bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2334
GHC Trac Issues: #11690
Diffstat (limited to 'ghc/Main.hs')
-rw-r--r-- | ghc/Main.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ghc/Main.hs b/ghc/Main.hs index 5605438f63..1a6cbebe3c 100644 --- a/ghc/Main.hs +++ b/ghc/Main.hs @@ -32,6 +32,8 @@ import GHCi.UI ( interactiveUI, ghciWelcomeMsg, defaultGhciSettings ) #ifdef GHCI import DynamicLoading import Plugins +#else +import DynamicLoading ( pluginError ) #endif import Module ( ModuleName ) @@ -841,8 +843,7 @@ dumpPackagesSimple dflags = putMsg dflags (pprPackagesSimple dflags) doFrontend :: ModuleName -> [(String, Maybe Phase)] -> Ghc () #ifndef GHCI -doFrontend _ _ = - throwGhcException (CmdLineError "not built for interactive use") +doFrontend modname _ = pluginError [modname] #else doFrontend modname srcs = do hsc_env <- getSession |