--
-- Binary interface file support.
-module BinIface ( writeBinIface, compileIface ) where
+module BinIface ( writeBinIface ) where
import HscTypes
import BasicTypes
import Class
import VarEnv
import CostCentre
-import Module ( mkHomeModule )
import Name ( Name, nameOccName )
import NameEnv ( NameEnv, lookupNameEnv, nameEnvElts )
import OccName ( OccName )
import RnMonad ( ParsedIface(..) )
import RnHsSyn
import DriverState ( v_Build_tag )
-import DriverUtil ( newsuf )
-import Lex
import CmdLineOpts ( opt_IgnoreIfacePragmas, opt_HiVersion )
import StringBuffer ( hGetStringBuffer )
-import ParseIface ( parseIface )
-import Outputable
import Panic
import SrcLoc
putBinFileWithDict hi_path (mi_module mod_iface) mod_iface
-- ----------------------------------------------------------------------------
--- Compile an interface from text into binary
-
-compileIface :: FilePath -> IO ()
-compileIface infile = do
- let outfile = newsuf "hi" infile -- make it a .hi file
- buf <- hGetStringBuffer False infile
- case parseIface buf (mkPState loc exts) of
- PFailed err -> throwDyn (ProgramError (showSDoc err))
- POk _ iface ->
- putBinFileWithDict outfile (mkHomeModule (pi_mod iface)) iface
- where
- exts = ExtFlags {glasgowExtsEF = True,
- parrEF = True}
- loc = mkSrcLoc (FastString.mkFastString infile) 1
-
{-* Generated by DrIFT-v1.0 : Look, but Don't Touch. *-}
-- Imported from other files :-