diff options
author | David Terei <davidterei@gmail.com> | 2011-11-18 14:31:00 -0800 |
---|---|---|
committer | David Terei <davidterei@gmail.com> | 2011-11-22 11:05:14 -0800 |
commit | 508d8e0c31140bbaf99c26faf5fe2e4fa272f170 (patch) | |
tree | c975bc5bec767faf18b9db5bb9ca586a83645e3a /compiler/main/DriverPhases.hs | |
parent | 602545a72a51077519e0e9c706e70bff9ddb5f96 (diff) | |
download | haskell-508d8e0c31140bbaf99c26faf5fe2e4fa272f170.tar.gz |
Better document the driver pipeline.
Diffstat (limited to 'compiler/main/DriverPhases.hs')
-rw-r--r-- | compiler/main/DriverPhases.hs | 90 |
1 files changed, 45 insertions, 45 deletions
diff --git a/compiler/main/DriverPhases.hs b/compiler/main/DriverPhases.hs index 2a0785d499..6ece67e8c8 100644 --- a/compiler/main/DriverPhases.hs +++ b/compiler/main/DriverPhases.hs @@ -85,9 +85,9 @@ data Phase | Cobjc | Cobjcpp | HCc -- Haskellised C (as opposed to vanilla C) compilation - | SplitMangle -- after mangler if splitting - | SplitAs - | As + | Splitter -- Assembly file splitter (part of '-split-objs') + | SplitAs -- Assembler for split assembly files (part of '-split-objs') + | As -- Assembler for regular assembly files | LlvmOpt -- Run LLVM opt tool over llvm assembly | LlvmLlc -- LLVM bitcode to native assembly | LlvmMangle -- Fix up TNTC by processing assembly produced by LLVM @@ -113,26 +113,26 @@ isStopLn _ = False eqPhase :: Phase -> Phase -> Bool -- Equality of constructors, ignoring the HscSource field -- NB: the HscSource field can be 'bot'; see anyHsc above -eqPhase (Unlit _) (Unlit _) = True -eqPhase (Cpp _) (Cpp _) = True -eqPhase (HsPp _) (HsPp _) = True -eqPhase (Hsc _) (Hsc _) = True -eqPhase Ccpp Ccpp = True -eqPhase Cc Cc = True -eqPhase Cobjc Cobjc = True -eqPhase Cobjcpp Cobjcpp = True -eqPhase HCc HCc = True -eqPhase SplitMangle SplitMangle = True -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 MergeStub MergeStub = True -eqPhase StopLn StopLn = True -eqPhase _ _ = False +eqPhase (Unlit _) (Unlit _) = True +eqPhase (Cpp _) (Cpp _) = True +eqPhase (HsPp _) (HsPp _) = True +eqPhase (Hsc _) (Hsc _) = True +eqPhase Ccpp Ccpp = True +eqPhase Cc Cc = True +eqPhase Cobjc Cobjc = True +eqPhase Cobjcpp Cobjcpp = True +eqPhase HCc HCc = True +eqPhase Splitter Splitter = True +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 MergeStub MergeStub = True +eqPhase StopLn StopLn = True +eqPhase _ _ = False -- 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 @@ -145,25 +145,25 @@ x `happensBefore` y = after_x `eqPhase` y || after_x `happensBefore` y nextPhase :: Phase -> Phase -- A conservative approximation to the next phase, used in happensBefore -nextPhase (Unlit sf) = Cpp sf -nextPhase (Cpp sf) = HsPp sf -nextPhase (HsPp sf) = Hsc sf -nextPhase (Hsc _) = HCc -nextPhase SplitMangle = As -nextPhase As = SplitAs -nextPhase LlvmOpt = LlvmLlc -nextPhase LlvmLlc = LlvmMangle -nextPhase LlvmMangle = As -nextPhase SplitAs = MergeStub -nextPhase Ccpp = As -nextPhase Cc = As -nextPhase Cobjc = As -nextPhase Cobjcpp = As -nextPhase CmmCpp = Cmm -nextPhase Cmm = HCc -nextPhase HCc = As -nextPhase MergeStub = StopLn -nextPhase StopLn = panic "nextPhase: nothing after StopLn" +nextPhase (Unlit sf) = Cpp sf +nextPhase (Cpp sf) = HsPp sf +nextPhase (HsPp sf) = Hsc sf +nextPhase (Hsc _) = HCc +nextPhase Splitter = SplitAs +nextPhase LlvmOpt = LlvmLlc +nextPhase LlvmLlc = LlvmMangle +nextPhase LlvmMangle = As +nextPhase SplitAs = MergeStub +nextPhase As = MergeStub +nextPhase Ccpp = As +nextPhase Cc = As +nextPhase Cobjc = As +nextPhase Cobjcpp = As +nextPhase CmmCpp = Cmm +nextPhase Cmm = HCc +nextPhase HCc = As +nextPhase MergeStub = StopLn +nextPhase StopLn = panic "nextPhase: nothing after StopLn" -- the first compilation phase for a given file is determined -- by its suffix. @@ -184,7 +184,7 @@ startPhase "M" = Cobjcpp startPhase "mm" = Cobjcpp startPhase "cc" = Ccpp startPhase "cxx" = Ccpp -startPhase "split_s" = SplitMangle +startPhase "split_s" = Splitter startPhase "s" = As startPhase "S" = As startPhase "ll" = LlvmOpt @@ -213,12 +213,12 @@ phaseInputExt Ccpp = "cpp" phaseInputExt Cobjc = "m" phaseInputExt Cobjcpp = "mm" phaseInputExt Cc = "c" -phaseInputExt SplitMangle = "split_s" -- not really generated +phaseInputExt Splitter = "split_s" phaseInputExt As = "s" phaseInputExt LlvmOpt = "ll" phaseInputExt LlvmLlc = "bc" phaseInputExt LlvmMangle = "lm_s" -phaseInputExt SplitAs = "split_s" -- not really generated +phaseInputExt SplitAs = "split_s" phaseInputExt CmmCpp = "cmm" phaseInputExt Cmm = "cmmcpp" phaseInputExt MergeStub = "o" |