summaryrefslogtreecommitdiffstats
path: root/docs/CodingStandards.rst
Commit message (Collapse)AuthorAgeFilesLines
* Update some code.google.com linksHans Wennborg2017-11-131-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318115 91177308-0d34-0410-b5e6-96231b3b80d8
* [docs] Add a note on iteration of unordered containers to coding standardsMandeep Singh Grang2017-09-061-0/+15
| | | | | | | | | | | | | | Summary: Beware of non-determinism due to ordering of pointers Reviewers: dblaikie, dexonsmith Reviewed By: dblaikie Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D37525 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312667 91177308-0d34-0410-b5e6-96231b3b80d8
* [Docs] Update CodingStandards to recommend range-based for loopsAlex Bradbury2017-08-311-11/+23
| | | | | | | | | | | | | The CodingStandards section on avoiding the re-evaluation of end() hasn't been updated since range-based for loops were adopted in the LLVM codebase. This patch adds a very brief section that documents how range-based for loops should be used wherever possible. It also moves example code in CodingStandards to use range-based for loops and auto when appropriate. Differential Revision: https://reviews.llvm.org/D37264 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312236 91177308-0d34-0410-b5e6-96231b3b80d8
* Refine report_fatal_error guidance after post-commit reviewAlex Bradbury2017-08-181-3/+4
| | | | | | | | | | Use text suggested by Justin Bogner in post-commit review of r311146 <http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20170814/479898.html>, which makes it clear that report_fatal_error shouldn't be used when there is a practicable alternative. Also make this clearer in CodingStandards. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311147 91177308-0d34-0410-b5e6-96231b3b80d8
* Give guidance on report_fatal_error in CodingStandards.rst and ↵Alex Bradbury2017-08-181-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | ProgrammersManual.rst The current ProgrammersManual.rst document has a lot of well-written documentation on error handling thanks to @lhames. It suggests errors can be split cleanly into "programmatic" and "recoverable" errors. However, the reality in current LLVM seems to be there are a number of cases where a non-programmatic error is not easily recoverable. Therefore, add a note to indicate the existence of report_fatal_error for these cases. I've also added a reminder to CodingStandards.rst in the section on assertions, to indicate that llvm_unreachable and assertions should not be relied upon to report errors triggered by user input. The ProgrammersManual is also silent on the use of LLVMContext::diagnose, which is used in BPF+WebAssembly+AMDGPU to report some errors during instruction selection. I don't address that in this patch, as it's not quite clear how to fit in to the current error handling story Differential Revision: https://reviews.llvm.org/D36826 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311146 91177308-0d34-0410-b5e6-96231b3b80d8
* fix typos in a document; NFCHiroshi Inoue2017-07-181-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308331 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix some remaining documentation references to MSVC 2013Reid Kleckner2016-12-151-3/+2
| | | | | | | | MSVC 2015 has been the minimum supported version of VS since October. Differential Revision: https://reviews.llvm.org/D25710 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289854 91177308-0d34-0410-b5e6-96231b3b80d8
* Update docs to reflect new minimum MSVC version requirementReid Kleckner2016-10-191-5/+1
| | | | | | | | | | Mailing list discussion about this: http://lists.llvm.org/pipermail/llvm-dev/2016-September/104631.html Code changes to simplify the ifdefs will come next, and can be reverted without affecting the policy if someone needs it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284660 91177308-0d34-0410-b5e6-96231b3b80d8
* [docs] Increase minimum supported GCC version for building LLVM to 4.8Teresa Johnson2016-10-181-1/+1
| | | | | | | | | | | | | | | | | | | | Summary: The RFC proposal sent to increase the minimum required GCC version to 4.8 received a lot of support. See the following thread: http://lists.llvm.org/pipermail/llvm-dev/2016-October/105955.html, This patch implements that by updating the docs. I believe the references to libstdc++ 4.7 issues can be removed as well, please let me know if that is not the case or if they should be updated a different way. Reviewers: rengolin Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D25683 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284497 91177308-0d34-0410-b5e6-96231b3b80d8
* [docs] Reduce the number of places 'minimum requirements' is mentioned to oneRenato Golin2016-10-171-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284380 91177308-0d34-0410-b5e6-96231b3b80d8
* [docs] Fix naming style in the exampleAlexander Kornienko2016-09-271-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282490 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the coding standards a bit more clear that we prefer the fancy newChandler Carruth2016-09-011-4/+5
| | | | | | | | | | | auto-brief format for doxygen comments. Most notable is switching to that in the example doxygen comment. I've also tweaked the wording but am happy to tweak it further if others have suggestions here. Mostly doing this to capture something I and others have been writing consistently and repeatedly in code reviews. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280419 91177308-0d34-0410-b5e6-96231b3b80d8
* Update coding standards for include style.Zachary Turner2016-08-231-1/+11
| | | | | | | Reviewed By: lattner Differential Revision: https://reviews.llvm.org/D23591 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279560 91177308-0d34-0410-b5e6-96231b3b80d8
* Clarify the statement on using #if 0 ... #endif in CodingStandards.Andrey Bokhanko2016-08-171-2/+4
| | | | | | | | | | The statement on using #if 0 ... #endif is not very clear (for people like me :-)). This patch clarifies it a bit to avoid confusion. Differential Revision: https://reviews.llvm.org/D23404 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278932 91177308-0d34-0410-b5e6-96231b3b80d8
* Disable Visual C++ 2013 Debug mode assert on null pointer in some STL ↵Yaron Keren2015-08-211-2/+0
| | | | | | | | | | | | | | | | | algorithms, such as std::equal on the third argument. This reverts previous workarounds. Predefining _DEBUG_POINTER_IMPL disables Visual C++ 2013 headers from defining it to a function performing the null pointer check. In practice, it's not that bad since any function actually using the nullptr will seg fault. The other iterator sanity checks remain enabled in the headers. Reviewed by Aaron Ballmanþ and Duncan P. N. Exon Smith. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245711 91177308-0d34-0410-b5e6-96231b3b80d8
* [docs] Fix minor typo in CodingStandards.rstVedant Kumar2015-08-191-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245473 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename all references to old mailing lists to new lists.llvm.org address.Tanya Lattner2015-08-051-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243999 91177308-0d34-0410-b5e6-96231b3b80d8
* Doxygen: Enable autobrief feature and update coding standards.Matthias Braun2015-05-151-14/+15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237417 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a note about permitting default member initializersReid Kleckner2015-04-301-1/+7
| | | | | | | Use them in WinEHPrepare so that we can spot any toolchain bugs that come up. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236244 91177308-0d34-0410-b5e6-96231b3b80d8
* CodingStyle: Allow delegating ctorsBenjamin Kramer2015-03-061-0/+2
| | | | | | Delegating constructors seem to work fine with all supported compilers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231473 91177308-0d34-0410-b5e6-96231b3b80d8
* Initializer lists are supported in MSVC 2013. Since that's our minimum ↵Aaron Ballman2015-03-041-3/+2
| | | | | | required version, we can move that to the list of acceptable C++11 features. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231313 91177308-0d34-0410-b5e6-96231b3b80d8
* Delete LLVM_DELETED_FUNCTION from coding standardsReid Kleckner2015-02-271-28/+0
| | | | | | | | | It didn't seem worth leaving behind a guideline to use '= delete' to make a class uncopyable. That's a well known C++ design pattern. Reported on the mailing list and in PR22724. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230776 91177308-0d34-0410-b5e6-96231b3b80d8
* fix a typoChris Lattner2015-02-251-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230510 91177308-0d34-0410-b5e6-96231b3b80d8
* Document that defaulted & deleted methods and explicit conversions are ↵Benjamin Kramer2015-02-161-0/+7
| | | | | | allowed now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229369 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove LLVM_HAS_VARIADIC_TEMPLATES and all the faux variadic workarounds ↵Benjamin Kramer2015-02-151-0/+2
| | | | | | | | guarded by it. We no longer support compilers without variadic template support. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229324 91177308-0d34-0410-b5e6-96231b3b80d8
* Update the docs to require at least MSVC 2013.Benjamin Kramer2015-02-151-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229323 91177308-0d34-0410-b5e6-96231b3b80d8
* Explicitly describe '///' versus '//' comment delimiters.Paul Robinson2015-01-221-2/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226750 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce Go coding standards for LLVM.Peter Collingbourne2014-10-141-0/+19
| | | | | | | | | Rather than define our own standards, we adopt a set of best practices that are already in use by the Go community. Differential Revision: http://reviews.llvm.org/D5761 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219646 91177308-0d34-0410-b5e6-96231b3b80d8
* CodingStandards: Document std::equal misbehaviourDuncan P. N. Exon Smith2014-08-191-0/+2
| | | | | | | I should have included this as part of r215986, which worked around this corner by changing ArrayRef::equals() not to use std::equal. Alas. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215988 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the recommendation against using std::functionReid Kleckner2014-07-021-4/+1
| | | | | | | | Clang-cl supports MSVC-style RTTI now, and we can even compile typeid(...) with /GR-. Just don't instantiate std::function with a polymorphic type, or bad things will happen. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212148 91177308-0d34-0410-b5e6-96231b3b80d8
* Update programmers manual to cover llvm::function_ref, and add a note to theRichard Smith2014-05-061-0/+2
| | | | | | | 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-061-2/+0
| | | | 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-061-0/+2
| | | | | | | 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-171-3/+3
| | | | 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-171-0/+6
| | | | 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-081-5/+2
| | | | | | | | | | | | | :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-071-7/+5
| | | | | | 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-071-1/+5
| | | | 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-031-0/+4
| | | | | | | | | 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-031-0/+3
| | | | | | 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-031-0/+21
| | | | | | | | 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-031-5/+31
| | | | | | | | 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-021-0/+4
| | | | | | | | 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-021-4/+126
| | | | | | | | | | 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-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | 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-011-17/+16
| | | | | | | 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-281-0/+5
| | | | | | | | | | | | 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-281-0/+2
| | | | 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-281-0/+1
| | | | 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-281-16/+16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202532 91177308-0d34-0410-b5e6-96231b3b80d8