X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Fmain%2FDriverPhases.hs;h=64344958e501387377f932101b5a3d0f291849d1;hb=b4a2e1ebadb91edd8a2099a9d55df98ba463cc64;hp=bd1b1762df55120733a544aa843d8b1aa0a5515c;hpb=8a097699a0fe3493286391cb9d59208f2cf0733f;p=ghc-hetmet.git diff --git a/ghc/compiler/main/DriverPhases.hs b/ghc/compiler/main/DriverPhases.hs index bd1b176..6434495 100644 --- a/ghc/compiler/main/DriverPhases.hs +++ b/ghc/compiler/main/DriverPhases.hs @@ -1,18 +1,22 @@ ----------------------------------------------------------------------------- --- $Id: DriverPhases.hs,v 1.6 2001/02/27 15:25:18 simonmar Exp $ +-- $Id: DriverPhases.hs,v 1.16 2002/03/04 17:01:30 simonmar Exp $ -- -- GHC Driver -- --- (c) Simon Marlow 2000 +-- (c) The University of Glasgow 2002 -- ----------------------------------------------------------------------------- +#include "../includes/config.h" + module DriverPhases ( Phase(..), startPhase, -- :: String -> Phase phaseInputExt, -- :: Phase -> String haskellish_file, haskellish_suffix, + haskellish_src_file, haskellish_src_suffix, + hsbootish_file, hsbootish_suffix, objish_file, objish_suffix, cish_file, cish_suffix ) where @@ -38,26 +42,35 @@ data Phase = MkDependHS -- haskell dependency generation | Unlit | Cpp + | HsPp | Hsc + | HsBoot | Cc | HCc -- Haskellised C (as opposed to vanilla C) compilation -#ifdef ILX - | Ilx -- .NET extended IL -#endif | Mangle -- assembly mangling, now done by a separate script. | SplitMangle -- after mangler if splitting | SplitAs | As - | Ln + | Ln +#ifdef ILX + | Ilx2Il + | Ilasm +#endif deriving (Eq, Show) -- the first compilation phase for a given file is determined -- by its suffix. startPhase "lhs" = Unlit startPhase "hs" = Cpp +startPhase "hscpp" = HsPp startPhase "hspp" = Hsc +startPhase "hs-boot" = HsBoot startPhase "hc" = HCc startPhase "c" = Cc +startPhase "cpp" = Cc +startPhase "C" = Cc +startPhase "cc" = Cc +startPhase "cxx" = Cc startPhase "raw_s" = Mangle startPhase "s" = As startPhase "S" = As @@ -68,21 +81,26 @@ startPhase _ = Ln -- all unknown file types -- the input requirements of the next phase. phaseInputExt Unlit = "lhs" phaseInputExt Cpp = "lpp" -- intermediate only +phaseInputExt HsPp = "hscpp" phaseInputExt Hsc = "hspp" phaseInputExt HCc = "hc" phaseInputExt Cc = "c" -#ifdef ILX -phaseInputExt Ilx = "ilx" -#endif phaseInputExt Mangle = "raw_s" phaseInputExt SplitMangle = "split_s" -- not really generated phaseInputExt As = "s" phaseInputExt SplitAs = "split_s" -- not really generated phaseInputExt Ln = "o" phaseInputExt MkDependHS = "dep" +phaseInputExt HsBoot = "hs-boot" +#ifdef ILX +phaseInputExt Ilx2Il = "ilx" +phaseInputExt Ilasm = "il" +#endif -haskellish_suffix = (`elem` [ "hs", "hspp", "lhs", "hc" ]) -cish_suffix = (`elem` [ "c", "s", "S" ]) -- maybe .cc et al.?? +haskellish_suffix = (`elem` [ "hs", "hspp", "hscpp", "lhs", "hc", "raw_s" ]) +haskellish_src_suffix = (`elem` [ "hs", "hspp", "hscpp", "lhs" ]) +cish_suffix = (`elem` [ "c", "cpp", "C", "cc", "cxx", "s", "S" ]) +hsbootish_suffix = (`elem` [ "hs-boot" ]) #if mingw32_TARGET_OS || cygwin32_TARGET_OS objish_suffix = (`elem` [ "o", "O", "obj", "OBJ" ]) @@ -90,6 +108,8 @@ objish_suffix = (`elem` [ "o", "O", "obj", "OBJ" ]) objish_suffix = (`elem` [ "o" ]) #endif -haskellish_file f = haskellish_suffix suf where (_,suf) = splitFilename f -cish_file f = cish_suffix suf where (_,suf) = splitFilename f -objish_file f = objish_suffix suf where (_,suf) = splitFilename f +haskellish_file = haskellish_suffix . getFileSuffix +haskellish_src_file = haskellish_src_suffix . getFileSuffix +cish_file = cish_suffix . getFileSuffix +objish_file = objish_suffix . getFileSuffix +hsbootish_file = hsbootish_suffix . getFileSuffix