LCC is intended to be simple to understand and is well-documented; its design is described in Fraser and Hanson's book A Retargetable C Compiler: Design and Implementation. The book includes most of the source code for version 3.6 of the compiler, which was written as a literate program using noweb. As of July 2011 the current version of LCC is 4.2, but much of the book still applies to this version. The major change since the book was published is in the code-generator interface, which is described in a separate document. The source code for LCC is around 20,000 lines, which is much smaller than many major compilers. LCC can generate code for several processor architectures, including Alpha, SPARC, MIPS, and x86; there is also an LCC backend that generates Microsoft's Common Intermediate Language.
Projects incorporating LCC
Quake 3
's id Tech 3engine relies on a modified version of LCC to compile the source code of each game module or third-party mod into bytecode targeting its virtual machine. This means that modules are oblivious to the system beyond the system calls and limited file system scope offered by the engine, which is intended to reduce the threat posed by malicious mod authors. Another consideration is that games and mods written for the engine are portable without recompilation; only the virtual machine needs to be ported to new platforms in order to execute the modules.
's compiler is a heavily modified version of LCC providing C11 support, amd64 support, and additional optimisation techniques such as inline expansion.
Mathworks
For 32-bit Windows machines, Lcc is used as a default if no other compiler is installed for MathWorksMATLAB and related products.
License
LCC is free for personal use and may be redistributed provided all distribution media and product documentation acknowledges it. The LCC license relies on examples in multiple cases. LCC may not be sold for profit, but it may be included with other software that is sold for profit, provided LCC itself is distributed for free. Per user and unlimited use licenses are available by contacting Addison-Wesley, in particular for compilers of languages such as C++ for which a C compiler may constitute much of its work.