1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 10:42:39 +01:00
Commit Graph

102 Commits

Author SHA1 Message Date
Hafiz Abid Qadeer
3476612836 Update references to 'master' branch.
This commit replace 'master' with 'main' in llvm/docs.

Reviewed By: sammccall, kristof.beyls

Differential Revision: https://reviews.llvm.org/D92831
2020-12-21 19:10:34 +00:00
serge-sans-paille
82b6e6053d llvmbuildectomy - replace llvm-build by plain cmake
No longer rely on an external tool to build the llvm component layout.

Instead, leverage the existing `add_llvm_componentlibrary` cmake function and
introduce `add_llvm_component_group` to accurately describe component behavior.

These function store extra properties in the created targets. These properties
are processed once all components are defined to resolve library dependencies
and produce the header expected by llvm-config.

Differential Revision: https://reviews.llvm.org/D90848
2020-11-13 10:35:24 +01:00
Mircea Trofin
629123ee54 [doc] Describe the header guard style
clang-tidy's llvm-header-guard rule references the LLVM style - where it's
missing.

Differential Revision: https://reviews.llvm.org/D84989
2020-07-30 16:08:07 -07:00
Mehdi Amini
0080e83362 Clarify a bit the guideline on omitting braces, including more examples (NFC)
Like most readability rules, it isn't absolute and there is a matter of taste
to it. I think more recent part of the project may be more consistent in the
current application of the guideline. I suspect sources like
mlir/lib/Dialect/StandardOps/IR/Ops.cpp may be examples of this at the moment.

Differential Revision: https://reviews.llvm.org/D82594
2020-07-15 21:11:30 +00:00
Roman Lebedev
8aaa6d450e [Docs] CodingStandards: for_each is discouraged
Summary:
As per disscussion in D83351, using `for_each` is potentially confusing,
at least in regards to inconsistent style (there's less than 100 `for_each`
usages in LLVM, but ~100.000 `for` range-based loops

Therefore, it should be avoided.

Reviewers: dblaikie, nickdesaulniers

Reviewed By: dblaikie, nickdesaulniers

Subscribers: hubert.reinterpretcast, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D83431
2020-07-09 23:10:42 +03:00
Erich Keane
cec0aa2b18 [Docs] Add missing space, requested on c08ea07 2020-06-15 16:20:32 -07:00
Erich Keane
1999ec2f13 Add to the Coding Standard our that single-line bodies omit braces
This is a rule that seems to have been enforced for the better part of
the decade, so we should document it for new contributors.

Differential Revision: https://reviews.llvm.org/D80947
2020-06-11 12:46:15 -07:00
Jan Korous
668c3c2fae [docs] Fix self-contradictory description of llvm_unreachable
Just two paragraphs above it says:
"If the compiler does not support this [skipping code generation for a particular branch], it will fall back
to the "abort" implementation."

And that actually correctly describes llvm_unreachable implementation.

Differential Revision: https://reviews.llvm.org/D81130
2020-06-04 11:15:20 -07:00
James Henderson
ee28f21fbc [docs] Document coding standard for error and warning messages
In particular, these messages should start with a lower-case letter and
should have no trailing period at the end of the last sentence.

See http://lists.llvm.org/pipermail/llvm-dev/2020-March/140178.html for
context.

Reviewed by: aaron.ballman, hubert.reinterpretcast, rnk, dblaikie

Differential Revision: https://reviews.llvm.org/D76833
2020-03-31 12:41:17 +01:00
Aaron Ballman
e021b93f38 Clarify use of llvm_unreachable in the coding standard.
There has been some ongoing confusion regarding when to use `llvm_unreachable`
which this patch attempts to address. Specifically, the confusion has been
around whether `llvm_unreachable` is intended to mark only unreachable code
paths that the compiler cannot determine itself or to mark a code path which is
unconditionally a bug to reach. Based on email and IRC discussions, it sounds
like "unconditional bug to reach" is the consensus.
2020-03-26 08:08:23 -04:00
Reid Kleckner
d6e8266337 Add coding standard recommending use of qualifiers in cpp files
There is prior art for this in the code base itself, and a recent
example of this here: c45f8d49897f

This came up in discussion on this review where @maskray was going the
opposite direction:
  https://reviews.llvm.org/D68772

Given that there is disagreement, we should make a choice and document
it.

Thanks to John McCall for the precise wording.

Reviewed By: MaskRay, rjmccall

Differential Revision: https://reviews.llvm.org/D74515
2020-02-18 14:08:56 -08:00
Johannes Doerfert
cda90fcba8 [CodingStandards] Add link to "Picking the Right Data Structure"
See https://reviews.llvm.org/D74340
2020-02-11 11:06:04 -06:00
Johannes Doerfert
055899b12c [CodingStandards] Clarify C++ Standard Library usage
The existing wording leaves it unclear if C++ standard library data
structures should be preferred over custom LLVM ones, e.g., SmallVector,
even though common practice seems clear on the issue. This change makes
the wording more explicit and aligns it better with the code base.

Some motivating statistics:

```
ag SmallVector llvm/lib/ | wc
  8846   40306  901421
 ag 'std::vector' llvm/lib/ | wc
  2123    8990  214482

ag SmallVector clang/lib/ | wc
  3023   13824  281691
ag 'std::vector' clang/lib/ | wc
   719    2914   72817
```

Differential Revision: https://reviews.llvm.org/D74340
2020-02-10 20:30:00 -06:00
Kazuaki Ishizaki
09203c3fb4 [llvm] NFC: fix trivial typos in documents
Reviewers: hans, Jim

Reviewed By: Jim

Subscribers: jvesely, nhaehnle, mgorny, arphaman, bmahjour, kerbowa, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D73017
2020-01-22 11:32:51 +08:00
Dmitri Gribenko
3f3210569f Make coding standards document more inclusive
Summary: Patch by Doug Gregor, Tres Popp, and Dmitri Gribenko.

Reviewers: chandlerc

Subscribers: hfinkel, bmcreusillet, arsenm, doug.gregor, mgrang, arphaman, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D69354
2019-11-21 13:37:17 +01:00
Chandler Carruth
e778f38f69 Remove a no longer accurate sentence from the coding standards.
(And test my commit access. We're working on larger changes here.)
2019-10-23 11:40:45 -07:00
JF Bastien
a8dac4e648 Move to C++14
Summary:
I just bumped the minimum compiler versions to support C++14 in D66188.

Following [our process](http://llvm.org/docs/DeveloperPolicy.html#toolchain) and [our previous agreement](http://lists.llvm.org/pipermail/llvm-dev/2019-January/129452.html), I'm now officially bumping the C++ version to 14 and updating the documentation.

Subscribers: mgorny, jkorous, dexonsmith, llvm-commits, chandlerc, thakis, EricWF, jyknight, lhames, JDevlieghere

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D66195

llvm-svn: 368887
2019-08-14 17:39:07 +00:00
Chandler Carruth
a99d7ed28d Update the coding standards with the new file header.
llvm-svn: 351652
2019-01-19 11:53:58 +00:00
Paul Robinson
23884518cb Document how to comment an actual parameter.
Differential Revision: https://reviews.llvm.org/D54446

llvm-svn: 346861
2018-11-14 13:43:19 +00:00
Chandler Carruth
5fa7afa32f [IR] Replace isa<TerminatorInst> with isTerminator().
This is a bit awkward in a handful of places where we didn't even have
an instruction and now we have to see if we can build one. But on the
whole, this seems like a win and at worst a reasonable cost for removing
`TerminatorInst`.

All of this is part of the removal of `TerminatorInst` from the
`Instruction` type hierarchy.

llvm-svn: 340701
2018-08-26 09:51:22 +00:00
Aaron Ballman
bf8501e8ad Update the coding standards and developer policy documentation surrounding whitespace.
Clarify that you should not introduce trailing whitespace when making a commit and that you should not remove trailing whitespace that's unrelated to code you are changing or are about to change. Then clarified the developer policy around what is considered an obvious whitespace commit.

llvm-svn: 339455
2018-08-10 17:26:07 +00:00
JF Bastien
5dd128957a [NFC] update coding standard links to HTTPS
Update one link which redirected, and remove an Amazon ref.

llvm-svn: 332735
2018-05-18 16:44:13 +00:00
Mandeep Singh Grang
ebcc9ff3fd [docs] Add a note on non-deterministic sorting order of equal elements
Reviewers: RKSimon, t.p.northover, dexonsmith

Reviewed By: RKSimon

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D45831

llvm-svn: 330773
2018-04-24 21:25:57 +00:00
Alexander Kornienko
6ddaaf46cf Minor fix in docs.
llvm-svn: 329277
2018-04-05 12:48:22 +00:00
David Blaikie
1f3c1d599a Coding Standards: Document library layering requirements & header isolation.
(I suppose these two pieces could be separated - but seemed related
enough)

As discussed on llvm-dev, this documents the general expectation of how
library layering should be handled. There are a few existing cases where
these constraints are not met, but as with most style guide things -
this is forward looking and provides guidance when cleaning up existing
code, it doesn't immediately require that all previous code be cleaned
up to match. (see: naming conventions, etc)

Differential Revision: https://reviews.llvm.org/D42771

llvm-svn: 324004
2018-02-01 21:03:35 +00:00
Hans Wennborg
462bb76a57 Update some code.google.com links
llvm-svn: 318115
2017-11-13 23:47:58 +00:00
Mandeep Singh Grang
12350cd943 [docs] Add a note on iteration of unordered containers to coding standards
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

llvm-svn: 312667
2017-09-06 20:19:10 +00:00
Alex Bradbury
3afa781834 [Docs] Update CodingStandards to recommend range-based for loops
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

llvm-svn: 312236
2017-08-31 12:34:20 +00:00
Alex Bradbury
305bbba6b4 Refine report_fatal_error guidance after post-commit review
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.

llvm-svn: 311147
2017-08-18 06:45:34 +00:00
Alex Bradbury
7e1ad5a152 Give guidance on report_fatal_error in CodingStandards.rst and 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

llvm-svn: 311146
2017-08-18 05:29:21 +00:00
Hiroshi Inoue
7c30291c1b fix typos in a document; NFC
llvm-svn: 308331
2017-07-18 17:52:47 +00:00
Reid Kleckner
34418e533c Fix some remaining documentation references to MSVC 2013
MSVC 2015 has been the minimum supported version of VS since October.

Differential Revision: https://reviews.llvm.org/D25710

llvm-svn: 289854
2016-12-15 19:08:02 +00:00
Reid Kleckner
56e21c5de4 Update docs to reflect new minimum MSVC version requirement
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.

llvm-svn: 284660
2016-10-19 23:04:41 +00:00
Teresa Johnson
b21b115cce [docs] Increase minimum supported GCC version for building LLVM to 4.8
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

llvm-svn: 284497
2016-10-18 17:17:37 +00:00
Renato Golin
f39706c65a [docs] Reduce the number of places 'minimum requirements' is mentioned to one
llvm-svn: 284380
2016-10-17 12:29:00 +00:00
Alexander Kornienko
3a2952c312 [docs] Fix naming style in the example
llvm-svn: 282490
2016-09-27 14:49:45 +00:00
Chandler Carruth
6f18fb32db Make the coding standards a bit more clear that we prefer the fancy new
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.

llvm-svn: 280419
2016-09-01 22:18:25 +00:00
Zachary Turner
c9ffc82e08 Update coding standards for include style.
Reviewed By: lattner
Differential Revision: https://reviews.llvm.org/D23591

llvm-svn: 279560
2016-08-23 20:07:32 +00:00
Andrey Bokhanko
584f261fc5 Clarify the statement on using #if 0 ... #endif in CodingStandards.
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

llvm-svn: 278932
2016-08-17 14:53:18 +00:00
Yaron Keren
6479d6085a Disable Visual C++ 2013 Debug mode assert on null pointer in some STL 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.

llvm-svn: 245711
2015-08-21 17:31:03 +00:00
Vedant Kumar
3af788ee60 [docs] Fix minor typo in CodingStandards.rst
llvm-svn: 245473
2015-08-19 18:19:12 +00:00
Tanya Lattner
a72d000c61 Rename all references to old mailing lists to new lists.llvm.org address.
llvm-svn: 243999
2015-08-05 03:51:17 +00:00
Matthias Braun
f0934645e6 Doxygen: Enable autobrief feature and update coding standards.
llvm-svn: 237417
2015-05-15 03:34:01 +00:00
Reid Kleckner
f16b28762e Add a note about permitting default member initializers
Use them in WinEHPrepare so that we can spot any toolchain bugs that
come up.

llvm-svn: 236244
2015-04-30 18:17:12 +00:00
Benjamin Kramer
11906dabef CodingStyle: Allow delegating ctors
Delegating constructors seem to work fine with all supported compilers.

llvm-svn: 231473
2015-03-06 13:46:50 +00:00
Aaron Ballman
d0d3ba7199 Initializer lists are supported in MSVC 2013. Since that's our minimum required version, we can move that to the list of acceptable C++11 features.
llvm-svn: 231313
2015-03-04 23:17:31 +00:00
Reid Kleckner
27f79d7986 Delete LLVM_DELETED_FUNCTION from coding standards
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.

llvm-svn: 230776
2015-02-27 18:34:16 +00:00
Chris Lattner
21feff6ab2 fix a typo
llvm-svn: 230510
2015-02-25 17:28:41 +00:00
Benjamin Kramer
a78f8364ea Document that defaulted & deleted methods and explicit conversions are allowed now.
llvm-svn: 229369
2015-02-16 10:28:41 +00:00
Benjamin Kramer
c1b3bb4e32 Remove LLVM_HAS_VARIADIC_TEMPLATES and all the faux variadic workarounds guarded by it.
We no longer support compilers without variadic template support.

llvm-svn: 229324
2015-02-15 19:34:28 +00:00