diff options
author | Chris Lattner <sabre@nondot.org> | 2010-11-17 19:47:20 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-11-17 19:47:20 +0000 |
commit | eddd96901e76811850b63d8bc2cd1690153f38ce (patch) | |
tree | 38045e80b35e8d58da93bba0bafa9b70e5c5c920 /docs/CodingStandards.html | |
parent | 4d08863108cdf020e64377fe69eb082c140721af (diff) | |
download | external_llvm-eddd96901e76811850b63d8bc2cd1690153f38ce.zip external_llvm-eddd96901e76811850b63d8bc2cd1690153f38ce.tar.gz external_llvm-eddd96901e76811850b63d8bc2cd1690153f38ce.tar.bz2 |
add some justification for "using namespace llvm;"
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119544 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs/CodingStandards.html')
-rw-r--r-- | docs/CodingStandards.html | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/docs/CodingStandards.html b/docs/CodingStandards.html index 011ac98..22a2942 100644 --- a/docs/CodingStandards.html +++ b/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> |