X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fmain%2FDriverPhases.hs;h=d85335ff347ad58973f739ef4eff2dd80ce966d7;hb=9c84f11b774960077d33d94a23ebc42af79d2ec4;hp=4e7c05e316eba310930944f7f30cf8e598e3d546;hpb=f1a72b2938cc289c9a3879301ab445ec9efd63dd;p=ghc-hetmet.git diff --git a/compiler/main/DriverPhases.hs b/compiler/main/DriverPhases.hs index 4e7c05e..d85335f 100644 --- a/compiler/main/DriverPhases.hs +++ b/compiler/main/DriverPhases.hs @@ -35,7 +35,7 @@ module DriverPhases ( #include "HsVersions.h" -import Panic ( panic ) +import Outputable import System.FilePath ----------------------------------------------------------------------------- @@ -82,6 +82,7 @@ data Phase | As | LlvmOpt -- Run LLVM opt tool over llvm assembly | LlvmLlc -- LLVM bitcode to native assembly + | LlvmMangle -- Fix up TNTC by processing assembly produced by LLVM | CmmCpp -- pre-process Cmm source | Cmm -- parse & compile Cmm code @@ -90,6 +91,9 @@ data Phase | StopLn -- Stop, but linking will follow, so generate .o file deriving (Eq, Show) +instance Outputable Phase where + ppr p = text (show p) + anyHsc :: Phase anyHsc = Hsc (panic "anyHsc") @@ -113,6 +117,7 @@ eqPhase SplitAs SplitAs = True eqPhase As As = True eqPhase LlvmOpt LlvmOpt = True eqPhase LlvmLlc LlvmLlc = True +eqPhase LlvmMangle LlvmMangle = True eqPhase CmmCpp CmmCpp = True eqPhase Cmm Cmm = True eqPhase StopLn StopLn = True @@ -138,7 +143,12 @@ nextPhase Mangle = SplitMangle nextPhase SplitMangle = As nextPhase As = SplitAs nextPhase LlvmOpt = LlvmLlc +#if darwin_TARGET_OS +nextPhase LlvmLlc = LlvmMangle +#else nextPhase LlvmLlc = As +#endif +nextPhase LlvmMangle = As nextPhase SplitAs = StopLn nextPhase Ccpp = As nextPhase Cc = As @@ -168,6 +178,7 @@ startPhase "s" = As startPhase "S" = As startPhase "ll" = LlvmOpt startPhase "bc" = LlvmLlc +startPhase "lm_s" = LlvmMangle startPhase "o" = StopLn startPhase "cmm" = CmmCpp startPhase "cmmcpp" = Cmm @@ -194,6 +205,7 @@ phaseInputExt SplitMangle = "split_s" -- not really generated phaseInputExt As = "s" phaseInputExt LlvmOpt = "ll" phaseInputExt LlvmLlc = "bc" +phaseInputExt LlvmMangle = "lm_s" phaseInputExt SplitAs = "split_s" -- not really generated phaseInputExt CmmCpp = "cmm" phaseInputExt Cmm = "cmmcpp" @@ -203,7 +215,7 @@ haskellish_src_suffixes, haskellish_suffixes, cish_suffixes, extcoreish_suffixes, haskellish_user_src_suffixes :: [String] haskellish_src_suffixes = haskellish_user_src_suffixes ++ - [ "hspp", "hscpp", "hcr", "cmm" ] + [ "hspp", "hscpp", "hcr", "cmm", "cmmcpp" ] haskellish_suffixes = haskellish_src_suffixes ++ ["hc", "raw_s"] cish_suffixes = [ "c", "cpp", "C", "cc", "cxx", "s", "S", "ll", "bc" ] extcoreish_suffixes = [ "hcr" ]