summaryrefslogtreecommitdiff
path: root/docs/CodingStandards.rst
Commit message (Collapse)AuthorAge
* Update programmers manual to cover llvm::function_ref, and add a note to theRichard Smith2014-05-06
| | | | | | | coding standard suggesting using it instead of the (unavailable) std::function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208067 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert accidentally-committed files.Richard Smith2014-05-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208034 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-commit r208025, reverted in r208030, with a fix for a conformance issueRichard Smith2014-05-06
| | | | | | | which GCC detects and Clang does not! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208033 91177308-0d34-0410-b5e6-96231b3b80d8
* C++11: Compatibility with (C++03 => MSVC)Duncan P. N. Exon Smith2014-04-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206481 91177308-0d34-0410-b5e6-96231b3b80d8
* C++11: Document some limitations imposed by MSVCDuncan P. N. Exon Smith2014-04-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206480 91177308-0d34-0410-b5e6-96231b3b80d8
* [docs] Fix up some links to the preferred style.Sean Silva2014-04-08
| | | | | | | | | | | | | :doc:`...` and :ref:`...` links help Sphinx keep track the dependencies between documents and ensure that they are not pointing to nowhere. Raw HTML links work just fine and are easier for people less familiar with reST/Sphinx. They are easy to change over to the :doc:/:ref: style after the fact so this is not a problem. This commit doesn't fix all of them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205792 91177308-0d34-0410-b5e6-96231b3b80d8
* C++11: Remove const from in auto guidelinesDuncan P. N. Exon Smith2014-03-07
| | | | | | Using const is orthogonal to guidelines on using auto& and auto*. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203257 91177308-0d34-0410-b5e6-96231b3b80d8
* C++11: Copy pointers with const auto *Duncan P. N. Exon Smith2014-03-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203254 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid std::function until PR19030 is fixedReid Kleckner2014-03-03
| | | | | | | | | We'd like to keep the clang-cl self-host working until we implement MSVC-compatible RTTI. Differential Revision: http://llvm-reviews.chandlerc.com/D2930 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202758 91177308-0d34-0410-b5e6-96231b3b80d8
* Document that std::initializer_list is not always available.Peter Collingbourne2014-03-03
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D2923 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202750 91177308-0d34-0410-b5e6-96231b3b80d8
* C++11: Beware unnecessary copies with autoDuncan P. N. Exon Smith2014-03-03
| | | | | | | | It's easy to copy unintentionally when using 'auto', particularly inside range-based for loops. Best practise is to use 'const&' unless there's a good reason not to. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202729 91177308-0d34-0410-b5e6-96231b3b80d8
* Clarify struct usage guidelinesDuncan P. N. Exon Smith2014-03-03
| | | | | | | | The current coding standards restrict the use of struct to PODs, but no one has been following them. This patch updates the standards to clarify when structs are dangerous and describe common practice in LLVM. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202728 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Suggest placing callable arguments as the last argument toChandler Carruth2014-03-02
| | | | | | | | facilitate the nice formatting of lambdas passed there. Suggested by Chris during review of my lambda additions, and something I strongly agree with. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202622 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Update the coding standards to provide some important guidanceChandler Carruth2014-03-02
| | | | | | | | | | about a few constructs in C++11 that are worth starting off in a consistent manner within the codebase. This will be matched with a change to clang-format's LLVM style which will switch the options to support C++11 and use these conventions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202620 91177308-0d34-0410-b5e6-96231b3b80d8
* [docs] Fix some Sphinx warnings.Sean Silva2014-03-02
| | | | | | | | | | | | | | | | | | | | | | | The docs now build cleanly. Yay! The following warnings were fixed: /home/sean/pg/llvm/llvm/docs/HowToReleaseLLVM.rst:364: WARNING: Enumerated list ends without a blank line; unexpected unindent. /home/sean/pg/llvm/llvm/docs/InAlloca.rst:: WARNING: document isn't included in any toctree /home/sean/pg/llvm/llvm/docs/CodingStandards.rst:85: WARNING: Title underline too short. Supported C++11 Language and Library Features ------------------------------------------- /home/sean/pg/llvm/llvm/docs/CodingStandards.rst:85: WARNING: Title underline too short. Supported C++11 Language and Library Features ------------------------------------------- /home/sean/pg/llvm/llvm/docs/GettingStarted.rst:185: WARNING: Explicit markup ends without a blank line; unexpected unindent. /home/sean/pg/llvm/llvm/docs/GettingStarted.rst:565: WARNING: Explicit markup ends without a blank line; unexpected unindent. /home/sean/pg/llvm/llvm/docs/GettingStarted.rst:567: WARNING: Block quote ends without a blank line; unexpected unindent. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202603 91177308-0d34-0410-b5e6-96231b3b80d8
* [docs] Update the docs to remove my hedging about C++98 vs. C++11. =]Chandler Carruth2014-03-01
| | | | | | | The switch has been thrown. While I'm still watching for any failures or problems with this, the documentation can go ahead and move forward. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202566 91177308-0d34-0410-b5e6-96231b3b80d8
* [docs] Clarify that there isn't much to be done other than watch buildChandler Carruth2014-02-28
| | | | | | | | | | | | bots when using the standard library facilities. The missing pieces here aren't always in useful discreet chunks. Fortunately, the missing pieces are few and far between, and we can emulate most of them in our headers as needed. Based on feedback from Lang and Dave. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202548 91177308-0d34-0410-b5e6-96231b3b80d8
* Add more whitespace to fix more bullets.Richard Smith2014-02-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202538 91177308-0d34-0410-b5e6-96231b3b80d8
* Add whitespace to try to fix bulleted list.Richard Smith2014-02-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202537 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix some links to C++11 feature papers in the Coding StandardsBen Langmuir2014-02-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202532 91177308-0d34-0410-b5e6-96231b3b80d8
* [docs] Add a section to the coding standards about languages and such.Chandler Carruth2014-02-28
| | | | | | | | | | | | | | | | A lot of this is writing down common knowledge and things often communicated on mailing lists and in discussions. It could live in the Programmer's Manual alternatively, but that felt slightly less well-fitting. It also includes (and was motivated by) the section on the relevant language standards for LLVM and the specific features that will be enabled with the switch to C++11. With this, all of the documentation for the C++11 switch is, I think, in place. I plan to flip the switch RSN. =] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202497 91177308-0d34-0410-b5e6-96231b3b80d8
* [docs] A slight tweak to the intro for the golden rule in the codingChandler Carruth2014-02-28
| | | | | | | | | | | | | | | | 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
* Revert my commit in r199620 that added sections about namespaces to theChandler Carruth2014-01-20
| | | | | | | | | | | | | | | | | | 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
* Add some wording to the coding standards to say how to indent namespacesChandler Carruth2014-01-20
| | | | | | | | | | | (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
* Correct word hyphenationsAlp Toker2013-12-05
| | | | | | | 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
* Revert r189704, which removed the guidance about not duplicating doc comments.Chris Lattner2013-09-01
| | | | | | | This is under active discussion. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189730 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the suggestion to not duplicate comments in header andChris Lattner2013-08-30
| | | | | | | | 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
* Add the common begin/end naming convention to the coding standard.Rafael Espindola2013-08-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187902 91177308-0d34-0410-b5e6-96231b3b80d8
* Coding standards: don't use ``inline`` when defining a function in a classDmitri Gribenko2013-02-04
| | | | | | | | | | | | | | | | 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
* Fix spellingJoel Jones2013-01-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173103 91177308-0d34-0410-b5e6-96231b3b80d8
* docs: Fix long standing linking antipattern.Sean Silva2013-01-11
| | | | | | | | | 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
* Simplify the coding standards for #include ordering. The ordering is nowChandler Carruth2012-12-02
| | | | | | | 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
* docs: CodingStandards should follow the coding standards.Sean Silva2012-11-17
| | | | | | 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
* docs: Add link to HowToSetUpLLVMStyleRTTISean Silva2012-11-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168271 91177308-0d34-0410-b5e6-96231b3b80d8
* Suggest llvm_unreachable over assert(0).Jordan Rose2012-10-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166821 91177308-0d34-0410-b5e6-96231b3b80d8
* Document current Doxygen use practices in Coding Standards. Mostly it isDmitri Gribenko2012-10-20
| | | | | | | | | 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
* [Docs] Update File Headers section to cover doxygen style file level docs.Michael J. Spencer2012-10-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164964 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix && to && in Coding Standards.Jakub Staszak2012-09-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164920 91177308-0d34-0410-b5e6-96231b3b80d8
* Add missing 'to' and rephrase an explanation of GCC's assumptions.David Blaikie2012-09-21
| | | | | | 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
* Document "do not use defaults in covered switch-over-enum" coding standard.David Blaikie2012-09-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164389 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix function names in coding style examplesAndrew Trick2012-09-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164311 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix static function names in CodingStandards examples.Andrew Trick2012-09-20
| | | | | | 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
* Coding standards: fix typo: '= deleted' -> '= delete'.Dmitri Gribenko2012-09-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164126 91177308-0d34-0410-b5e6-96231b3b80d8
* Add LLVM_DELETED_FUNCTION to coding standards.Craig Topper2012-09-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164101 91177308-0d34-0410-b5e6-96231b3b80d8
* Put space after "code-block::".Meador Inge2012-06-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158880 91177308-0d34-0410-b5e6-96231b3b80d8
* Removed some left over HTML tags and a '}'.Meador Inge2012-06-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158877 91177308-0d34-0410-b5e6-96231b3b80d8
* Sphinxify the CodingStandard documentation.Bill Wendling2012-06-20
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158786 91177308-0d34-0410-b5e6-96231b3b80d8