X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=docs%2FCodingStandards.html;h=7f92b9a7cf0b2047f31b095f0a3ff85622b341d3;hb=424641ef83fbb99640d3e2758148a9d3ea2b3830;hp=83ca1dc24ad635d3cda6834367215e0dfc603903;hpb=f7235cde69c7017aecbc6609ee3db2fc81ad2668;p=oota-llvm.git diff --git a/docs/CodingStandards.html b/docs/CodingStandards.html index 83ca1dc24ad..7f92b9a7cf0 100644 --- a/docs/CodingStandards.html +++ b/docs/CodingStandards.html @@ -1,666 +1,1529 @@ - -A Few Coding Standards - - - - -
  A Few Coding Standards
+ + + + + LLVM Coding Standards + + + +

+ LLVM Coding Standards +

    -
  1. Introduction +
  2. Introduction
  3. 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 -
      -
    +
  4. Treat Compiler Warnings Like + Errors
  5. +
  6. Write Portable Code
  7. +
  8. Do not use RTTI or Exceptions
  9. +
  10. Use of class/struct Keywords
  11. +
+
  • 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. Avoid endl -
    4. 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


    Avoid endl


    Exploit C++ to its Fullest

       -Writing Iterators -
    -See Also -

    - -
    Chris Lattner
    - - -Last modified: Wed Apr 23 11:20:49 CDT 2003 - -
    - +
    + Valid CSS + Valid HTML 4.01 + + Chris Lattner
    + LLVM Compiler Infrastructure
    + Last modified: $Date$ +
    + + +