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 @@
-//===-- 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:
--@@ -675,8 +679,8 @@ namespace with an "std::" prefix, rather than rely on "using namespace std;".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.
+++
- 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.
+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.