#include "HsVersions.h"
-import Panic ( panic )
+import Outputable
import System.FilePath
-----------------------------------------------------------------------------
| 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
| 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")
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
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
startPhase "S" = As
startPhase "ll" = LlvmOpt
startPhase "bc" = LlvmLlc
+startPhase "lm_s" = LlvmMangle
startPhase "o" = StopLn
startPhase "cmm" = CmmCpp
startPhase "cmmcpp" = Cmm
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"
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" ]