[project @ 2001-05-09 09:38:18 by simonmar]
[ghc-hetmet.git] / ghc / compiler / main / DriverPipeline.hs
index c8bd8e6..6e32929 100644 (file)
@@ -1,5 +1,5 @@
 -----------------------------------------------------------------------------
--- $Id: DriverPipeline.hs,v 1.66 2001/05/08 10:58:48 simonmar Exp $
+-- $Id: DriverPipeline.hs,v 1.68 2001/05/09 09:38:18 simonmar Exp $
 --
 -- GHC Driver
 --
@@ -152,6 +152,7 @@ genPipeline todo stop_flag persistent_output lang filename
    writeIORef v_Object_suf (Just "ilx")
 #endif
    osuf       <- readIORef v_Object_suf
+   hcsuf      <- readIORef v_HC_suf
 
    let
    ----------- -----  ----   ---   --   --  -  -  -
@@ -209,10 +210,10 @@ genPipeline todo stop_flag persistent_output lang filename
        else do
 
    let
-   ----------- -----  ----   ---   --   --  -  -  -
-      myPhaseInputExt Ln = case osuf of Nothing -> phaseInputExt Ln
-                                       Just s  -> s
-      myPhaseInputExt other = phaseInputExt other
+       -- .o and .hc suffixes can be overriden by command-line options:
+      myPhaseInputExt Ln  | Just s <- osuf  = s
+      myPhaseInputExt HCc | Just s <- hcsuf = s
+      myPhaseInputExt other                 = phaseInputExt other
 
       annotatePipeline
         :: [Phase]             -- raw pipeline
@@ -261,8 +262,6 @@ genPipeline todo stop_flag persistent_output lang filename
                 ++ " is incompatible with source file `" ++ filename ++ "'"))
       else do
 
-   print (show pipeline ++ show annotated_pipeline ++ show stop_phase)
-
    return (
      takeWhile (phase_ne stop_phase ) $
      dropWhile (phase_ne start_phase) $