X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Fmain%2FHscMain.lhs;h=7b1a1025717d014fd3fe0f4598c6db03effde6b3;hb=423d477bfecd490de1449c59325c8776f91d7aac;hp=8187bab03dc57442ce801a8173979a100f76c504;hpb=553e90d9a32ee1b1809430f260c401cc4169c6c7;p=ghc-hetmet.git diff --git a/ghc/compiler/main/HscMain.lhs b/ghc/compiler/main/HscMain.lhs index 8187bab..7b1a102 100644 --- a/ghc/compiler/main/HscMain.lhs +++ b/ghc/compiler/main/HscMain.lhs @@ -6,7 +6,7 @@ \begin{code} module HscMain ( - HscResult(..), hscMain, newHscEnv, hscBufferFrontEnd + HscResult(..), hscMain, newHscEnv, hscCmmFile, hscBufferFrontEnd #ifdef GHCI , hscStmt, hscTcExpr, hscKcType, hscThing, , compileExpr @@ -57,6 +57,7 @@ import CoreToStg ( coreToStg ) import Name ( Name, NamedThing(..) ) import SimplStg ( stg2stg ) import CodeGen ( codeGen ) +import CmmParse ( parseCmmFile ) import CodeOutput ( codeOutput ) import CmdLineOpts @@ -449,6 +450,18 @@ hscBackEnd dflags } +hscCmmFile :: DynFlags -> FilePath -> IO Bool +hscCmmFile dflags filename = do + maybe_cmm <- parseCmmFile dflags filename + case maybe_cmm of + Nothing -> return False + Just cmm -> do + codeOutput dflags no_mod NoStubs noDependencies [cmm] + return True + where + no_mod = panic "hscCmmFile: no_mod" + + myParseModule dflags src_filename = do -------------------------- Parser ---------------- showPass dflags "Parser"