From 6883a88fdbcb386d4d7d8d2714be7bd2e0e29ed9 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 27 Jul 2006 04:24:14 +0000 Subject: [PATCH] Add some advice git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29324 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/CodingStandards.html | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/docs/CodingStandards.html b/docs/CodingStandards.html index df6eb90b9be..36aced60a01 100644 --- a/docs/CodingStandards.html +++ b/docs/CodingStandards.html @@ -44,10 +44,11 @@
  • The Low Level Issues
      -
    1. Assert Liberally
    2. -
    3. Do not use 'using namespace std'
    4. -
    5. Prefer Preincrement
    6. -
    7. Avoid std::endl
    8. +
    9. Assert Liberally
    10. +
    11. Do not use 'using namespace std'
    12. +
    13. Provide a virtual method anchor for clases in headers
    14. +
    15. Prefer Preincrement
    16. +
    17. Avoid std::endl
  • See Also
  • @@ -489,7 +490,7 @@ class itself... just make them private (or protected), and all is well.

    - Assert Liberally + Assert Liberally
    @@ -537,7 +538,7 @@ assert(isa<PHINode>(Succ->front()) && "Only works on PHId BBs!"
    @@ -572,7 +573,24 @@ namespace (and its parents), but should not use any 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. +

    + +
    + + + +
    @@ -592,7 +610,7 @@ get in the habit of always using preincrement, and you won't have a problem.