LDC contributor's guide

From D Wiki
Revision as of 18:55, 7 February 2013 by Klickverbot (talk | contribs) (Style guidelines)
Jump to: navigation, search

This page is a work-in-progress collection of tips for LDC contributors and development guidelines.

Style guidelines

  • Hard rules: 4 spaces for indentation, LF newlines.
  • Generally, use your good taste and try to use a style similar to the surrounding code. Many parts of the LLVM Coding Standards are directly applicable to LDC as well.
  • Use llvm_unreachable("message") instead of assert(0 && "message") (from llvm/Support/ErrorHandling.h). Not only might it lead to slightly better codegen, it also prevents »variable might be used uninitialized« and similar compiler warnings.