X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Fmain%2FDriverPhases.hs;h=2efe293bd63cfde7e3a882dd3ed1259c6e5f7373;hb=70b6c54b3c140d96b69287f8f400f88a0b7e9c18;hp=9c9794db7c1dff4a847454549c8028cd4d9bd44a;hpb=d9d000465e182da49260b15d477d688b63c12a17;p=ghc-hetmet.git diff --git a/ghc/compiler/main/DriverPhases.hs b/ghc/compiler/main/DriverPhases.hs index 9c9794d..2efe293 100644 --- a/ghc/compiler/main/DriverPhases.hs +++ b/ghc/compiler/main/DriverPhases.hs @@ -1,5 +1,5 @@ ----------------------------------------------------------------------------- --- $Id: DriverPhases.hs,v 1.24 2003/05/21 12:46:19 simonmar Exp $ +-- $Id: DriverPhases.hs,v 1.25 2003/06/04 15:47:59 simonmar Exp $ -- -- GHC Driver -- @@ -11,6 +11,7 @@ module DriverPhases ( Phase(..), + happensBefore, startPhase, -- :: String -> Phase phaseInputExt, -- :: Phase -> String @@ -40,8 +41,7 @@ import DriverUtil -} data Phase - = MkDependHS -- haskell dependency generation - | Unlit + = Unlit | Cpp | HsPp | Hsc @@ -58,6 +58,17 @@ data Phase #endif deriving (Eq, Show) +-- Partial ordering on phases: we want to know which phases will occur before +-- which others. This is used for sanity checking, to ensure that the +-- pipeline will stop at some point (see DriverPipeline.runPipeline). +x `happensBefore` y + | x `elem` haskell_pipe = y `elem` tail (dropWhile (/= x) haskell_pipe) + | x `elem` c_pipe = y `elem` tail (dropWhile (/= x) c_pipe) + | otherwise = False + +haskell_pipe = [Unlit,Cpp,HsPp,Hsc,HCc,Mangle,As,Ln] +c_pipe = [Cc,As,Ln] + -- the first compilation phase for a given file is determined -- by its suffix. startPhase "lhs" = Unlit @@ -90,7 +101,6 @@ phaseInputExt SplitMangle = "split_s" -- not really generated phaseInputExt As = "s" phaseInputExt SplitAs = "split_s" -- not really generated phaseInputExt Ln = "o" -phaseInputExt MkDependHS = "dep" #ifdef ILX phaseInputExt Ilx2Il = "ilx" phaseInputExt Ilasm = "il"