... | ... | @@ -8,7 +8,7 @@ Here we are going to look at the compilation of a single module. |
|
|
There is a picture that goes with this description, which appears at the bottom of this page, but you'll probably find it easier to open [this link](commentary/compiler/hsc-pipe) in another window, so you can see it at the same time as reading the text.
|
|
|
|
|
|
|
|
|
Look at the picture first. The yellow boxes are compiler passes, while the blue stuff on the left gives the data type that moves from one phase to the next. The entire pipeline for a single module is run by a module called HscMain (in [compiler/main/HscMain](/trac/ghc/browser/ghc/compiler/main/HscMain)). Here are the steps it goes through:
|
|
|
Look at the picture first. The yellow boxes are compiler passes, while the blue stuff on the left gives the data type that moves from one phase to the next. The entire pipeline for a single module is run by a module called HscMain (in [compiler/main/HscMain.lhs](/trac/ghc/browser/ghc/compiler/main/HscMain.lhs)). Here are the steps it goes through:
|
|
|
|
|
|
- The program is initially parsed into the [big HsSyn type](commentary/compiler/hs-syn-type). `HsSyn` is parameterised over the types of the term variables it contains. The first three passes (the front end) of the compiler work like this:
|
|
|
|
... | ... | |