Hooked the C-- CPS pass into the compilation pipeline
[ghc-hetmet.git] / compiler / main / HscMain.lhs
index c86bd48..93324d5 100644 (file)
@@ -75,6 +75,7 @@ import Name           ( Name, NamedThing(..) )
 import SimplStg                ( stg2stg )
 import CodeGen         ( codeGen )
 import CmmParse                ( parseCmmFile )
+import CmmCPS
 import CodeOutput      ( codeOutput )
 import NameEnv          ( emptyNameEnv )
 
@@ -603,10 +604,12 @@ hscCompile cgguts
                       codeGen dflags this_mod data_tycons
                               foreign_stubs dir_imps cost_centre_info
                               stg_binds hpc_info
+         ------------------  Convert to CPS --------------------
+         continuationC <- cmmCPS dflags abstractC
          ------------------  Code output -----------------------
          (stub_h_exists,stub_c_exists)
              <- codeOutput dflags this_mod location foreign_stubs 
-                dependencies abstractC
+                dependencies continuationC
          return stub_c_exists
 
 hscConst :: b -> a -> Comp b
@@ -718,7 +721,8 @@ hscCmmFile dflags filename = do
   case maybe_cmm of
     Nothing -> return False
     Just cmm -> do
-       codeOutput dflags no_mod no_loc NoStubs [] [cmm]
+        continuationC <- cmmCPS dflags [cmm]
+       codeOutput dflags no_mod no_loc NoStubs [] continuationC
        return True
   where
        no_mod = panic "hscCmmFile: no_mod"