From 05dfbd7464b354f9f4eea88700fad5ad551cd368 Mon Sep 17 00:00:00 2001 From: simonmar Date: Fri, 16 Feb 2001 17:35:01 +0000 Subject: [PATCH] [project @ 2001-02-16 17:35:01 by simonmar] Today's doc hacking. --- ghc/docs/users_guide/debugging.sgml | 880 +++++++++++------------- ghc/docs/users_guide/flags.sgml | 86 ++- ghc/docs/users_guide/ghci.sgml | 12 + ghc/docs/users_guide/phases.sgml | 73 +- ghc/docs/users_guide/separate_compilation.sgml | 2 +- ghc/docs/users_guide/ug-book.sgml | 23 +- ghc/docs/users_guide/ug-ent.sgml | 1 + ghc/docs/users_guide/using.sgml | 716 +++++++++++-------- 8 files changed, 942 insertions(+), 851 deletions(-) create mode 100644 ghc/docs/users_guide/ghci.sgml diff --git a/ghc/docs/users_guide/debugging.sgml b/ghc/docs/users_guide/debugging.sgml index e6e8029..76a50a0 100644 --- a/ghc/docs/users_guide/debugging.sgml +++ b/ghc/docs/users_guide/debugging.sgml @@ -1,429 +1,408 @@ - -Debugging the compiler - - - -debugging options (for GHC) - - - -HACKER TERRITORY. HACKER TERRITORY. -(You were warned.) - - - - -Dumping out compiler intermediate structures - - - -dumping GHC intermediates -intermediate passes, output - - - - - - -: - - --hi option -Do generate an interface file. This would normally be used in -conjunction with , which turns off interface generation; -thus: . - - - - -: - - --dshow-passes option -Prints a message to stderr as each pass starts. Gives a warm but -undoubtedly misleading feeling that GHC is telling you what's -happening. - - - - -: - - --ddump-<pass> options -Make a debugging dump after pass <pass> (may be common enough to -need a short form…). You can get all of these at once (lots of -output) by using , or most of them with . -Some of the most useful ones are: - - - - - - -: - - -parser output - - - - - -: - - -renamer output - - - - - -: - - -typechecker output - - - - - -: - - -Dump a type signature for each value defined at the top level -of the module. The list is sorted alphabetically. -Using dumps a type signature for -all the imported and system-defined things as well; useful -for debugging the compiler. - - - - - -: - - -derived instances - - - - -: - - -desugarer output - - - - -: - - -output of specialisation pass - - - - -: - - -dumps all rewrite rules (including those generated by the specialisation pass) - - - - -: - - -simplifer output (Core-to-Core passes) - - - - -: - - -UsageSP inference pre-inf and output - - - - -: - - -CPR analyser output - - - - -: - - -strictness analyser output - - - - -: - - -worker/wrapper split output - - - - -: - - -`occurrence analysis' output - - - - -: - - -output of STG-to-STG passes - - - - -: - - -unflattened Abstract C - - - - -: - - -flattened Abstract C - - - - -: - - -same as what goes to the C compiler - - - - -: - - -assembly language from the native-code generator - - - - --ddump-all option --ddump-most option --ddump-parsed option --ddump-rn option --ddump-tc option --ddump-deriv option --ddump-ds option --ddump-simpl option --ddump-cpranal option --ddump-workwrap option --ddump-rules option --ddump-usagesp option --ddump-stranal option --ddump-occur-anal option --ddump-spec option --ddump-stg option --ddump-absC option --ddump-flatC option --ddump-realC option --ddump-asm option - - - - - and : - - --dverbose-simpl option --dverbose-stg option -Show the output of the intermediate Core-to-Core and STG-to-STG -passes, respectively. (Lots of output!) So: when we're -really desperate: - - + + Debugging the compiler + + debugging options (for GHC) + + HACKER TERRITORY. HACKER TERRITORY. (You were warned.) + + + Dumping out compiler intermediate structures + + dumping GHC intermediates + intermediate passes, output + + + + pass + options + + Make a debugging dump after pass + <pass> (may be common enough to need + a short form…). You can get all of these at once + (lots of output) by using + , or most of them with + . Some of the most useful ones + are: + + + + : + + parser output + + + + + : + + renamer output + + + + + : + + typechecker output + + + + + : + + Dump a type signature for each value defined at + the top level of the module. The list is sorted + alphabetically. Using + dumps a type signature for all the imported and + system-defined things as well; useful for debugging the + compiler. + + + + + : + + derived instances + + + + + : + + desugarer output + + + + + : + + output of specialisation pass + + + + + : + + dumps all rewrite rules (including those generated + by the specialisation pass) + + + + + : + + simplifer output (Core-to-Core passes) + + + + + : + + inlining info from the simplifier + + + + + : + + UsageSP inference pre-inf and output + + + + + : + + CPR analyser output + + + + + : + + strictness analyser output + + + + + : + + CSE pass output + + + + + : + + worker/wrapper split output + + + + + : + + `occurrence analysis' output + + + + + : + + output of “saturate” pass + + + + + : + + output of STG-to-STG passes + + + + + : + + unflattened Abstract C + + + + + : + + flattened Abstract C + + + + + : + + same as what goes to the C compiler + + + + + : + + native-code generator intermediate form + + + + + : + + assembly language from the native-code generator + + + + + : + + byte code compiler output + + + + + : + + dump foreign export stubs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Show the output of the intermediate Core-to-Core and + STG-to-STG passes, respectively. (Lots + of output!) So: when we're really desperate: + + % ghc -noC -O -ddump-simpl -dverbose-simpl -dcore-lint Foo.hs - - - - -: - - --ddump-simpl-iterations option -Show the output of each iteration of the simplifier (each run of -the simplifier has a maximum number of iterations, normally 4). Used -when even doesn't cut it. - - - - -}: - - --dppr-user option --dppr-debug option -Debugging output is in one of several “styles.” Take the printing -of types, for example. In the “user” style, the compiler's internal -ideas about types are presented in Haskell source-level syntax, -insofar as possible. In the “debug” style (which is the default for -debugging output), the types are printed in with -explicit foralls, and variables have their unique-id attached (so you -can check for things that look the same but aren't). - - - - -: - - --ddump-simpl-stats option -Dump statistics about how many of each kind -of transformation too place. If you add you get more detailed information. - - - - -: - - --ddump-raw-asm option -Dump out the assembly-language stuff, before the “mangler” gets it. - - - - -: - - --ddump-rn-trace -Make the renamer be *real* chatty about what it is upto. - - - - -: - - --dshow-rn-stats -Print out summary of what kind of information the renamer had to bring -in. - - - - -: - - --dshow-unused-imports -Have the renamer report what imports does not contribute. - - - - - - - - - -Checking for consistency - - - -consistency checks -lint - - - - - - -: - - --dcore-lint option -Turn on heavyweight intra-pass sanity-checking within GHC, at Core -level. (It checks GHC's sanity, not yours.) - - - - -: - - --dstg-lint option -Ditto for STG level. - - - - -: - - --dstg-lint option -Turn on checks around UsageSP inference (). This verifies -various simple properties of the results of the inference, and also -warns if any identifier with a used-once annotation before the -inference has a used-many annotation afterwards; this could indicate a -non-worksafe transformation is being applied. - - - - - - - - - -How to read Core syntax (from some <Option>-ddump-*</Option> flags) - - -reading Core syntax -Core syntax, how to read - - - -Let's do this by commenting an example. It's from doing - on this code: + + + + + : + + + Show the output of each iteration + of the simplifier (each run of the simplifier has a maximum + number of iterations, normally 4). Used when even + doesn't cut it. + + + + + + + + Debugging output is in one of several + “styles.” Take the printing of types, for + example. In the “user” style (the default), the + compiler's internal ideas about types are presented in + Haskell source-level syntax, insofar as possible. In the + “debug” style (which is the default for + debugging output), the types are printed in with explicit + foralls, and variables have their unique-id attached (so you + can check for things that look the same but aren't). This + flag makes debugging output appear in the more verbose debug + style. + + + + + + + + In error messages, expressions are printed to a + certain “depth”, with subexpressions beyond the + depth replaced by ellipses. This flag sets the + depth. + + + + + + + + Dump statistics about how many of each kind of + transformation too place. If you add + you get more detailed + information. + + + + + + + + Make the renamer be *real* chatty about what it is + upto. + + + + + + + + Print out summary of what kind of information the renamer + had to bring in. + + + + + + + + Have the renamer report what imports does not + contribute. + + + + + + + Checking for consistency + + consistency checks + lint + + + + + + + + Turn on heavyweight intra-pass sanity-checking within + GHC, at Core level. (It checks GHC's sanity, not yours.) + + + + + : + + + Ditto for STG level. (NOTE: currently doesn't work). + + + + + : + + + Turn on checks around UsageSP inference + (). This verifies various simple + properties of the results of the inference, and also warns + if any identifier with a used-once annotation before the + inference has a used-many annotation afterwards; this could + indicate a non-worksafe transformation is being + applied. + + + + + + + How to read Core syntax (from some <option>-ddump</option> + flags) + + reading Core syntax + Core syntax, how to read + + Let's do this by commenting an example. It's from doing + on this code: skip2 m = m : skip2 (m+2) - - - -Before we jump in, a word about names of things. Within GHC, -variables, type constructors, etc., are identified by their -“Uniques.” These are of the form `letter' plus `number' (both -loosely interpreted). The `letter' gives some idea of where the -Unique came from; e.g., _ means “built-in type variable”; -t means “from the typechecker”; s means “from the -simplifier”; and so on. The `number' is printed fairly compactly in -a `base-62' format, which everyone hates except me (WDP). - - - -Remember, everything has a “Unique” and it is usually printed out -when debugging, in some form or another. So here we go… - - - + Before we jump in, a word about names of things. Within GHC, + variables, type constructors, etc., are identified by their + “Uniques.” These are of the form `letter' plus + `number' (both loosely interpreted). The `letter' gives some idea + of where the Unique came from; e.g., _ + means “built-in type variable”; t + means “from the typechecker”; s + means “from the simplifier”; and so on. The `number' + is printed fairly compactly in a `base-62' format, which everyone + hates except me (WDP). + + Remember, everything has a “Unique” and it is + usually printed out when debugging, in some form or another. So + here we go… + Desugared: Main.skip2{-r1L6-} :: _forall_ a$_4 =>{{Num a$_4}} -> a$_4 -> [a$_4] @@ -495,68 +474,11 @@ Main.skip2{-r1L6-} = {- end CoRec -} } in skip2.t3Ja - - - -(“It's just a simple functional language” is an unregisterised -trademark of Peyton Jones Enterprises, plc.) - - - - - -Command line options in source files - - - -source-file options - - - -Sometimes it is useful to make the connection between a source file -and the command-line options it requires quite tight. For instance, -if a (Glasgow) Haskell source file uses casms, the C back-end -often needs to be told about which header files to include. Rather than -maintaining the list of files the source depends on in a -Makefile (using the command-line option), it is -possible to do this directly in the source file using the OPTIONS -pragma OPTIONS pragma: - - - - -{-# OPTIONS -#include "foo.h" #-} -module X where -... - - - - -OPTIONS pragmas are only looked for at the top of your source -files, upto the first (non-literate,non-empty) line not containing -OPTIONS. Multiple OPTIONS pragmas are recognised. Note -that your command shell does not get to the source file options, they -are just included literally in the array of command-line arguments -the compiler driver maintains internally, so you'll be desperately -disappointed if you try to glob etc. inside OPTIONS. - - - -NOTE: the contents of OPTIONS are prepended to the command-line -options, so you do have the ability to override OPTIONS settings -via the command line. - - - -It is not recommended to move all the contents of your Makefiles into -your source files, but in some circumstances, the OPTIONS pragma -is the Right Thing. (If you use and have OPTION -flags in your module, the OPTIONS will get put into the generated .hc -file). - - - + (“It's just a simple functional language” is an + unregisterised trademark of Peyton Jones Enterprises, plc.) + + Unregisterised compilation diff --git a/ghc/docs/users_guide/flags.sgml b/ghc/docs/users_guide/flags.sgml index 751221d..3efd5ca 100644 --- a/ghc/docs/users_guide/flags.sgml +++ b/ghc/docs/users_guide/flags.sgml @@ -1,6 +1,11 @@ - + Flag reference + This section is a quick-reference for GHC's command-line + flags. For each flag, we also list its static/dynamic status (see + ), and the flag's opposite + (if available). + Help and verbosity options (<xref linkend="options-help">) @@ -71,12 +76,6 @@ - - Run the C pre-processor on the Haskell source - dynamic - - - - Stop after preprocessing (.hspp file) static @@ -100,18 +99,6 @@ static - - - - Use the native code generator - dynamic - -fvia-C - - - - Compile via C - dynamic - -fasm - @@ -324,7 +311,7 @@ Turn off recompilation checking static - -recomp + @@ -935,6 +922,12 @@ + + Run the C pre-processor on Haskell source files + dynamic + - + + symbol=value Define a symbol in the C pre-processor dynamic @@ -984,6 +977,37 @@ + Code generation options (<xref linkend="options-codegen">) + + + + + + Flag + Description + Static/Dynamic + Reverse + + + + + + Use the native code generator + dynamic + -fvia-C + + + + Compile via C + dynamic + -fasm + + + + + + + Linking options (<xref linkend="options-linker">) @@ -1197,12 +1221,6 @@ - - - (HPPA only) enable long call support - static - - - - (x86 only) give some registers back to the C compiler dynamic @@ -1283,7 +1301,7 @@ - Dump FFI-related output + Dump foreign export stubs dynamic - @@ -1384,12 +1402,6 @@ - - - (equivalent to ) - dynamic - - - - Trace renamer dynamic @@ -1467,6 +1479,12 @@ dynamic - + + + Enable unregisterised compilation + static + - + @@ -1566,7 +1584,7 @@ Misc: , ( "H" , HasArg (setHeapSize . fromIntegral . decodeSize) ) , ( "Rghc-timing" , NoArg (enableTimingStats) ) - , ( "unreg" , NoArg (addNoDups v_Ways WayUnreg) ) + -Bdir --> diff --git a/ghc/docs/users_guide/phases.sgml b/ghc/docs/users_guide/phases.sgml index a0e1994..e29ac04 100644 --- a/ghc/docs/users_guide/phases.sgml +++ b/ghc/docs/users_guide/phases.sgml @@ -41,15 +41,23 @@ C pre-processor options cpp, pre-processing with - The C pre-processor cpp is run over - your Haskell code only if the option - -cpp option is given. - Unless you are building a large system with significant doses of - conditional compilation, you really shouldn't need it. - + + + + The C pre-processor cpp is run + over your Haskell code only if the + option -cpp + option is given. Unless you are + building a large system with significant doses of + conditional compilation, you really shouldn't need + it. + + + + symbol=value @@ -203,28 +211,6 @@ strmod = "\ C compiler options GCC options - - - - - Flag - Description - Static/Dynamic - Reverse - - - - - file - Include file when - compiling the .hc file - dynamic - - - - - - - If you are compiling with lots of foreign calls, you may need to tell the C compiler about some #include files. There is no real pretty @@ -237,6 +223,37 @@ strmod = "\ + + Options affecting code generation + + + + + + + Use GHC's native code generator rather than + compiling via C. This will compile faster (up to twice as + fast), but may produce code that is slightly slower than + compiling via C. is the default + when optimisation is off (see ). + + + + + + + + + Compile via C instead of using the native code + generator. This is default for optimised compilations, + and on architectures for which GHC doesn't have a native + code generator. + + + + + Options affecting linking diff --git a/ghc/docs/users_guide/separate_compilation.sgml b/ghc/docs/users_guide/separate_compilation.sgml index c124eb2..b49a109 100644 --- a/ghc/docs/users_guide/separate_compilation.sgml +++ b/ghc/docs/users_guide/separate_compilation.sgml @@ -7,7 +7,7 @@ This section describes how GHC supports separate compilation. - + Interface files diff --git a/ghc/docs/users_guide/ug-book.sgml b/ghc/docs/users_guide/ug-book.sgml index 34956df..a410ed9 100644 --- a/ghc/docs/users_guide/ug-book.sgml +++ b/ghc/docs/users_guide/ug-book.sgml @@ -6,14 +6,15 @@ -&license -&intro -&installing -&using -&prof -&sooner -&lang-features -&ffi-chap -&wrong -&utils -&win32-dll +&license; +&intro; +&installing; +&using; +&ghci; +&prof; +&sooner; +&lang-features; +&ffi-chap; +&wrong; +&utils; +&win32-dll; diff --git a/ghc/docs/users_guide/ug-ent.sgml b/ghc/docs/users_guide/ug-ent.sgml index 22b24ac..6b6007b 100644 --- a/ghc/docs/users_guide/ug-ent.sgml +++ b/ghc/docs/users_guide/ug-ent.sgml @@ -1,3 +1,4 @@ + diff --git a/ghc/docs/users_guide/using.sgml b/ghc/docs/users_guide/using.sgml index 1b20b0d..125177c 100644 --- a/ghc/docs/users_guide/using.sgml +++ b/ghc/docs/users_guide/using.sgml @@ -1,140 +1,246 @@ - -Using GHC - + + Using GHC - -GHC, using -using GHC -GHC is a command-line compiler: in order to compile a Haskell program, -GHC must be invoked on the source file(s) by typing a command to the -shell. The steps involved in compiling a program can be automated -using the make tool (this is especially useful if the program -consists of multiple source files which depend on each other). This -section describes how to use GHC from the command-line. - + GHC, using + using GHC - -Overall command-line structure - + GHC can work in one of three “modes”: - -structure, command-line -command-line structure - + + + ghc + --interactive + + interactive mode + + ghci + + + Interactive mode, which is also available as + ghci. Interactive mode is described in + more detail in . + + - -An invocation of GHC takes the following form: - + + ghc + --make + + make mode + + + + + In this mode, GHC will build a multi-module Haskell + program automatically, figuring out dependencies for itself. + If you have a straightforward Haskell program, this is + likely to be much easier, and faster, than using + make. + + - + + + ghc + + -E + -C + -S + -c + + + + + + This is the traditional batch-compiler mode, in which + GHC can compile source files one at a time, or link objects + together into an executable. + + + + + + Options overview + + GHC's behaviour is controlled by + options, which for historical reasons are + also sometimes referred to as command-line flags or arguments. + Options can be specified in three ways: + + + Command-line arguments + + structure, command-line + command-linearguments + argumentscommand-line + + An invocation of GHC takes the following form: ghc [argument...] - + Command-line arguments are either options or file names. + + Command-line options begin with -. + They may not be grouped: + is different from . + Options need not precede filenames: e.g., ghc *.o -o + foo. All options are processed and then applied to + all files; you cannot, for example, invoke ghc -c -O1 + Foo.hs -O2 Bar.hs to apply different optimisation + levels to the files Foo.hs and + Bar.hs. + - -Command-line arguments are either options or file names. - + + Command line options in source files + + source-file options + + Sometimes it is useful to make the connection between a + source file and the command-line options it requires quite + tight. For instance, if a Haskell source file uses GHC + extensions, it will always need to be compiled with the + option. Rather than maintaining + the list of per-file options in a Makefile, + it is possible to do this directly in the source file using the + OPTIONS pragma OPTIONS + pragma: - -Command-line options begin with -. They may not be -grouped: is different from . Options need not -precede filenames: e.g., ghc *.o -o foo. All options are -processed and then applied to all files; you cannot, for example, invoke -ghc -c -O1 Foo.hs -O2 Bar.hs to apply different optimisation -levels to the files Foo.hs and Bar.hs. For conflicting -options, e.g., , we reserve the right to do anything we -want. (Usually, the last one applies.) - + +{-# OPTIONS -fglasgow-exts #-} +module X where +... + + + OPTIONS pragmas are only looked for at + the top of your source files, upto the first + (non-literate,non-empty) line not containing + OPTIONS. Multiple OPTIONS + pragmas are recognised. Note that your command shell does not + get to the source file options, they are just included literally + in the array of command-line arguments the compiler driver + maintains internally, so you'll be desperately disappointed if + you try to glob etc. inside OPTIONS. + + NOTE: the contents of OPTIONS are prepended to the + command-line options, so you do have the + ability to override OPTIONS settings via the command + line. + + It is not recommended to move all the contents of your + Makefiles into your source files, but in some circumstances, the + OPTIONS pragma is the Right Thing. (If you + use and have OPTION flags in + your module, the OPTIONS will get put into the generated .hc + file). + - + + Setting options in GHCi - -Meaningful file suffixes - + Options may also be modified from within GHCi, using the + :set command. See + for more details. + + + + + Static vs. Dynamic options + staticoptions + + dynamicoptions + + + Each of GHC's command line options is classified as either + static or dynamic. + A static flag may only be specified on the command line, whereas a + dynamic flag may also be given in an OPTIONS + pragma in a source file or set from the GHCi command-line with + :set. + + As a rule of thumb, all the language options are dynamic, as + are the warning options and the debugging options. The rest are + static, with the notable exceptions of , + , , + , and . + + The flag reference tables () lists + the status of each flag. + - -suffixes, file -file suffixes for GHC - + + Meaningful file suffixes - -File names with “meaningful” suffixes (e.g., .lhs or .o) -cause the “right thing” to happen to those files. - + suffixes, file + file suffixes for GHC - - + File names with “meaningful” suffixes (e.g., + .lhs or .o) cause the + “right thing” to happen to those files. - -.lhs: - - -lhs suffix -A “literate Haskell” module. - - - - -.hs: - - -A not-so-literate Haskell module. - - - - -.hi: - - -A Haskell interface file, probably compiler-generated. - - - - -.hc: - - -Intermediate C file produced by the Haskell compiler. - - - - -.c: - - -A C file not produced by the Haskell compiler. - - - - -.s: - - -An assembly-language source file, usually -produced by the compiler. - - - - -.o: - - -An object file, produced by an assembler. - - - - - + - -Files with other suffixes (or without suffixes) are passed straight -to the linker. - + + .lhs + lhs suffix + + A “literate Haskell” module. + + - + + .hs + + A not-so-literate Haskell module. + + + + + .hi + + A Haskell interface file, probably + compiler-generated. + + + + + .hc + + Intermediate C file produced by the Haskell + compiler. + + + + + .c + + A C file not produced by the Haskell + compiler. + + + + + .s + + An assembly-language source file, usually produced by + the compiler. + + + + + .o + + An object file, produced by an assembler. + + + + + Files with other suffixes (or without suffixes) are passed + straight to the linker. + + Help and verbosity options @@ -249,145 +355,169 @@ to the linker. - - - Running the right phases in the right order - order of passes in GHC - pass ordering in GHC + + Using <command>ghc</command> <option>--make</option> + + + separate compilation + + + When given the option, GHC will + build a multi-module Haskell program by following dependencies + from a single root module (usually Main). For + example, if your Main module is in a file + called Main.hs, you could compile and link + the program like this: + + +ghc --make Main.hs + + + The command line must contain one source file or module + name; GHC will figure out all the modules in the program by + following the imports from this initial module. It will then + attempt to compile each module which is out of date, and finally + if the top module is Main, the program + will also be linked into an executable. + + The main advantages to using ghc --make + over traditional Makefiles are: + + + + GHC doesn't have to be restarted for each compilation, + which means it can cache information between compilations. + Compiling a muli-module program with ghc + --make can be up to twice as fast as running + ghc individually on each source + file. + + + You don't have to write a + Makefile. + + Makefilesavoiding + + + GHC re-calculates the dependencies each time it is + invoked, so the dependencies never get out of sync with the + source. + + + + Any of the command-line options described in the rest of + this chapter can be used with , but note + that any options you give on the command line will apply to all + the source files compiled, so if you want any options to apply to + a single source file only, you'll need to use an + OPTIONS pragma (see ). + + If the program needs to be linked with additional objects + (say, some auxilliary C code), these can be specified on the + command line as usual. + + + + GHC without <option>--make</option> - The basic task of the ghc driver is to - run each input file through the right phases (compiling, linking, - etc.). + Without , GHC will compile one or + more source files given on the command line. - The first phase to run is determined by the input-file + The first phase to run is determined by each input-file suffix, and the last phase is determined by a flag. If no relevant flag is present, then go all the way through linking. This table summarises: - - - - - - - - - -Phase of the compilation system -Suffix saying “start here” -Flag saying “stop after” -(suffix of) output file - - - - -literate pre-processor - .lhs - - - .hs - - - -C pre-processor (opt.) - .hs (with -cpp) - -E - .hspp - - - -Haskell compiler - .hs - -C, -S - .hc, .s - - - -C compiler (opt.) - .hc or .c - -S - .s - - - -assembler - .s - -c - .o - - - -linker - other - - - a.out - - - - - --C option --S option --c option - - -Thus, a common invocation would be: ghc -c Foo.hs - - - -Note: What the Haskell compiler proper produces depends on whether a -native-code generator is used (producing assembly language) or not -(producing C). - - - NOTE: the option -E + + + + + + + + + + Phase of the compilation system + Suffix saying “start here” + Flag saying “stop after” + (suffix of) output file + + + + + literate pre-processor + .lhs + - + .hs + + + + C pre-processor (opt.) + + .hs (with + ) + + .hspp + + + + Haskell compiler + .hs + , + .hc, .s + + + + C compiler (opt.) + .hc or .c + + .s + + + + assembler + .s + + .o + + + + linker + other + - + a.out + + + + + + + + + + + Thus, a common invocation would be: ghc -c + Foo.hs + + Note: What the Haskell compiler proper produces depends on + whether a native-code generatornative-code + generator is used (producing assembly + language) or not (producing C). See for more details. + + Note: C pre-processing is optional, the + + flag turns it on. See for more details. + + Note: The option -E option runs just the pre-processing passes of the compiler, dumping the result in a file. Note that this - differs from all GHCs prior to version 4.11, in which the result - was dumped to the standard output. If used in conjunction with - -cpp, the output is the code blocks of the original (literal) - source after having put it through the grinder that is the C - pre-processor. Sans , the output is the - de-litted version of the original source. - - The following options also affect which phases get run: - - - - - - - Run the C pre-processor on the Haskell source before - compiling it. See for more - details. - - - - - - - - Use GHC's native code generator rather than compiling - via C. This will compile faster (up to twice as fast), but - may produce code that is slightly slower than compiling via - C. is the default when optimisation - is off (see ). - - - - - - - - - Compile via C instead of using the native code - generator. This is default for optimised compilations, and - on architectures for which GHC doesn't have a native code - generator. - - - + differs from the previous behaviour of dumping the file to + standard output. @@ -1316,45 +1446,45 @@ machine. You can then do various things to control/monitor your - -ControlD -exit pvm, leaving it running - - - -halt -kill off this “parallel machine” & exit - - - -add <host> -add <host> as a processor - - - -delete <host> -delete <host> - - - -reset -kill what's going, but leave PVM up - - - -conf -list the current configuration - - - -ps -report processes' status - - - -pstat <pid> -status of a particular process - + +ControlD +exit pvm, leaving it running + + + +halt +kill off this “parallel machine” & exit + + + +add <host> +add <host> as a processor + + + +delete <host> +delete <host> + + + +reset +kill what's going, but leave PVM up + + + +conf +list the current configuration + + + +ps +report processes' status + + + +pstat <pid> +status of a particular process + @@ -1572,16 +1702,6 @@ computation speed. - : - - (HPPA machines)-mlong-calls option - (HPPA only) Means to pass the - like-named option to GCC. Required for Very Big modules, - maybe. (Probably means you're in trouble…) - - - - : (iX86 machines)-monly-N-regs @@ -1606,9 +1726,9 @@ statements or clauses. -&runtime -&debug -&flags +&runtime; +&debug; +&flags; -- 1.7.10.4