From 85ea83e821e9e0f7fa242e793aa9e919eae6b828 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 27 Jul 2006 04:24:14 +0000 Subject: [PATCH] Add some advice llvm-svn: 29324 --- llvm/docs/CodingStandards.html | 34 ++++++++++++++----- .../SelectionDAG}/TargetLowering.cpp | 0 .../{Scalar => Utils}/LowerAllocations.cpp | 0 .../{Scalar => Utils}/LowerInvoke.cpp | 0 .../{Scalar => Utils}/LowerSelect.cpp | 0 .../{Scalar => Utils}/LowerSwitch.cpp | 0 .../Transforms/{Scalar => Utils}/Mem2Reg.cpp | 0 llvm/lib/{CodeGen => VMCore}/ValueTypes.cpp | 0 8 files changed, 26 insertions(+), 8 deletions(-) rename llvm/lib/{Target => CodeGen/SelectionDAG}/TargetLowering.cpp (100%) rename llvm/lib/Transforms/{Scalar => Utils}/LowerAllocations.cpp (100%) rename llvm/lib/Transforms/{Scalar => Utils}/LowerInvoke.cpp (100%) rename llvm/lib/Transforms/{Scalar => Utils}/LowerSelect.cpp (100%) rename llvm/lib/Transforms/{Scalar => Utils}/LowerSwitch.cpp (100%) rename llvm/lib/Transforms/{Scalar => Utils}/Mem2Reg.cpp (100%) rename llvm/lib/{CodeGen => VMCore}/ValueTypes.cpp (100%) diff --git a/llvm/docs/CodingStandards.html b/llvm/docs/CodingStandards.html index df6eb90b9bed..36aced60a01c 100644 --- a/llvm/docs/CodingStandards.html +++ b/llvm/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.

    diff --git a/llvm/lib/Target/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp similarity index 100% rename from llvm/lib/Target/TargetLowering.cpp rename to llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp diff --git a/llvm/lib/Transforms/Scalar/LowerAllocations.cpp b/llvm/lib/Transforms/Utils/LowerAllocations.cpp similarity index 100% rename from llvm/lib/Transforms/Scalar/LowerAllocations.cpp rename to llvm/lib/Transforms/Utils/LowerAllocations.cpp diff --git a/llvm/lib/Transforms/Scalar/LowerInvoke.cpp b/llvm/lib/Transforms/Utils/LowerInvoke.cpp similarity index 100% rename from llvm/lib/Transforms/Scalar/LowerInvoke.cpp rename to llvm/lib/Transforms/Utils/LowerInvoke.cpp diff --git a/llvm/lib/Transforms/Scalar/LowerSelect.cpp b/llvm/lib/Transforms/Utils/LowerSelect.cpp similarity index 100% rename from llvm/lib/Transforms/Scalar/LowerSelect.cpp rename to llvm/lib/Transforms/Utils/LowerSelect.cpp diff --git a/llvm/lib/Transforms/Scalar/LowerSwitch.cpp b/llvm/lib/Transforms/Utils/LowerSwitch.cpp similarity index 100% rename from llvm/lib/Transforms/Scalar/LowerSwitch.cpp rename to llvm/lib/Transforms/Utils/LowerSwitch.cpp diff --git a/llvm/lib/Transforms/Scalar/Mem2Reg.cpp b/llvm/lib/Transforms/Utils/Mem2Reg.cpp similarity index 100% rename from llvm/lib/Transforms/Scalar/Mem2Reg.cpp rename to llvm/lib/Transforms/Utils/Mem2Reg.cpp diff --git a/llvm/lib/CodeGen/ValueTypes.cpp b/llvm/lib/VMCore/ValueTypes.cpp similarity index 100% rename from llvm/lib/CodeGen/ValueTypes.cpp rename to llvm/lib/VMCore/ValueTypes.cpp