X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;ds=sidebyside;f=docs%2FCodingStandards.html;h=1c9c145175572ea2e85f6faca1d48c3ca8514b2a;hb=326a4988ba1fcafec7f582e490e56f0f7297c4fc;hp=c331bc7caa93ec36be5a30b5f76272960d4682fa;hpb=822293a40c24f41c05268f81e1ccdb0ebcbd34a9;p=oota-llvm.git diff --git a/docs/CodingStandards.html b/docs/CodingStandards.html index c331bc7caa9..1c9c1451755 100644 --- a/docs/CodingStandards.html +++ b/docs/CodingStandards.html @@ -3,12 +3,12 @@ - A Few Coding Standards + LLVM Coding Standards
- A Few Coding Standards + LLVM Coding Standards
    @@ -131,12 +131,12 @@ this:

     //===-- llvm/Instruction.h - Instruction class definition -------*- C++ -*-===//
    -// 
    +//
     //                     The LLVM Compiler Infrastructure
     //
     // This file is distributed under the University of Illinois Open Source
     // License. See LICENSE.TXT for details.
    -// 
    +//
     //===----------------------------------------------------------------------===//
     //
     // This file contains the declaration of the Instruction class, which is the
    @@ -526,7 +526,6 @@ library. There are two problems with this:

    example) is allowed normally, it is just <iostream> that is causing problems.

    -
    @@ -571,17 +570,22 @@ DEBUG(dump(DOUT)); - + + +
    void print(std::ostream &Out);
     // ...
     print(std::cerr);
    void print(llvm::OStream Out);1
    -// ...
    -print(llvm::cerr);
    +
    void print(llvm::OStream Out);1
    +// ...
    +print(llvm::cerr);
    +
    - -
    +

    Notes:

    -
    -

    1llvm::OStream is a light-weight class so it should never -be passed by reference. This is important because in some configurations, -DOUT is an rvalue.

    +
    +
      +
    1. llvm::OStream is a light-weight class so it + should never be passed by reference. This is important because in some + configurations, DOUT is an rvalue.
    2. +
    @@ -675,8 +679,8 @@ namespace with an "std::" prefix, rather than rely on "using namespace std;".

    In header files, adding a 'using namespace XXX' directive pollutes -the namespace of any source file that includes the header. This is clearly a -bad thing.

    +the namespace of any source file that #includes the header. This is +clearly a bad thing.

    In implementation files (e.g. .cpp files), the rule is more of a stylistic rule, but is still important. Basically, using explicit namespace prefixes @@ -710,9 +714,9 @@ others.

    If a class is defined in a header file and has a v-table (either it has virtual methods or it derives from classes with virtual methods), it must always have at least one out-of-line virtual method in the class. Without -this, the compiler will copy the vtable and RTTI into every .o file that -#includes the header, bloating .o file sizes and increasing link times. -

    +this, the compiler will copy the vtable and RTTI into every .o file +that #includes the header, bloating .o file sizes and +increasing link times.

    @@ -793,9 +797,9 @@ something.


    Valid CSS! + src="http://jigsaw.w3.org/css-validator/images/vcss-blue" alt="Valid CSS"> Valid HTML 4.01! + src="http://www.w3.org/Icons/valid-html401-blue" alt="Valid HTML 4.01"> Chris Lattner
    LLVM Compiler Infrastructure