X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=docs%2FCodingStandards.html;h=b5cf508d2f85e824d528a1474c7ba0eb8b0ba088;hb=a75ce9f5d2236d93c117e861e60e6f3f748c9555;hp=eb8235235d5ebe59c85514b44695b20c9ff8106d;hpb=d80c43c7472315a58fd9756f7fec240698d73956;p=oota-llvm.git diff --git a/docs/CodingStandards.html b/docs/CodingStandards.html index eb8235235d5..b5cf508d2f8 100644 --- a/docs/CodingStandards.html +++ b/docs/CodingStandards.html @@ -1,652 +1,1499 @@ - -A Few Coding Standards - - - - -
  A Few Coding Standards
+ + + + + LLVM Coding Standards + + + +
+ LLVM Coding Standards +
    -
  1. Introduction -
  2. Mechanical Source Issues +
  3. Introduction
  4. +
  5. Mechanical Source Issues
    1. Source Code Formatting -
        -
      1. Commenting -
      2. Comment Formatting -
      3. Source Code Width -
      4. Use Spaces Instead of Tabs -
      5. Indent Code Consistently -
      +
        +
      1. Commenting
      2. +
      3. Comment Formatting
      4. +
      5. #include Style
      6. +
      7. Source Code Width
      8. +
      9. Use Spaces Instead of Tabs
      10. +
      11. Indent Code Consistently
      12. +
    2. Compiler Issues
        -
      1. Treat Compiler Warnings Like Errors -
      2. Which C++ features can I use? -
      3. Write Portable Code -
      -
    +
  6. Treat Compiler Warnings Like + Errors
  7. +
  8. Write Portable Code
  9. +
  10. Do not use RTTI or Exceptions
  11. +
  12. Use of class/struct Keywords
  13. +
+
  • Style Issues
      -
    1. The High Level Issues +
    2. The High-Level Issues
        -
      1. A Public Header File is a Module -
      2. #include as Little as Possible -
      3. Keep "internal" Headers Private -
      -
    3. The Low Level Issues +
    4. A Public Header File is a + Module
    5. +
    6. #include as Little as Possible
    7. +
    8. Keep "internal" Headers + Private
    9. +
    10. Use Early Exits and continue to Simplify + Code
    11. +
    12. Don't use else after a + return
    13. +
    14. Turn Predicate Loops into Predicate + Functions
    15. +
  • +
  • The Low-Level Issues
      -
    1. Assert Liberally -
    2. Prefer Preincrement -
    3. Exploit C++ to its Fullest -
    -
  • Writing Iterators - -
  • See Also -

    +

  • Name Types, Functions, Variables, and Enumerators Properly
  • +
  • Assert Liberally
  • +
  • Do not use 'using namespace std'
  • +
  • Provide a virtual method anchor for + classes in headers
  • +
  • Don't evaluate end() every time through a + loop
  • +
  • #include <iostream> is + forbidden
  • +
  • Use raw_ostream
  • +
  • Avoid std::endl
  • + + +
  • Microscopic Details +
      +
    1. Spaces Before Parentheses
    2. +
    3. Prefer Preincrement
    4. +
    5. Namespace Indentation
    6. +
    7. Anonymous Namespaces
    8. +
  • + + + +
  • See Also
  • + + +
    +

    Written by Chris Lattner

    +
    -
    -Introduction -
    -Mechanical Source Issues -
       -Source Code Formatting -


    Commenting


    Comment Formatting


    Source Code Width


    Use Spaces Instead of Tabs


    Indent Code Consistently

       -Compiler Issues -


    Treat Compiler Warnings Like Errors


    Which C++ features can I use?


    Write Portable Code

    -Style Issues -
       -The High Level Issues -


    A Public Header File is a Module


    #include as Little as Possible


    Keep "internal" Headers Private

       -The Low Level Issues -


    Assert Liberally


    Prefer Preincrement


    Exploit C++ to its Fullest

       -Writing Iterators -
    -See Also -

    - -
    Chris Lattner
    - - -Last modified: Sun Jul 8 19:25:56 CDT 2001 - -
    - +
    + Valid CSS + Valid HTML 4.01 + + Chris Lattner
    + LLVM Compiler Infrastructure
    + Last modified: $Date$ +
    + + +