From: simonmar Date: Thu, 29 Aug 2002 12:57:34 +0000 (+0000) Subject: [project @ 2002-08-29 12:57:34 by simonmar] X-Git-Tag: Approx_11550_changesets_converted~1742 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=c5e353d46f98b80349947c8694038ce3fa8dbbaf;p=ghc-hetmet.git [project @ 2002-08-29 12:57:34 by simonmar] Add notes about DEBUG and GHCI. --- diff --git a/ghc/docs/comm/the-beast/coding-style.html b/ghc/docs/comm/the-beast/coding-style.html index 7f0efbf..20aab89 100644 --- a/ghc/docs/comm/the-beast/coding-style.html +++ b/ghc/docs/comm/the-beast/coding-style.html @@ -29,9 +29,49 @@

To CPP or not to CPP?

We pass all the compiler sources through CPP. The - -cpp flag is always added by the build system. More - about what you're allowed to do in the way of CPP directives - later. + -cpp flag is always added by the build system. + +

The following CPP symbols are used throughout the compiler: + +

+
DEBUG
+ +
Used to enables extra checks and debugging output in the + compiler. The ASSERT macro (see HsVersions.h) + provides assertions which disappear when DEBUG is not + defined. + +

All debugging output should be placed inside #ifdef + DEBUG; we generally use this to provide warnings about + strange cases and things that might warrant investigation. When + DEBUG is off, the compiler should normally be silent + unless something goes wrong (exception when the verbosity level + is greater than zero). + +

A good rule of thumb is that DEBUG shouldn't add + more than about 10-20% to the compilation time. This is the case + at the moment. If it gets too expensive, we won't use it. For + more expensive runtime checks, consider adding a flag - see for + example -dcore-lint. +

+ +
GHCI
+ +
Enables GHCi support, including the byte code generator and + interactive user interface. This isn't the default, because the + compiler needs to be bootstrapped with itself in order for GHCi + to work properly. The reason is that the byte-code compiler and + linker are quite closely tied to the runtime system, so it is + essential that GHCi is linked with the most up-to-date RTS. + Another reason is that the representation of certain datatypes + must be consistent between GHCi and its libraries, and if these + were inconsistent then disaster could follow. +
+ +
+ +

More about what you're allowed to do in the way of CPP + directives later.

Compiler versions