Commit Graph

26 Commits

Author SHA1 Message Date
Chandler Carruth
72667d1447 [docs] A slight tweak to the intro for the golden rule in the coding
standards.

It claims the document intentionally doesn't give fixed standards for
brace placement or spacing, and then the document goes on to do
precisely that in several places. Instead, try to highlight that even
these rules are simply *guidance* which may be trumped by some other
circumstance or the local conventions of code.

I'm not trying to change the thrust of this part of the document, and if
folks think this does so, I'm happy to re-wordsmith it. I just don't
want it to be so self-contradicting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202495 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-28 12:24:18 +00:00
Chandler Carruth
70662820ee Revert my commit in r199620 that added sections about namespaces to the
coding standards, and instead fix the existing section.

Thanks to Daniel Jasper for pointing out we already had a section
devoted to this topic. Instead of adding sections, just hack on this
section some. Also fix the example in the anonymous namespace section
below it to agree with the new advice.

As a re-cap, this switches the LLVM preferred style to never indent
namespaces. Having two approaches just led to endless (and utterly
pointless) debates about what was "small enough". This wasn't helping
anyone. The no-indent rule is easy to understand and doesn't really make
anything harder to read. Moreover, with tools like clang-format it is
considerably nicer to have simple consistent rules.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199637 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-20 10:15:32 +00:00
Chandler Carruth
5d696a91c8 Add some wording to the coding standards to say how to indent namespaces
(and to mention namespace ending comments). This is based on a quick
discussion on the developer mailing list where there was essentially no
objections to a simple and consistent rule. This should avoid future
debates about whether or not a namespace is "big enough" to indent. It
also matches clang-format's current behavior with LLVM source code which
hasn't really seen any opposition in code reviews that I spot checked.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199620 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-20 01:40:43 +00:00
Alp Toker
087ab613f4 Correct word hyphenations
This patch tries to avoid unrelated changes other than fixing a few
hyphen-related ambiguities and contractions in nearby lines.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196471 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-05 05:44:44 +00:00
Chris Lattner
eecd9b1d52 Revert r189704, which removed the guidance about not duplicating doc comments.
This is under active discussion.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189730 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-01 15:48:08 +00:00
Chris Lattner
af069a8920 Remove the suggestion to not duplicate comments in header and
implementation files.  While doc generation systems don't need this,
humans do benefit from it.  Not everyone reads all code through doxygen.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189704 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-30 23:06:20 +00:00
Rafael Espindola
f4c2104d00 Add the common begin/end naming convention to the coding standard.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187902 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-07 19:34:37 +00:00
Dmitri Gribenko
b7978cf701 Coding standards: don't use `inline` when defining a function in a class
definition

Current practice is not to use 'inline' in:

  class Foo {
  public:
    inline void bar() {
      // ...
    }
  };


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174317 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-04 10:24:58 +00:00
Joel Jones
1d10898ab5 Fix spelling
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173103 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-21 23:20:47 +00:00
Sean Silva
a7aec400a7 docs: Fix long standing linking antipattern.
Before we learned about :doc:, we used :ref: and put a dummy link at the
top of each page. Don't do that anymore.

This fixes PR14891 as a special case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172162 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-11 02:28:08 +00:00
Chandler Carruth
afcc374524 Simplify the coding standards for #include ordering. The ordering is now
trivially achievable with an editor. I'll likely check in a silly python
script to help with this too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169107 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-02 11:53:27 +00:00
Sean Silva
5d6d89544d docs: CodingStandards should follow the coding standards.
Some variables in code examples were not LikeThis.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168275 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-17 23:25:33 +00:00
Sean Silva
107aa1c219 docs: Add link to HowToSetUpLLVMStyleRTTI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168271 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-17 21:01:44 +00:00
Jordan Rose
715672c643 Suggest llvm_unreachable over assert(0).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166821 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-26 22:08:46 +00:00
Dmitri Gribenko
b8f2d82403 Document current Doxygen use practices in Coding Standards. Mostly it is
obvious stuff and most new code being committed conforms to that.  Some old
code does not; this might cause confusion and this is the motivation to
document the correct guidelines.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166378 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-20 13:27:43 +00:00
Michael J. Spencer
06d9981d27 [Docs] Update File Headers section to cover doxygen style file level docs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164964 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-01 19:59:21 +00:00
Jakub Staszak
bfa43c0422 Fix && to && in Coding Standards.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164920 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-30 20:42:13 +00:00
David Blaikie
b890e9fc66 Add missing 'to' and rephrase an explanation of GCC's assumptions.
Wordsmithing by Matt Beaumont-Gay in response to r164389.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164395 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-21 18:03:02 +00:00
David Blaikie
67bf429a6a Document "do not use defaults in covered switch-over-enum" coding standard.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164389 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-21 17:47:36 +00:00
Andrew Trick
e9f59888d4 Fix function names in coding style examples
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164311 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-20 17:02:04 +00:00
Andrew Trick
331e8fb760 Fix static function names in CodingStandards examples.
Try not to violate conventions immediately before explaining them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164278 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-20 02:01:06 +00:00
Dmitri Gribenko
e3f1459b7d Coding standards: fix typo: '= deleted' -> '= delete'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164126 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-18 14:00:58 +00:00
Craig Topper
88b5a2bf34 Add LLVM_DELETED_FUNCTION to coding standards.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164101 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-18 04:43:40 +00:00
Meador Inge
e3c9ccd312 Put space after "code-block::".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158880 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-20 23:57:00 +00:00
Meador Inge
d65ebceeba Removed some left over HTML tags and a '}'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158877 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-20 23:48:01 +00:00
Bill Wendling
2c8293d348 Sphinxify the CodingStandard documentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158786 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-20 02:57:56 +00:00