summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-11-17 19:47:20 +0000
committerChris Lattner <sabre@nondot.org>2010-11-17 19:47:20 +0000
commiteebbbeb917efe74be9e8181ebf113671f7622ef5 (patch)
tree0be7c1dbb84cc986d6b437823ae28c29e6053284
parent8046af7d50856f287da370caa24f38cce241c376 (diff)
downloadbcm5719-llvm-eebbbeb917efe74be9e8181ebf113671f7622ef5.tar.gz
bcm5719-llvm-eebbbeb917efe74be9e8181ebf113671f7622ef5.zip
add some justification for "using namespace llvm;"
llvm-svn: 119544
-rw-r--r--llvm/docs/CodingStandards.html12
1 files changed, 7 insertions, 5 deletions
diff --git a/llvm/docs/CodingStandards.html b/llvm/docs/CodingStandards.html
index 011ac981009..22a29427ce8 100644
--- a/llvm/docs/CodingStandards.html
+++ b/llvm/docs/CodingStandards.html
@@ -914,11 +914,13 @@ such, we never use '<tt>using namespace std;</tt>' in LLVM.</p>
<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>
OpenPOWER on IntegriCloud