Changes between Version 5 and Version 6 of Commentary/Rts/Cmm


Ignore:
Timestamp:
Mar 10, 2013 8:23:44 AM (13 months ago)
Author:
ezyang
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Commentary/Rts/Cmm

    v5 v6  
    55A `.cmm` file is rather like C--.  The syntax is almost C-- (a few constructs are missing), and it is augmented with some macros that are expanded by GHC's code generator (eg. `INFO_TABLE()`).  A `.cmm` file is compiled by GHC itself: the syntax is parsed by [[GhcFile(compiler/cmm/CmmParse.y)]] and [[GhcFile(compiler/cmm/CmmLex.x)]] into the [wiki:Commentary/Compiler/CmmType Cmm] data type, where it is then passed through one of the [wiki:Commentary/Compiler/Backends back-ends]. 
    66 
    7 We use the C preprocessor on `.cmm` files, making extensive use of macros to make writing this low-level code a bit less tedious and error-prone.  Most of our C-- macros are in [[GhcFile(includes/Cmm.h)]]. 
     7We use the C preprocessor on `.cmm` files, making extensive use of macros to make writing this low-level code a bit less tedious and error-prone.  Most of our C-- macros are in [[GhcFile(includes/Cmm.h)]]. One useful fact about the macros is `P_` is an alias for `gcptr`, and you should not use it for non-garbage-collected pointers. 
    88 
    99For more information on Cmm (GHC's implementation of C--), see [wiki:Commentary/Compiler/CmmType the Cmm language] page.