[llvm-commits] [llvm] r119544 - /llvm/trunk/docs/CodingStandards.html
Chris Lattner
sabre at nondot.org
Wed Nov 17 11:47:21 PST 2010
Author: lattner
Date: Wed Nov 17 13:47:20 2010
New Revision: 119544
URL: http://llvm.org/viewvc/llvm-project?rev=119544&view=rev
Log:
add some justification for "using namespace llvm;"
Modified:
llvm/trunk/docs/CodingStandards.html
Modified: llvm/trunk/docs/CodingStandards.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CodingStandards.html?rev=119544&r1=119543&r2=119544&view=diff
==============================================================================
--- llvm/trunk/docs/CodingStandards.html (original)
+++ llvm/trunk/docs/CodingStandards.html Wed Nov 17 13:47:20 2010
@@ -914,11 +914,13 @@
<p>The exception to the general rule (i.e. it's not an exception for
the <tt>std</tt> namespace) is for implementation files. For example, all of
the code in the LLVM project implements code that lives in the 'llvm' namespace.
-As such, it is ok, and actually clearer, for the <tt>.cpp</tt> files to have a '<tt>using
-namespace llvm</tt>' directive at their top, after the <tt>#include</tt>s. The
-general form of this rule is that any <tt>.cpp</tt> file that implements code in any
-namespace may use that namespace (and its parents'), but should not use any
-others.</p>
+As such, it is ok, and actually clearer, for the <tt>.cpp</tt> files to have a
+'<tt>using namespace llvm</tt>' directive at their top, after the
+<tt>#include</tt>s. This reduces indentation in the body of the file for source
+editors that indent based on braces, and keeps the conceptual context cleaner.
+The general form of this rule is that any <tt>.cpp</tt> file that implements
+code in any namespace may use that namespace (and its parents'), but should not
+use any others.</p>
</div>
More information about the llvm-commits
mailing list