diff options
author | Edward Z. Yang <ezyang@cs.stanford.edu> | 2017-02-22 19:59:55 -0800 |
---|---|---|
committer | Edward Z. Yang <ezyang@cs.stanford.edu> | 2017-02-23 13:46:08 -0800 |
commit | 0a77cedb914a67b8bd7c4af1f87714dc497fec3e (patch) | |
tree | 8ed6ed0fa2b1d2b1a01156a0141ece1c44577504 /compiler/backpack | |
parent | de805583db457e2ee64468f3ed4cd9092d4ef8c8 (diff) | |
download | haskell-0a77cedb914a67b8bd7c4af1f87714dc497fec3e.tar.gz |
Have --backpack complain if multiple files are passed.
Summary:
At the moment it silently swallows the actual arguments; not good!
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate
Reviewers: rwbarton, bgamari, austin
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D3173
Diffstat (limited to 'compiler/backpack')
-rw-r--r-- | compiler/backpack/DriverBkp.hs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler/backpack/DriverBkp.hs b/compiler/backpack/DriverBkp.hs index 25ef62409e..e14e2d881f 100644 --- a/compiler/backpack/DriverBkp.hs +++ b/compiler/backpack/DriverBkp.hs @@ -51,6 +51,7 @@ import Util import qualified GHC.LanguageExtensions as LangExt +import Panic import Data.List import System.Exit import Control.Monad @@ -63,8 +64,8 @@ import Data.Map (Map) import qualified Data.Map as Map -- | Entry point to compile a Backpack file. -doBackpack :: FilePath -> Ghc () -doBackpack src_filename = do +doBackpack :: [FilePath] -> Ghc () +doBackpack [src_filename] = do -- Apply options from file to dflags dflags0 <- getDynFlags let dflags1 = dflags0 @@ -96,6 +97,8 @@ doBackpack src_filename = do then compileExe lunit else compileUnit cid [] else typecheckUnit cid insts +doBackpack _ = + throwGhcException (CmdLineError "--backpack can only process a single file") computeUnitId :: LHsUnit HsComponentId -> (ComponentId, [(ModuleName, Module)]) computeUnitId (L _ unit) = (cid, [ (r, mkHoleModule r) | r <- reqs ]) |