[[project @ 2001-02-16 17:35:01 by simonmar] simonmar**20010216173501 Today's doc hacking. ] { addfile ./ghc/docs/users_guide/ghci.sgml hunk ./ghc/docs/users_guide/debugging.sgml 1 - -Debugging the compiler - + + Debugging the compiler hunk ./ghc/docs/users_guide/debugging.sgml 4 - -debugging options (for GHC) - + debugging options (for GHC) hunk ./ghc/docs/users_guide/debugging.sgml 6 - -HACKER TERRITORY. HACKER TERRITORY. -(You were warned.) - + HACKER TERRITORY. HACKER TERRITORY. (You were warned.) hunk ./ghc/docs/users_guide/debugging.sgml 8 + + 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: hunk ./ghc/docs/users_guide/debugging.sgml 27 - -Dumping out compiler intermediate structures - + + + : + + parser output + + hunk ./ghc/docs/users_guide/debugging.sgml 35 - -dumping GHC intermediates -intermediate passes, output - + + : + + renamer output + + hunk ./ghc/docs/users_guide/debugging.sgml 42 - - + + : + + typechecker output + + hunk ./ghc/docs/users_guide/debugging.sgml 49 - -: - - --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: - + + : + + 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. + + hunk ./ghc/docs/users_guide/debugging.sgml 61 - - + + : + + derived instances + + hunk ./ghc/docs/users_guide/debugging.sgml 68 - -: - - -parser output - - - + + : + + desugarer output + + hunk ./ghc/docs/users_guide/debugging.sgml 75 - -: - - -renamer output - - - + + : + + output of specialisation pass + + hunk ./ghc/docs/users_guide/debugging.sgml 82 - -: - - -typechecker output - - - + + : + + dumps all rewrite rules (including those generated + by the specialisation pass) + + hunk ./ghc/docs/users_guide/debugging.sgml 90 - -: - - -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. - - - + + : + + simplifer output (Core-to-Core passes) + + hunk ./ghc/docs/users_guide/debugging.sgml 97 - -: - - -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: + + : + + inlining info from the simplifier + + hunk ./ghc/docs/users_guide/debugging.sgml 104 - + + : + + 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: + + hunk ./ghc/docs/users_guide/debugging.sgml 253 - - - - -: - - --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. - - - - - + + + + + : + + + 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. + + hunk ./ghc/docs/users_guide/debugging.sgml 267 - + + + + + 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. + + hunk ./ghc/docs/users_guide/debugging.sgml 285 - -Checking for consistency - + + + + + In error messages, expressions are printed to a + certain “depth”, with subexpressions beyond the + depth replaced by ellipses. This flag sets the + depth. + + hunk ./ghc/docs/users_guide/debugging.sgml 296 - -consistency checks -lint - + + + + + Dump statistics about how many of each kind of + transformation too place. If you add + you get more detailed + information. + + hunk ./ghc/docs/users_guide/debugging.sgml 307 - - + + + + + Make the renamer be *real* chatty about what it is + upto. + + hunk ./ghc/docs/users_guide/debugging.sgml 316 - -: - - --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. - - - - - + + + + + Print out summary of what kind of information the renamer + had to bring in. + + hunk ./ghc/docs/users_guide/debugging.sgml 325 - + + + + + Have the renamer report what imports does not + contribute. + + + + hunk ./ghc/docs/users_guide/debugging.sgml 336 - -How to read Core syntax (from some <Option>-ddump-*</Option> flags) + + Checking for consistency hunk ./ghc/docs/users_guide/debugging.sgml 339 - -reading Core syntax -Core syntax, how to read - + consistency checks + lint hunk ./ghc/docs/users_guide/debugging.sgml 342 - -Let's do this by commenting an example. It's from doing - on this code: + + + + + + + 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: hunk ./ghc/docs/users_guide/debugging.sgml 391 - - - -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). - + 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). hunk ./ghc/docs/users_guide/debugging.sgml 402 - -Remember, everything has a “Unique” and it is usually printed out -when debugging, in some form or another. So here we go… - + Remember, everything has a “Unique” and it is + usually printed out when debugging, in some form or another. So + here we go… hunk ./ghc/docs/users_guide/debugging.sgml 406 - hunk ./ghc/docs/users_guide/debugging.sgml 477 - - - -(“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. - hunk ./ghc/docs/users_guide/debugging.sgml 478 - -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.) hunk ./ghc/docs/users_guide/debugging.sgml 481 - + hunk ./ghc/docs/users_guide/flags.sgml 1 - + hunk ./ghc/docs/users_guide/flags.sgml 4 + 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). + hunk ./ghc/docs/users_guide/flags.sgml 79 - - Run the C pre-processor on the Haskell source - dynamic - - - - hunk ./ghc/docs/users_guide/flags.sgml 102 - - - Use the native code generator - dynamic - -fvia-C - - - - Compile via C - dynamic - -fasm - hunk ./ghc/docs/users_guide/flags.sgml 314 - -recomp + hunk ./ghc/docs/users_guide/flags.sgml 925 + + Run the C pre-processor on Haskell source files + dynamic + - + + hunk ./ghc/docs/users_guide/flags.sgml 979 + + 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 + + + + + + hunk ./ghc/docs/users_guide/flags.sgml 1224 - - (HPPA only) enable long call support - static - - - - hunk ./ghc/docs/users_guide/flags.sgml 1304 - Dump FFI-related output + Dump foreign export stubs hunk ./ghc/docs/users_guide/flags.sgml 1405 - - (equivalent to ) - dynamic - - - - hunk ./ghc/docs/users_guide/flags.sgml 1482 + + + Enable unregisterised compilation + static + - + hunk ./ghc/docs/users_guide/flags.sgml 1587 - , ( "unreg" , NoArg (addNoDups v_Ways WayUnreg) ) + -Bdir hunk ./ghc/docs/users_guide/ghci.sgml 1 + + Using GHCi + + ToDo + + + hunk ./ghc/docs/users_guide/phases.sgml 44 - 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. - hunk ./ghc/docs/users_guide/phases.sgml 46 + + + + + 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. + + + hunk ./ghc/docs/users_guide/phases.sgml 214 - - - - - Flag - Description - Static/Dynamic - Reverse - - - - - file - Include file when - compiling the .hc file - dynamic - - - - - - - hunk ./ghc/docs/users_guide/phases.sgml 225 + + + 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. + + + + hunk ./ghc/docs/users_guide/separate_compilation.sgml 10 - + hunk ./ghc/docs/users_guide/ug-book.sgml 9 -&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; hunk ./ghc/docs/users_guide/ug-ent.sgml 1 + hunk ./ghc/docs/users_guide/using.sgml 1 - -Using GHC - + + Using GHC hunk ./ghc/docs/users_guide/using.sgml 4 - -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 hunk ./ghc/docs/users_guide/using.sgml 7 - -Overall command-line structure - + GHC can work in one of three “modes”: hunk ./ghc/docs/users_guide/using.sgml 9 - -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 . + + hunk ./ghc/docs/users_guide/using.sgml 25 - -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. + + hunk ./ghc/docs/users_guide/using.sgml 42 - + + + 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: hunk ./ghc/docs/users_guide/using.sgml 83 - + Command-line arguments are either options or file names. hunk ./ghc/docs/users_guide/using.sgml 85 - -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. + hunk ./ghc/docs/users_guide/using.sgml 96 - -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.) - + + Command line options in source files + + source-file options hunk ./ghc/docs/users_guide/using.sgml 101 - + 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: hunk ./ghc/docs/users_guide/using.sgml 111 - -Meaningful file suffixes - + +{-# 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. hunk ./ghc/docs/users_guide/using.sgml 127 - -suffixes, file -file suffixes for GHC - + 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. hunk ./ghc/docs/users_guide/using.sgml 132 - -File names with “meaningful” suffixes (e.g., .lhs or .o) -cause the “right thing” to happen to those files. - + 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). + hunk ./ghc/docs/users_guide/using.sgml 140 - - + + Setting options in GHCi hunk ./ghc/docs/users_guide/using.sgml 143 - -.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. - - - - - + Options may also be modified from within GHCi, using the + :set command. See + for more details. + + + + + Static vs. Dynamic options + staticoptions + + dynamicoptions + hunk ./ghc/docs/users_guide/using.sgml 156 - -Files with other suffixes (or without suffixes) are passed straight -to the linker. - + 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. hunk ./ghc/docs/users_guide/using.sgml 163 - + 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. + + + + Meaningful file suffixes + + 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. + + hunk ./ghc/docs/users_guide/using.sgml 358 + + + Using <command>ghc</command> <option>--make</option> + + + + separate compilation + hunk ./ghc/docs/users_guide/using.sgml 367 - - Running the right phases in the right order + 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: hunk ./ghc/docs/users_guide/using.sgml 374 - order of passes in GHC - pass ordering in GHC + +ghc --make Main.hs + hunk ./ghc/docs/users_guide/using.sgml 378 + 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. hunk ./ghc/docs/users_guide/using.sgml 385 - The basic task of the ghc driver is to - run each input file through the right phases (compiling, linking, - etc.). + The main advantages to using ghc --make + over traditional Makefiles are: hunk ./ghc/docs/users_guide/using.sgml 388 - The first phase to run is determined by the input-file + + + 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> + + Without , GHC will compile one or + more source files given on the command line. + + The first phase to run is determined by each input-file hunk ./ghc/docs/users_guide/using.sgml 434 - - - - - - - + + + + + + hunk ./ghc/docs/users_guide/using.sgml 441 - -Phase of the compilation system -Suffix saying “start here” -Flag saying “stop after” -(suffix of) output file - + + + Phase of the compilation system + Suffix saying “start here” + Flag saying “stop after” + (suffix of) output file + + + + + literate pre-processor + .lhs + - + .hs + hunk ./ghc/docs/users_guide/using.sgml 457 - - -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 pre-processor (opt.) + + .hs (with + ) + + .hspp + + + + Haskell compiler + .hs + , + .hc, .s + hunk ./ghc/docs/users_guide/using.sgml 473 --C option --S option --c option + + C compiler (opt.) + .hc or .c + + .s + hunk ./ghc/docs/users_guide/using.sgml 480 - -Thus, a common invocation would be: ghc -c Foo.hs - + + assembler + .s + + .o + + + + linker + other + - + a.out + + + + hunk ./ghc/docs/users_guide/using.sgml 497 - -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 - 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. + + + + hunk ./ghc/docs/users_guide/using.sgml 502 - The following options also affect which phases get run: + Thus, a common invocation would be: ghc -c + Foo.hs hunk ./ghc/docs/users_guide/using.sgml 505 - - - - - - Run the C pre-processor on the Haskell source before - compiling it. See for more - details. - - + 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. hunk ./ghc/docs/users_guide/using.sgml 511 - - - - - 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 ). - - + Note: C pre-processing is optional, the + + flag turns it on. See for more details. hunk ./ghc/docs/users_guide/using.sgml 516 - - - - - - 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. - - - + 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 the previous behaviour of dumping the file to + standard output. hunk ./ghc/docs/users_guide/using.sgml 1449 - -ControlD -exit pvm, leaving it running - + +ControlD +exit pvm, leaving it running + hunk ./ghc/docs/users_guide/using.sgml 1454 - -halt -kill off this “parallel machine” & exit - + +halt +kill off this “parallel machine” & exit + hunk ./ghc/docs/users_guide/using.sgml 1459 - -add <host> -add <host> as a processor - + +add <host> +add <host> as a processor + hunk ./ghc/docs/users_guide/using.sgml 1464 - -delete <host> -delete <host> - + +delete <host> +delete <host> + hunk ./ghc/docs/users_guide/using.sgml 1469 - -reset -kill what's going, but leave PVM up - + +reset +kill what's going, but leave PVM up + hunk ./ghc/docs/users_guide/using.sgml 1474 - -conf -list the current configuration - + +conf +list the current configuration + hunk ./ghc/docs/users_guide/using.sgml 1479 - -ps -report processes' status - + +ps +report processes' status + hunk ./ghc/docs/users_guide/using.sgml 1484 - -pstat <pid> -status of a particular process - + +pstat <pid> +status of a particular process + hunk ./ghc/docs/users_guide/using.sgml 1704 - - : - - (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…) - - - hunk ./ghc/docs/users_guide/using.sgml 1729 -&runtime -&debug -&flags +&runtime; +&debug; +&flags; }