diff options
Diffstat (limited to 'compiler/main/Main.hs')
-rw-r--r-- | compiler/main/Main.hs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/compiler/main/Main.hs b/compiler/main/Main.hs index 0dd1cbee56..55234e7636 100644 --- a/compiler/main/Main.hs +++ b/compiler/main/Main.hs @@ -19,6 +19,7 @@ import CmdLineParser -- Implementations of the various modes (--show-iface, mkdependHS. etc.) import LoadIface ( showIface ) +import HscMain ( newHscEnv ) import DriverPipeline ( oneShot, compileFile ) import DriverMkDepend ( doMkDependHS ) #ifdef GHCI @@ -147,7 +148,7 @@ main = PrintLibdir -> putStrLn (topDir dflags) ShowVersion -> showVersion ShowNumVersion -> putStrLn cProjectVersion - ShowInterface f -> showIface f + ShowInterface f -> doShowIface dflags f DoMake -> doMake session srcs DoMkDependHS -> doMkDependHS session (map fst srcs) StopBefore p -> oneShot dflags p srcs @@ -395,6 +396,15 @@ doMake sess srcs = do when (failed ok_flag) (exitWith (ExitFailure 1)) return () + +-- --------------------------------------------------------------------------- +-- --show-iface mode + +doShowIface :: DynFlags -> FilePath -> IO () +doShowIface dflags file = do + hsc_env <- newHscEnv dflags + showIface hsc_env file + -- --------------------------------------------------------------------------- -- Various banners and verbosity output. |