annotate llvm/docs/DeveloperPolicy.rst @ 164:fdfabb438fbf

...
author anatofuz
date Thu, 19 Mar 2020 17:02:53 +0900
parents 1d019706d866
children 0572611fdcc8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 =====================
anatofuz
parents:
diff changeset
2 LLVM Developer Policy
anatofuz
parents:
diff changeset
3 =====================
anatofuz
parents:
diff changeset
4
anatofuz
parents:
diff changeset
5 .. contents::
anatofuz
parents:
diff changeset
6 :local:
anatofuz
parents:
diff changeset
7
anatofuz
parents:
diff changeset
8 Introduction
anatofuz
parents:
diff changeset
9 ============
anatofuz
parents:
diff changeset
10
anatofuz
parents:
diff changeset
11 This document contains the LLVM Developer Policy which defines the project's
anatofuz
parents:
diff changeset
12 policy towards developers and their contributions. The intent of this policy is
anatofuz
parents:
diff changeset
13 to eliminate miscommunication, rework, and confusion that might arise from the
anatofuz
parents:
diff changeset
14 distributed nature of LLVM's development. By stating the policy in clear terms,
anatofuz
parents:
diff changeset
15 we hope each developer can know ahead of time what to expect when making LLVM
anatofuz
parents:
diff changeset
16 contributions. This policy covers all llvm.org subprojects, including Clang,
anatofuz
parents:
diff changeset
17 LLDB, libc++, etc.
anatofuz
parents:
diff changeset
18
anatofuz
parents:
diff changeset
19 This policy is also designed to accomplish the following objectives:
anatofuz
parents:
diff changeset
20
anatofuz
parents:
diff changeset
21 #. Attract both users and developers to the LLVM project.
anatofuz
parents:
diff changeset
22
anatofuz
parents:
diff changeset
23 #. Make life as simple and easy for contributors as possible.
anatofuz
parents:
diff changeset
24
anatofuz
parents:
diff changeset
25 #. Keep the top of tree as stable as possible.
anatofuz
parents:
diff changeset
26
anatofuz
parents:
diff changeset
27 #. Establish awareness of the project's :ref:`copyright, license, and patent
anatofuz
parents:
diff changeset
28 policies <copyright-license-patents>` with contributors to the project.
anatofuz
parents:
diff changeset
29
anatofuz
parents:
diff changeset
30 This policy is aimed at frequent contributors to LLVM. People interested in
anatofuz
parents:
diff changeset
31 contributing one-off patches can do so in an informal way by sending them to the
anatofuz
parents:
diff changeset
32 `llvm-commits mailing list
anatofuz
parents:
diff changeset
33 <http://lists.llvm.org/mailman/listinfo/llvm-commits>`_ and engaging another
anatofuz
parents:
diff changeset
34 developer to see it through the process.
anatofuz
parents:
diff changeset
35
anatofuz
parents:
diff changeset
36 Developer Policies
anatofuz
parents:
diff changeset
37 ==================
anatofuz
parents:
diff changeset
38
anatofuz
parents:
diff changeset
39 This section contains policies that pertain to frequent LLVM developers. We
anatofuz
parents:
diff changeset
40 always welcome `one-off patches`_ from people who do not routinely contribute to
anatofuz
parents:
diff changeset
41 LLVM, but we expect more from frequent contributors to keep the system as
anatofuz
parents:
diff changeset
42 efficient as possible for everyone. Frequent LLVM contributors are expected to
anatofuz
parents:
diff changeset
43 meet the following requirements in order for LLVM to maintain a high standard of
anatofuz
parents:
diff changeset
44 quality.
anatofuz
parents:
diff changeset
45
anatofuz
parents:
diff changeset
46 Stay Informed
anatofuz
parents:
diff changeset
47 -------------
anatofuz
parents:
diff changeset
48
anatofuz
parents:
diff changeset
49 Developers should stay informed by reading at least the "dev" mailing list for
anatofuz
parents:
diff changeset
50 the projects you are interested in, such as `llvm-dev
anatofuz
parents:
diff changeset
51 <http://lists.llvm.org/mailman/listinfo/llvm-dev>`_ for LLVM, `cfe-dev
anatofuz
parents:
diff changeset
52 <http://lists.llvm.org/mailman/listinfo/cfe-dev>`_ for Clang, or `lldb-dev
anatofuz
parents:
diff changeset
53 <http://lists.llvm.org/mailman/listinfo/lldb-dev>`_ for LLDB. If you are
anatofuz
parents:
diff changeset
54 doing anything more than just casual work on LLVM, it is suggested that you also
anatofuz
parents:
diff changeset
55 subscribe to the "commits" mailing list for the subproject you're interested in,
anatofuz
parents:
diff changeset
56 such as `llvm-commits
anatofuz
parents:
diff changeset
57 <http://lists.llvm.org/mailman/listinfo/llvm-commits>`_, `cfe-commits
anatofuz
parents:
diff changeset
58 <http://lists.llvm.org/mailman/listinfo/cfe-commits>`_, or `lldb-commits
anatofuz
parents:
diff changeset
59 <http://lists.llvm.org/mailman/listinfo/lldb-commits>`_. Reading the
anatofuz
parents:
diff changeset
60 "commits" list and paying attention to changes being made by others is a good
anatofuz
parents:
diff changeset
61 way to see what other people are interested in and watching the flow of the
anatofuz
parents:
diff changeset
62 project as a whole.
anatofuz
parents:
diff changeset
63
anatofuz
parents:
diff changeset
64 We recommend that active developers register an email account with `LLVM
anatofuz
parents:
diff changeset
65 Bugzilla <https://bugs.llvm.org/>`_ and preferably subscribe to the `llvm-bugs
anatofuz
parents:
diff changeset
66 <http://lists.llvm.org/mailman/listinfo/llvm-bugs>`_ email list to keep track
anatofuz
parents:
diff changeset
67 of bugs and enhancements occurring in LLVM. We really appreciate people who are
anatofuz
parents:
diff changeset
68 proactive at catching incoming bugs in their components and dealing with them
anatofuz
parents:
diff changeset
69 promptly.
anatofuz
parents:
diff changeset
70
anatofuz
parents:
diff changeset
71 Please be aware that all public LLVM mailing lists are public and archived, and
anatofuz
parents:
diff changeset
72 that notices of confidentiality or non-disclosure cannot be respected.
anatofuz
parents:
diff changeset
73
anatofuz
parents:
diff changeset
74 .. _patch:
anatofuz
parents:
diff changeset
75 .. _one-off patches:
anatofuz
parents:
diff changeset
76
anatofuz
parents:
diff changeset
77 Making and Submitting a Patch
anatofuz
parents:
diff changeset
78 -----------------------------
anatofuz
parents:
diff changeset
79
anatofuz
parents:
diff changeset
80 When making a patch for review, the goal is to make it as easy for the reviewer
anatofuz
parents:
diff changeset
81 to read it as possible. As such, we recommend that you:
anatofuz
parents:
diff changeset
82
anatofuz
parents:
diff changeset
83 #. Make your patch against git master, not a branch, and not an old version
anatofuz
parents:
diff changeset
84 of LLVM. This makes it easy to apply the patch. For information on how to
anatofuz
parents:
diff changeset
85 clone from git, please see the :ref:`Getting Started Guide
anatofuz
parents:
diff changeset
86 <checkout>`.
anatofuz
parents:
diff changeset
87
anatofuz
parents:
diff changeset
88 #. Similarly, patches should be submitted soon after they are generated. Old
anatofuz
parents:
diff changeset
89 patches may not apply correctly if the underlying code changes between the
anatofuz
parents:
diff changeset
90 time the patch was created and the time it is applied.
anatofuz
parents:
diff changeset
91
anatofuz
parents:
diff changeset
92 #. Patches should be made with ``git format-patch``, or similar. If you use a
anatofuz
parents:
diff changeset
93 different tool, make sure it uses the ``diff -u`` format and that it
anatofuz
parents:
diff changeset
94 doesn't contain clutter which makes it hard to read.
anatofuz
parents:
diff changeset
95
anatofuz
parents:
diff changeset
96 Once your patch is ready, submit it by emailing it to the appropriate project's
anatofuz
parents:
diff changeset
97 commit mailing list (or commit it directly if applicable). Alternatively, some
anatofuz
parents:
diff changeset
98 patches get sent to the project's development list or component of the LLVM bug
anatofuz
parents:
diff changeset
99 tracker, but the commit list is the primary place for reviews and should
anatofuz
parents:
diff changeset
100 generally be preferred.
anatofuz
parents:
diff changeset
101
anatofuz
parents:
diff changeset
102 When sending a patch to a mailing list, it is a good idea to send it as an
anatofuz
parents:
diff changeset
103 *attachment* to the message, not embedded into the text of the message. This
anatofuz
parents:
diff changeset
104 ensures that your mailer will not mangle the patch when it sends it (e.g. by
anatofuz
parents:
diff changeset
105 making whitespace changes or by wrapping lines).
anatofuz
parents:
diff changeset
106
anatofuz
parents:
diff changeset
107 *For Thunderbird users:* Before submitting a patch, please open *Preferences >
anatofuz
parents:
diff changeset
108 Advanced > General > Config Editor*, find the key
anatofuz
parents:
diff changeset
109 ``mail.content_disposition_type``, and set its value to ``1``. Without this
anatofuz
parents:
diff changeset
110 setting, Thunderbird sends your attachment using ``Content-Disposition: inline``
anatofuz
parents:
diff changeset
111 rather than ``Content-Disposition: attachment``. Apple Mail gamely displays such
anatofuz
parents:
diff changeset
112 a file inline, making it difficult to work with for reviewers using that
anatofuz
parents:
diff changeset
113 program.
anatofuz
parents:
diff changeset
114
anatofuz
parents:
diff changeset
115 When submitting patches, please do not add confidentiality or non-disclosure
anatofuz
parents:
diff changeset
116 notices to the patches themselves. These notices conflict with the LLVM
anatofuz
parents:
diff changeset
117 licensing terms and may result in your contribution being excluded.
anatofuz
parents:
diff changeset
118
anatofuz
parents:
diff changeset
119 .. _code review:
anatofuz
parents:
diff changeset
120
anatofuz
parents:
diff changeset
121 Code Reviews
anatofuz
parents:
diff changeset
122 ------------
anatofuz
parents:
diff changeset
123
anatofuz
parents:
diff changeset
124 LLVM has a code review policy. Code review is one way to increase the quality of
anatofuz
parents:
diff changeset
125 software. We generally follow these policies:
anatofuz
parents:
diff changeset
126
anatofuz
parents:
diff changeset
127 #. All developers are required to have significant changes reviewed before they
anatofuz
parents:
diff changeset
128 are committed to the repository.
anatofuz
parents:
diff changeset
129
anatofuz
parents:
diff changeset
130 #. Code reviews are conducted by email on the relevant project's commit mailing
anatofuz
parents:
diff changeset
131 list, or alternatively on the project's development list or bug tracker.
anatofuz
parents:
diff changeset
132
anatofuz
parents:
diff changeset
133 #. Code can be reviewed either before it is committed or after. We expect major
anatofuz
parents:
diff changeset
134 changes to be reviewed before being committed, but smaller changes (or
anatofuz
parents:
diff changeset
135 changes where the developer owns the component) can be reviewed after commit.
anatofuz
parents:
diff changeset
136
anatofuz
parents:
diff changeset
137 #. The developer responsible for a code change is also responsible for making
anatofuz
parents:
diff changeset
138 all necessary review-related changes.
anatofuz
parents:
diff changeset
139
anatofuz
parents:
diff changeset
140 #. Code review can be an iterative process, which continues until the patch is
anatofuz
parents:
diff changeset
141 ready to be committed. Specifically, once a patch is sent out for review, it
anatofuz
parents:
diff changeset
142 needs an explicit "looks good" before it is submitted. Do not assume silent
anatofuz
parents:
diff changeset
143 approval, or request active objections to the patch with a deadline.
anatofuz
parents:
diff changeset
144
anatofuz
parents:
diff changeset
145 Sometimes code reviews will take longer than you would hope for, especially for
anatofuz
parents:
diff changeset
146 larger features. Accepted ways to speed up review times for your patches are:
anatofuz
parents:
diff changeset
147
anatofuz
parents:
diff changeset
148 * Review other people's patches. If you help out, everybody will be more
anatofuz
parents:
diff changeset
149 willing to do the same for you; goodwill is our currency.
anatofuz
parents:
diff changeset
150 * Ping the patch. If it is urgent, provide reasons why it is important to you to
anatofuz
parents:
diff changeset
151 get this patch landed and ping it every couple of days. If it is
anatofuz
parents:
diff changeset
152 not urgent, the common courtesy ping rate is one week. Remember that you're
anatofuz
parents:
diff changeset
153 asking for valuable time from other professional developers.
anatofuz
parents:
diff changeset
154 * Ask for help on IRC. Developers on IRC will be able to either help you
anatofuz
parents:
diff changeset
155 directly, or tell you who might be a good reviewer.
anatofuz
parents:
diff changeset
156 * Split your patch into multiple smaller patches that build on each other. The
anatofuz
parents:
diff changeset
157 smaller your patch, the higher the probability that somebody will take a quick
anatofuz
parents:
diff changeset
158 look at it.
anatofuz
parents:
diff changeset
159
anatofuz
parents:
diff changeset
160 Developers should participate in code reviews as both reviewers and
anatofuz
parents:
diff changeset
161 reviewees. If someone is kind enough to review your code, you should return the
anatofuz
parents:
diff changeset
162 favor for someone else. Note that anyone is welcome to review and give feedback
anatofuz
parents:
diff changeset
163 on a patch, but only people with GitHub commit access can approve it.
anatofuz
parents:
diff changeset
164
anatofuz
parents:
diff changeset
165 There is a web based code review tool that can optionally be used
anatofuz
parents:
diff changeset
166 for code reviews. See :doc:`Phabricator`.
anatofuz
parents:
diff changeset
167
anatofuz
parents:
diff changeset
168 .. _code owners:
anatofuz
parents:
diff changeset
169
anatofuz
parents:
diff changeset
170 Code Owners
anatofuz
parents:
diff changeset
171 -----------
anatofuz
parents:
diff changeset
172
anatofuz
parents:
diff changeset
173 The LLVM Project relies on two features of its process to maintain rapid
anatofuz
parents:
diff changeset
174 development in addition to the high quality of its source base: the combination
anatofuz
parents:
diff changeset
175 of code review plus post-commit review for trusted maintainers. Having both is
anatofuz
parents:
diff changeset
176 a great way for the project to take advantage of the fact that most people do
anatofuz
parents:
diff changeset
177 the right thing most of the time, and only commit patches without pre-commit
anatofuz
parents:
diff changeset
178 review when they are confident they are right.
anatofuz
parents:
diff changeset
179
anatofuz
parents:
diff changeset
180 The trick to this is that the project has to guarantee that all patches that are
anatofuz
parents:
diff changeset
181 committed are reviewed after they go in: you don't want everyone to assume
anatofuz
parents:
diff changeset
182 someone else will review it, allowing the patch to go unreviewed. To solve this
anatofuz
parents:
diff changeset
183 problem, we have a notion of an 'owner' for a piece of the code. The sole
anatofuz
parents:
diff changeset
184 responsibility of a code owner is to ensure that a commit to their area of the
anatofuz
parents:
diff changeset
185 code is appropriately reviewed, either by themself or by someone else. The list
anatofuz
parents:
diff changeset
186 of current code owners can be found in the file `CODE_OWNERS.TXT
anatofuz
parents:
diff changeset
187 <https://github.com/llvm/llvm-project/blob/master/llvm/CODE_OWNERS.TXT>`_ in the
anatofuz
parents:
diff changeset
188 root of the LLVM source tree.
anatofuz
parents:
diff changeset
189
anatofuz
parents:
diff changeset
190 Note that code ownership is completely different than reviewers: anyone can
anatofuz
parents:
diff changeset
191 review a piece of code, and we welcome code review from anyone who is
anatofuz
parents:
diff changeset
192 interested. Code owners are the "last line of defense" to guarantee that all
anatofuz
parents:
diff changeset
193 patches that are committed are actually reviewed.
anatofuz
parents:
diff changeset
194
anatofuz
parents:
diff changeset
195 Being a code owner is a somewhat unglamorous position, but it is incredibly
anatofuz
parents:
diff changeset
196 important for the ongoing success of the project. Because people get busy,
anatofuz
parents:
diff changeset
197 interests change, and unexpected things happen, code ownership is purely opt-in,
anatofuz
parents:
diff changeset
198 and anyone can choose to resign their "title" at any time. For now, we do not
anatofuz
parents:
diff changeset
199 have an official policy on how one gets elected to be a code owner.
anatofuz
parents:
diff changeset
200
anatofuz
parents:
diff changeset
201 .. _include a testcase:
anatofuz
parents:
diff changeset
202
anatofuz
parents:
diff changeset
203 Test Cases
anatofuz
parents:
diff changeset
204 ----------
anatofuz
parents:
diff changeset
205
anatofuz
parents:
diff changeset
206 Developers are required to create test cases for any bugs fixed and any new
anatofuz
parents:
diff changeset
207 features added. Some tips for getting your testcase approved:
anatofuz
parents:
diff changeset
208
anatofuz
parents:
diff changeset
209 * All feature and regression test cases are added to the ``llvm/test``
anatofuz
parents:
diff changeset
210 directory. The appropriate sub-directory should be selected (see the
anatofuz
parents:
diff changeset
211 :doc:`Testing Guide <TestingGuide>` for details).
anatofuz
parents:
diff changeset
212
anatofuz
parents:
diff changeset
213 * Test cases should be written in :doc:`LLVM assembly language <LangRef>`.
anatofuz
parents:
diff changeset
214
anatofuz
parents:
diff changeset
215 * Test cases, especially for regressions, should be reduced as much as possible,
anatofuz
parents:
diff changeset
216 by :doc:`bugpoint <Bugpoint>` or manually. It is unacceptable to place an
anatofuz
parents:
diff changeset
217 entire failing program into ``llvm/test`` as this creates a *time-to-test*
anatofuz
parents:
diff changeset
218 burden on all developers. Please keep them short.
anatofuz
parents:
diff changeset
219
anatofuz
parents:
diff changeset
220 Note that llvm/test and clang/test are designed for regression and small feature
anatofuz
parents:
diff changeset
221 tests only. More extensive test cases (e.g., entire applications, benchmarks,
anatofuz
parents:
diff changeset
222 etc) should be added to the ``llvm-test`` test suite. The llvm-test suite is
anatofuz
parents:
diff changeset
223 for coverage (correctness, performance, etc) testing, not feature or regression
anatofuz
parents:
diff changeset
224 testing.
anatofuz
parents:
diff changeset
225
anatofuz
parents:
diff changeset
226 Quality
anatofuz
parents:
diff changeset
227 -------
anatofuz
parents:
diff changeset
228
anatofuz
parents:
diff changeset
229 The minimum quality standards that any change must satisfy before being
anatofuz
parents:
diff changeset
230 committed to the main development branch are:
anatofuz
parents:
diff changeset
231
anatofuz
parents:
diff changeset
232 #. Code must adhere to the `LLVM Coding Standards <CodingStandards.html>`_.
anatofuz
parents:
diff changeset
233
anatofuz
parents:
diff changeset
234 #. Code must compile cleanly (no errors, no warnings) on at least one platform.
anatofuz
parents:
diff changeset
235
anatofuz
parents:
diff changeset
236 #. Bug fixes and new features should `include a testcase`_ so we know if the
anatofuz
parents:
diff changeset
237 fix/feature ever regresses in the future.
anatofuz
parents:
diff changeset
238
anatofuz
parents:
diff changeset
239 #. Code must pass the ``llvm/test`` test suite.
anatofuz
parents:
diff changeset
240
anatofuz
parents:
diff changeset
241 #. The code must not cause regressions on a reasonable subset of llvm-test,
anatofuz
parents:
diff changeset
242 where "reasonable" depends on the contributor's judgement and the scope of
anatofuz
parents:
diff changeset
243 the change (more invasive changes require more testing). A reasonable subset
anatofuz
parents:
diff changeset
244 might be something like "``llvm-test/MultiSource/Benchmarks``".
anatofuz
parents:
diff changeset
245
anatofuz
parents:
diff changeset
246 Additionally, the committer is responsible for addressing any problems found in
anatofuz
parents:
diff changeset
247 the future that the change is responsible for. For example:
anatofuz
parents:
diff changeset
248
anatofuz
parents:
diff changeset
249 * The code should compile cleanly on all supported platforms.
anatofuz
parents:
diff changeset
250
anatofuz
parents:
diff changeset
251 * The changes should not cause any correctness regressions in the ``llvm-test``
anatofuz
parents:
diff changeset
252 suite and must not cause any major performance regressions.
anatofuz
parents:
diff changeset
253
anatofuz
parents:
diff changeset
254 * The change set should not cause performance or correctness regressions for the
anatofuz
parents:
diff changeset
255 LLVM tools.
anatofuz
parents:
diff changeset
256
anatofuz
parents:
diff changeset
257 * The changes should not cause performance or correctness regressions in code
anatofuz
parents:
diff changeset
258 compiled by LLVM on all applicable targets.
anatofuz
parents:
diff changeset
259
anatofuz
parents:
diff changeset
260 * You are expected to address any `Bugzilla bugs <https://bugs.llvm.org/>`_ that
anatofuz
parents:
diff changeset
261 result from your change.
anatofuz
parents:
diff changeset
262
anatofuz
parents:
diff changeset
263 We prefer for this to be handled before submission but understand that it isn't
anatofuz
parents:
diff changeset
264 possible to test all of this for every submission. Our build bots and nightly
anatofuz
parents:
diff changeset
265 testing infrastructure normally finds these problems. A good rule of thumb is
anatofuz
parents:
diff changeset
266 to check the nightly testers for regressions the day after your change. Build
anatofuz
parents:
diff changeset
267 bots will directly email you if a group of commits that included yours caused a
anatofuz
parents:
diff changeset
268 failure. You are expected to check the build bot messages to see if they are
anatofuz
parents:
diff changeset
269 your fault and, if so, fix the breakage.
anatofuz
parents:
diff changeset
270
anatofuz
parents:
diff changeset
271 Commits that violate these quality standards (e.g. are very broken) may be
anatofuz
parents:
diff changeset
272 reverted. This is necessary when the change blocks other developers from making
anatofuz
parents:
diff changeset
273 progress. The developer is welcome to re-commit the change after the problem has
anatofuz
parents:
diff changeset
274 been fixed.
anatofuz
parents:
diff changeset
275
anatofuz
parents:
diff changeset
276 .. _commit messages:
anatofuz
parents:
diff changeset
277
anatofuz
parents:
diff changeset
278 Commit messages
anatofuz
parents:
diff changeset
279 ---------------
anatofuz
parents:
diff changeset
280
anatofuz
parents:
diff changeset
281 Although we don't enforce the format of commit messages, we prefer that
anatofuz
parents:
diff changeset
282 you follow these guidelines to help review, search in logs, email formatting
anatofuz
parents:
diff changeset
283 and so on. These guidelines are very similar to rules used by other open source
anatofuz
parents:
diff changeset
284 projects.
anatofuz
parents:
diff changeset
285
anatofuz
parents:
diff changeset
286 Most importantly, the contents of the message should be carefully written to
anatofuz
parents:
diff changeset
287 convey the rationale of the change (without delving too much in detail). It
anatofuz
parents:
diff changeset
288 also should avoid being vague or overly specific. For example, "bits were not
anatofuz
parents:
diff changeset
289 set right" will leave the reviewer wondering about which bits, and why they
anatofuz
parents:
diff changeset
290 weren't right, while "Correctly set overflow bits in TargetInfo" conveys almost
anatofuz
parents:
diff changeset
291 all there is to the change.
anatofuz
parents:
diff changeset
292
anatofuz
parents:
diff changeset
293 Below are some guidelines about the format of the message itself:
anatofuz
parents:
diff changeset
294
anatofuz
parents:
diff changeset
295 * Separate the commit message into title and body separated by a blank line.
anatofuz
parents:
diff changeset
296
anatofuz
parents:
diff changeset
297 * If you're not the original author, ensure the 'Author' property of the commit is
anatofuz
parents:
diff changeset
298 set to the original author and the 'Committer' property is set to yourself.
anatofuz
parents:
diff changeset
299 You can use a command similar to
anatofuz
parents:
diff changeset
300 ``git commit --amend --author="John Doe <jdoe@llvm.org>`` to correct the
anatofuz
parents:
diff changeset
301 author property if it is incorrect. See `Attribution of Changes`_ for more
anatofuz
parents:
diff changeset
302 information including the method we used for attribution before the project
anatofuz
parents:
diff changeset
303 migrated to git.
anatofuz
parents:
diff changeset
304
anatofuz
parents:
diff changeset
305 * The title should be concise. Because all commits are emailed to the list with
anatofuz
parents:
diff changeset
306 the first line as the subject, long titles are frowned upon. Short titles
anatofuz
parents:
diff changeset
307 also look better in `git log`.
anatofuz
parents:
diff changeset
308
anatofuz
parents:
diff changeset
309 * When the changes are restricted to a specific part of the code (e.g. a
anatofuz
parents:
diff changeset
310 back-end or optimization pass), it is customary to add a tag to the
anatofuz
parents:
diff changeset
311 beginning of the line in square brackets. For example, "[SCEV] ..."
anatofuz
parents:
diff changeset
312 or "[OpenMP] ...". This helps email filters and searches for post-commit
anatofuz
parents:
diff changeset
313 reviews.
anatofuz
parents:
diff changeset
314
anatofuz
parents:
diff changeset
315 * The body, if it exists, should be separated from the title by an empty line.
anatofuz
parents:
diff changeset
316
anatofuz
parents:
diff changeset
317 * The body should be concise, but explanatory, including a complete
anatofuz
parents:
diff changeset
318 reasoning. Unless it is required to understand the change, examples,
anatofuz
parents:
diff changeset
319 code snippets and gory details should be left to bug comments, web
anatofuz
parents:
diff changeset
320 review or the mailing list.
anatofuz
parents:
diff changeset
321
anatofuz
parents:
diff changeset
322 * If the patch fixes a bug in bugzilla, please include the PR# in the message.
anatofuz
parents:
diff changeset
323
anatofuz
parents:
diff changeset
324 * Text formatting and spelling should follow the same rules as documentation
anatofuz
parents:
diff changeset
325 and in-code comments, ex. capitalization, full stop, etc.
anatofuz
parents:
diff changeset
326
anatofuz
parents:
diff changeset
327 * If the commit is a bug fix on top of another recently committed patch, or a
anatofuz
parents:
diff changeset
328 revert or reapply of a patch, include the git commit hash of the prior
anatofuz
parents:
diff changeset
329 related commit. This could be as simple as "Revert commit NNNN because it
anatofuz
parents:
diff changeset
330 caused PR#".
anatofuz
parents:
diff changeset
331
anatofuz
parents:
diff changeset
332 For minor violations of these recommendations, the community normally favors
anatofuz
parents:
diff changeset
333 reminding the contributor of this policy over reverting. Minor corrections and
anatofuz
parents:
diff changeset
334 omissions can be handled by sending a reply to the commits mailing list.
anatofuz
parents:
diff changeset
335
anatofuz
parents:
diff changeset
336 Obtaining Commit Access
anatofuz
parents:
diff changeset
337 -----------------------
anatofuz
parents:
diff changeset
338
anatofuz
parents:
diff changeset
339 New Contributors
anatofuz
parents:
diff changeset
340 ^^^^^^^^^^^^^^^^
anatofuz
parents:
diff changeset
341 We grant commit access to contributors with a track record of submitting high
anatofuz
parents:
diff changeset
342 quality patches. If you would like commit access, please send an email to
anatofuz
parents:
diff changeset
343 `Chris <mailto:clattner@llvm.org>`_ with your GitHub username.
anatofuz
parents:
diff changeset
344
anatofuz
parents:
diff changeset
345 Prior to obtaining commit access, it is common practice to request that
anatofuz
parents:
diff changeset
346 someone with commit access commits on your behalf. When doing so, please
anatofuz
parents:
diff changeset
347 provide the name and email address you would like to use in the Author
anatofuz
parents:
diff changeset
348 property of the commit.
anatofuz
parents:
diff changeset
349
anatofuz
parents:
diff changeset
350 Your first commit to a repository may require the autogenerated email to be
anatofuz
parents:
diff changeset
351 approved by a moderator of the mailing list.
anatofuz
parents:
diff changeset
352 This is normal and will be done when the mailing list owner has time.
anatofuz
parents:
diff changeset
353
anatofuz
parents:
diff changeset
354 If you have recently been granted commit access, these policies apply:
anatofuz
parents:
diff changeset
355
anatofuz
parents:
diff changeset
356 #. You are granted *commit-after-approval* to all parts of LLVM. To get
anatofuz
parents:
diff changeset
357 approval, submit a `patch`_ to `llvm-commits
anatofuz
parents:
diff changeset
358 <http://lists.llvm.org/mailman/listinfo/llvm-commits>`_. When approved,
anatofuz
parents:
diff changeset
359 you may commit it yourself.
anatofuz
parents:
diff changeset
360
anatofuz
parents:
diff changeset
361 #. You are allowed to commit patches without approval which you think are
anatofuz
parents:
diff changeset
362 obvious. This is clearly a subjective decision --- we simply expect you to
anatofuz
parents:
diff changeset
363 use good judgement. Examples include: fixing build breakage, reverting
anatofuz
parents:
diff changeset
364 obviously broken patches, documentation/comment changes, any other minor
anatofuz
parents:
diff changeset
365 changes. Avoid committing formatting- or whitespace-only changes outside of
anatofuz
parents:
diff changeset
366 code you plan to make subsequent changes to. Also, try to separate
anatofuz
parents:
diff changeset
367 formatting or whitespace changes from functional changes, either by
anatofuz
parents:
diff changeset
368 correcting the format first (ideally) or afterward. Such changes should be
anatofuz
parents:
diff changeset
369 highly localized and the commit message should clearly state that the commit
anatofuz
parents:
diff changeset
370 is not intended to change functionality, usually by stating it is
anatofuz
parents:
diff changeset
371 :ref:`NFC <nfc>`.
anatofuz
parents:
diff changeset
372
anatofuz
parents:
diff changeset
373 #. You are allowed to commit patches without approval to those portions of LLVM
anatofuz
parents:
diff changeset
374 that you have contributed or maintain (i.e., have been assigned
anatofuz
parents:
diff changeset
375 responsibility for), with the proviso that such commits must not break the
anatofuz
parents:
diff changeset
376 build. This is a "trust but verify" policy, and commits of this nature are
anatofuz
parents:
diff changeset
377 reviewed after they are committed.
anatofuz
parents:
diff changeset
378
anatofuz
parents:
diff changeset
379 #. Multiple violations of these policies or a single egregious violation may
anatofuz
parents:
diff changeset
380 cause commit access to be revoked.
anatofuz
parents:
diff changeset
381
anatofuz
parents:
diff changeset
382 In any case, your changes are still subject to `code review`_ (either before or
anatofuz
parents:
diff changeset
383 after they are committed, depending on the nature of the change). You are
anatofuz
parents:
diff changeset
384 encouraged to review other peoples' patches as well, but you aren't required
anatofuz
parents:
diff changeset
385 to do so.
anatofuz
parents:
diff changeset
386
anatofuz
parents:
diff changeset
387 Current Contributors - Transferring from SVN
anatofuz
parents:
diff changeset
388 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
anatofuz
parents:
diff changeset
389 If you had commit access to SVN and would like to request commit access to
anatofuz
parents:
diff changeset
390 GitHub, please email `llvm-admin <mailto:llvm-admin@lists.llvm.org>`_ with your
anatofuz
parents:
diff changeset
391 SVN username and GitHub username.
anatofuz
parents:
diff changeset
392
anatofuz
parents:
diff changeset
393 .. _discuss the change/gather consensus:
anatofuz
parents:
diff changeset
394
anatofuz
parents:
diff changeset
395 Making a Major Change
anatofuz
parents:
diff changeset
396 ---------------------
anatofuz
parents:
diff changeset
397
anatofuz
parents:
diff changeset
398 When a developer begins a major new project with the aim of contributing it back
anatofuz
parents:
diff changeset
399 to LLVM, they should inform the community with an email to the `llvm-dev
anatofuz
parents:
diff changeset
400 <http://lists.llvm.org/mailman/listinfo/llvm-dev>`_ email list, to the extent
anatofuz
parents:
diff changeset
401 possible. The reason for this is to:
anatofuz
parents:
diff changeset
402
anatofuz
parents:
diff changeset
403 #. keep the community informed about future changes to LLVM,
anatofuz
parents:
diff changeset
404
anatofuz
parents:
diff changeset
405 #. avoid duplication of effort by preventing multiple parties working on the
anatofuz
parents:
diff changeset
406 same thing and not knowing about it, and
anatofuz
parents:
diff changeset
407
anatofuz
parents:
diff changeset
408 #. ensure that any technical issues around the proposed work are discussed and
anatofuz
parents:
diff changeset
409 resolved before any significant work is done.
anatofuz
parents:
diff changeset
410
anatofuz
parents:
diff changeset
411 The design of LLVM is carefully controlled to ensure that all the pieces fit
anatofuz
parents:
diff changeset
412 together well and are as consistent as possible. If you plan to make a major
anatofuz
parents:
diff changeset
413 change to the way LLVM works or want to add a major new extension, it is a good
anatofuz
parents:
diff changeset
414 idea to get consensus with the development community before you start working on
anatofuz
parents:
diff changeset
415 it.
anatofuz
parents:
diff changeset
416
anatofuz
parents:
diff changeset
417 Once the design of the new feature is finalized, the work itself should be done
anatofuz
parents:
diff changeset
418 as a series of `incremental changes`_, not as a long-term development branch.
anatofuz
parents:
diff changeset
419
anatofuz
parents:
diff changeset
420 .. _incremental changes:
anatofuz
parents:
diff changeset
421
anatofuz
parents:
diff changeset
422 Incremental Development
anatofuz
parents:
diff changeset
423 -----------------------
anatofuz
parents:
diff changeset
424
anatofuz
parents:
diff changeset
425 In the LLVM project, we do all significant changes as a series of incremental
anatofuz
parents:
diff changeset
426 patches. We have a strong dislike for huge changes or long-term development
anatofuz
parents:
diff changeset
427 branches. Long-term development branches have a number of drawbacks:
anatofuz
parents:
diff changeset
428
anatofuz
parents:
diff changeset
429 #. Branches must have mainline merged into them periodically. If the branch
anatofuz
parents:
diff changeset
430 development and mainline development occur in the same pieces of code,
anatofuz
parents:
diff changeset
431 resolving merge conflicts can take a lot of time.
anatofuz
parents:
diff changeset
432
anatofuz
parents:
diff changeset
433 #. Other people in the community tend to ignore work on branches.
anatofuz
parents:
diff changeset
434
anatofuz
parents:
diff changeset
435 #. Huge changes (produced when a branch is merged back onto mainline) are
anatofuz
parents:
diff changeset
436 extremely difficult to `code review`_.
anatofuz
parents:
diff changeset
437
anatofuz
parents:
diff changeset
438 #. Branches are not routinely tested by our nightly tester infrastructure.
anatofuz
parents:
diff changeset
439
anatofuz
parents:
diff changeset
440 #. Changes developed as monolithic large changes often don't work until the
anatofuz
parents:
diff changeset
441 entire set of changes is done. Breaking it down into a set of smaller
anatofuz
parents:
diff changeset
442 changes increases the odds that any of the work will be committed to the main
anatofuz
parents:
diff changeset
443 repository.
anatofuz
parents:
diff changeset
444
anatofuz
parents:
diff changeset
445 To address these problems, LLVM uses an incremental development style and we
anatofuz
parents:
diff changeset
446 require contributors to follow this practice when making a large/invasive
anatofuz
parents:
diff changeset
447 change. Some tips:
anatofuz
parents:
diff changeset
448
anatofuz
parents:
diff changeset
449 * Large/invasive changes usually have a number of secondary changes that are
anatofuz
parents:
diff changeset
450 required before the big change can be made (e.g. API cleanup, etc). These
anatofuz
parents:
diff changeset
451 sorts of changes can often be done before the major change is done,
anatofuz
parents:
diff changeset
452 independently of that work.
anatofuz
parents:
diff changeset
453
anatofuz
parents:
diff changeset
454 * The remaining inter-related work should be decomposed into unrelated sets of
anatofuz
parents:
diff changeset
455 changes if possible. Once this is done, define the first increment and get
anatofuz
parents:
diff changeset
456 consensus on what the end goal of the change is.
anatofuz
parents:
diff changeset
457
anatofuz
parents:
diff changeset
458 * Each change in the set can be stand alone (e.g. to fix a bug), or part of a
anatofuz
parents:
diff changeset
459 planned series of changes that works towards the development goal.
anatofuz
parents:
diff changeset
460
anatofuz
parents:
diff changeset
461 * Each change should be kept as small as possible. This simplifies your work
anatofuz
parents:
diff changeset
462 (into a logical progression), simplifies code review and reduces the chance
anatofuz
parents:
diff changeset
463 that you will get negative feedback on the change. Small increments also
anatofuz
parents:
diff changeset
464 facilitate the maintenance of a high quality code base.
anatofuz
parents:
diff changeset
465
anatofuz
parents:
diff changeset
466 * Often, an independent precursor to a big change is to add a new API and slowly
anatofuz
parents:
diff changeset
467 migrate clients to use the new API. Each change to use the new API is often
anatofuz
parents:
diff changeset
468 "obvious" and can be committed without review. Once the new API is in place
anatofuz
parents:
diff changeset
469 and used, it is much easier to replace the underlying implementation of the
anatofuz
parents:
diff changeset
470 API. This implementation change is logically separate from the API
anatofuz
parents:
diff changeset
471 change.
anatofuz
parents:
diff changeset
472
anatofuz
parents:
diff changeset
473 If you are interested in making a large change, and this scares you, please make
anatofuz
parents:
diff changeset
474 sure to first `discuss the change/gather consensus`_ then ask about the best way
anatofuz
parents:
diff changeset
475 to go about making the change.
anatofuz
parents:
diff changeset
476
anatofuz
parents:
diff changeset
477 Attribution of Changes
anatofuz
parents:
diff changeset
478 ----------------------
anatofuz
parents:
diff changeset
479
anatofuz
parents:
diff changeset
480 When contributors submit a patch to an LLVM project, other developers with
anatofuz
parents:
diff changeset
481 commit access may commit it for the author once appropriate (based on the
anatofuz
parents:
diff changeset
482 progression of code review, etc.). When doing so, it is important to retain
anatofuz
parents:
diff changeset
483 correct attribution of contributions to their contributors. However, we do not
anatofuz
parents:
diff changeset
484 want the source code to be littered with random attributions "this code written
anatofuz
parents:
diff changeset
485 by J. Random Hacker" (this is noisy and distracting). In practice, the revision
anatofuz
parents:
diff changeset
486 control system keeps a perfect history of who changed what, and the CREDITS.txt
anatofuz
parents:
diff changeset
487 file describes higher-level contributions. If you commit a patch for someone
anatofuz
parents:
diff changeset
488 else, please follow the attribution of changes in the simple manner as outlined
anatofuz
parents:
diff changeset
489 by the `commit messages`_ section. Overall, please do not add contributor names
anatofuz
parents:
diff changeset
490 to the source code.
anatofuz
parents:
diff changeset
491
anatofuz
parents:
diff changeset
492 Also, don't commit patches authored by others unless they have submitted the
anatofuz
parents:
diff changeset
493 patch to the project or you have been authorized to submit them on their behalf
anatofuz
parents:
diff changeset
494 (you work together and your company authorized you to contribute the patches,
anatofuz
parents:
diff changeset
495 etc.). The author should first submit them to the relevant project's commit
anatofuz
parents:
diff changeset
496 list, development list, or LLVM bug tracker component. If someone sends you
anatofuz
parents:
diff changeset
497 a patch privately, encourage them to submit it to the appropriate list first.
anatofuz
parents:
diff changeset
498
anatofuz
parents:
diff changeset
499 Our previous version control system (subversion) did not distinguish between the
anatofuz
parents:
diff changeset
500 author and the committer like git does. As such, older commits used a different
anatofuz
parents:
diff changeset
501 attribution mechanism. The previous method was to include "Patch by John Doe."
anatofuz
parents:
diff changeset
502 in a separate line of the commit message and there are automated processes that
anatofuz
parents:
diff changeset
503 rely on this format.
anatofuz
parents:
diff changeset
504
anatofuz
parents:
diff changeset
505 .. _IR backwards compatibility:
anatofuz
parents:
diff changeset
506
anatofuz
parents:
diff changeset
507 IR Backwards Compatibility
anatofuz
parents:
diff changeset
508 --------------------------
anatofuz
parents:
diff changeset
509
anatofuz
parents:
diff changeset
510 When the IR format has to be changed, keep in mind that we try to maintain some
anatofuz
parents:
diff changeset
511 backwards compatibility. The rules are intended as a balance between convenience
anatofuz
parents:
diff changeset
512 for llvm users and not imposing a big burden on llvm developers:
anatofuz
parents:
diff changeset
513
anatofuz
parents:
diff changeset
514 * The textual format is not backwards compatible. We don't change it too often,
anatofuz
parents:
diff changeset
515 but there are no specific promises.
anatofuz
parents:
diff changeset
516
anatofuz
parents:
diff changeset
517 * Additions and changes to the IR should be reflected in
anatofuz
parents:
diff changeset
518 ``test/Bitcode/compatibility.ll``.
anatofuz
parents:
diff changeset
519
anatofuz
parents:
diff changeset
520 * The current LLVM version supports loading any bitcode since version 3.0.
anatofuz
parents:
diff changeset
521
anatofuz
parents:
diff changeset
522 * After each X.Y release, ``compatibility.ll`` must be copied to
anatofuz
parents:
diff changeset
523 ``compatibility-X.Y.ll``. The corresponding bitcode file should be assembled
anatofuz
parents:
diff changeset
524 using the X.Y build and committed as ``compatibility-X.Y.ll.bc``.
anatofuz
parents:
diff changeset
525
anatofuz
parents:
diff changeset
526 * Newer releases can ignore features from older releases, but they cannot
anatofuz
parents:
diff changeset
527 miscompile them. For example, if nsw is ever replaced with something else,
anatofuz
parents:
diff changeset
528 dropping it would be a valid way to upgrade the IR.
anatofuz
parents:
diff changeset
529
anatofuz
parents:
diff changeset
530 * Debug metadata is special in that it is currently dropped during upgrades.
anatofuz
parents:
diff changeset
531
anatofuz
parents:
diff changeset
532 * Non-debug metadata is defined to be safe to drop, so a valid way to upgrade
anatofuz
parents:
diff changeset
533 it is to drop it. That is not very user friendly and a bit more effort is
anatofuz
parents:
diff changeset
534 expected, but no promises are made.
anatofuz
parents:
diff changeset
535
anatofuz
parents:
diff changeset
536 C API Changes
anatofuz
parents:
diff changeset
537 ----------------
anatofuz
parents:
diff changeset
538
anatofuz
parents:
diff changeset
539 * Stability Guarantees: The C API is, in general, a "best effort" for stability.
anatofuz
parents:
diff changeset
540 This means that we make every attempt to keep the C API stable, but that
anatofuz
parents:
diff changeset
541 stability will be limited by the abstractness of the interface and the
anatofuz
parents:
diff changeset
542 stability of the C++ API that it wraps. In practice, this means that things
anatofuz
parents:
diff changeset
543 like "create debug info" or "create this type of instruction" are likely to be
anatofuz
parents:
diff changeset
544 less stable than "take this IR file and JIT it for my current machine".
anatofuz
parents:
diff changeset
545
anatofuz
parents:
diff changeset
546 * Release stability: We won't break the C API on the release branch with patches
anatofuz
parents:
diff changeset
547 that go on that branch, with the exception that we will fix an unintentional
anatofuz
parents:
diff changeset
548 C API break that will keep the release consistent with both the previous and
anatofuz
parents:
diff changeset
549 next release.
anatofuz
parents:
diff changeset
550
anatofuz
parents:
diff changeset
551 * Testing: Patches to the C API are expected to come with tests just like any
anatofuz
parents:
diff changeset
552 other patch.
anatofuz
parents:
diff changeset
553
anatofuz
parents:
diff changeset
554 * Including new things into the API: If an LLVM subcomponent has a C API already
anatofuz
parents:
diff changeset
555 included, then expanding that C API is acceptable. Adding C API for
anatofuz
parents:
diff changeset
556 subcomponents that don't currently have one needs to be discussed on the
anatofuz
parents:
diff changeset
557 mailing list for design and maintainability feedback prior to implementation.
anatofuz
parents:
diff changeset
558
anatofuz
parents:
diff changeset
559 * Documentation: Any changes to the C API are required to be documented in the
anatofuz
parents:
diff changeset
560 release notes so that it's clear to external users who do not follow the
anatofuz
parents:
diff changeset
561 project how the C API is changing and evolving.
anatofuz
parents:
diff changeset
562
anatofuz
parents:
diff changeset
563 New Targets
anatofuz
parents:
diff changeset
564 -----------
anatofuz
parents:
diff changeset
565
anatofuz
parents:
diff changeset
566 LLVM is very receptive to new targets, even experimental ones, but a number of
anatofuz
parents:
diff changeset
567 problems can appear when adding new large portions of code, and back-ends are
anatofuz
parents:
diff changeset
568 normally added in bulk. We have found that landing large pieces of new code
anatofuz
parents:
diff changeset
569 and then trying to fix emergent problems in-tree is problematic for a variety
anatofuz
parents:
diff changeset
570 of reasons.
anatofuz
parents:
diff changeset
571
anatofuz
parents:
diff changeset
572 For these reasons, new targets are *always* added as *experimental* until
anatofuz
parents:
diff changeset
573 they can be proven stable, and later moved to non-experimental. The difference
anatofuz
parents:
diff changeset
574 between both classes is that experimental targets are not built by default
anatofuz
parents:
diff changeset
575 (need to be added to -DLLVM_TARGETS_TO_BUILD at CMake time).
anatofuz
parents:
diff changeset
576
anatofuz
parents:
diff changeset
577 The basic rules for a back-end to be upstreamed in **experimental** mode are:
anatofuz
parents:
diff changeset
578
anatofuz
parents:
diff changeset
579 * Every target must have a :ref:`code owner<code owners>`. The `CODE_OWNERS.TXT`
anatofuz
parents:
diff changeset
580 file has to be updated as part of the first merge. The code owner makes sure
anatofuz
parents:
diff changeset
581 that changes to the target get reviewed and steers the overall effort.
anatofuz
parents:
diff changeset
582
anatofuz
parents:
diff changeset
583 * There must be an active community behind the target. This community
anatofuz
parents:
diff changeset
584 will help maintain the target by providing buildbots, fixing
anatofuz
parents:
diff changeset
585 bugs, answering the LLVM community's questions and making sure the new
anatofuz
parents:
diff changeset
586 target doesn't break any of the other targets, or generic code. This
anatofuz
parents:
diff changeset
587 behavior is expected to continue throughout the lifetime of the
anatofuz
parents:
diff changeset
588 target's code.
anatofuz
parents:
diff changeset
589
anatofuz
parents:
diff changeset
590 * The code must be free of contentious issues, for example, large
anatofuz
parents:
diff changeset
591 changes in how the IR behaves or should be formed by the front-ends,
anatofuz
parents:
diff changeset
592 unless agreed by the majority of the community via refactoring of the
anatofuz
parents:
diff changeset
593 (:doc:`IR standard<LangRef>`) **before** the merge of the new target changes,
anatofuz
parents:
diff changeset
594 following the :ref:`IR backwards compatibility`.
anatofuz
parents:
diff changeset
595
anatofuz
parents:
diff changeset
596 * The code conforms to all of the policies laid out in this developer policy
anatofuz
parents:
diff changeset
597 document, including license, patent, and coding standards.
anatofuz
parents:
diff changeset
598
anatofuz
parents:
diff changeset
599 * The target should have either reasonable documentation on how it
anatofuz
parents:
diff changeset
600 works (ISA, ABI, etc.) or a publicly available simulator/hardware
anatofuz
parents:
diff changeset
601 (either free or cheap enough) - preferably both. This allows
anatofuz
parents:
diff changeset
602 developers to validate assumptions, understand constraints and review code
anatofuz
parents:
diff changeset
603 that can affect the target.
anatofuz
parents:
diff changeset
604
anatofuz
parents:
diff changeset
605 In addition, the rules for a back-end to be promoted to **official** are:
anatofuz
parents:
diff changeset
606
anatofuz
parents:
diff changeset
607 * The target must have addressed every other minimum requirement and
anatofuz
parents:
diff changeset
608 have been stable in tree for at least 3 months. This cool down
anatofuz
parents:
diff changeset
609 period is to make sure that the back-end and the target community can
anatofuz
parents:
diff changeset
610 endure continuous upstream development for the foreseeable future.
anatofuz
parents:
diff changeset
611
anatofuz
parents:
diff changeset
612 * The target's code must have been completely adapted to this policy
anatofuz
parents:
diff changeset
613 as well as the :doc:`coding standards<CodingStandards>`. Any exceptions that
anatofuz
parents:
diff changeset
614 were made to move into experimental mode must have been fixed **before**
anatofuz
parents:
diff changeset
615 becoming official.
anatofuz
parents:
diff changeset
616
anatofuz
parents:
diff changeset
617 * The test coverage needs to be broad and well written (small tests,
anatofuz
parents:
diff changeset
618 well documented). The build target ``check-all`` must pass with the
anatofuz
parents:
diff changeset
619 new target built, and where applicable, the ``test-suite`` must also
anatofuz
parents:
diff changeset
620 pass without errors, in at least one configuration (publicly
anatofuz
parents:
diff changeset
621 demonstrated, for example, via buildbots).
anatofuz
parents:
diff changeset
622
anatofuz
parents:
diff changeset
623 * Public buildbots need to be created and actively maintained, unless
anatofuz
parents:
diff changeset
624 the target requires no additional buildbots (ex. ``check-all`` covers
anatofuz
parents:
diff changeset
625 all tests). The more relevant and public the new target's CI infrastructure
anatofuz
parents:
diff changeset
626 is, the more the LLVM community will embrace it.
anatofuz
parents:
diff changeset
627
anatofuz
parents:
diff changeset
628 To **continue** as a supported and official target:
anatofuz
parents:
diff changeset
629
anatofuz
parents:
diff changeset
630 * The maintainer(s) must continue following these rules throughout the lifetime
anatofuz
parents:
diff changeset
631 of the target. Continuous violations of aforementioned rules and policies
anatofuz
parents:
diff changeset
632 could lead to complete removal of the target from the code base.
anatofuz
parents:
diff changeset
633
anatofuz
parents:
diff changeset
634 * Degradation in support, documentation or test coverage will make the target as
anatofuz
parents:
diff changeset
635 nuisance to other targets and be considered a candidate for deprecation and
anatofuz
parents:
diff changeset
636 ultimately removed.
anatofuz
parents:
diff changeset
637
anatofuz
parents:
diff changeset
638 In essences, these rules are necessary for targets to gain and retain their
anatofuz
parents:
diff changeset
639 status, but also markers to define bit-rot, and will be used to clean up the
anatofuz
parents:
diff changeset
640 tree from unmaintained targets.
anatofuz
parents:
diff changeset
641
anatofuz
parents:
diff changeset
642 .. _toolchain:
anatofuz
parents:
diff changeset
643
anatofuz
parents:
diff changeset
644 Updating Toolchain Requirements
anatofuz
parents:
diff changeset
645 -------------------------------
anatofuz
parents:
diff changeset
646
anatofuz
parents:
diff changeset
647 We intend to require newer toolchains as time goes by. This means LLVM's
anatofuz
parents:
diff changeset
648 codebase can use newer versions of C++ as they get standardized. Requiring newer
anatofuz
parents:
diff changeset
649 toolchains to build LLVM can be painful for those building LLVM; therefore, it
anatofuz
parents:
diff changeset
650 will only be done through the following process:
anatofuz
parents:
diff changeset
651
anatofuz
parents:
diff changeset
652 * Generally, try to support LLVM and GCC versions from the last 3 years at a
anatofuz
parents:
diff changeset
653 minimum. This time-based guideline is not strict: we may support much older
anatofuz
parents:
diff changeset
654 compilers, or decide to support fewer versions.
anatofuz
parents:
diff changeset
655
anatofuz
parents:
diff changeset
656 * An RFC is sent to the `llvm-dev mailing list <http://lists.llvm.org/mailman/listinfo/llvm-dev>`_
anatofuz
parents:
diff changeset
657
anatofuz
parents:
diff changeset
658 - Detail upsides of the version increase (e.g. which newer C++ language or
anatofuz
parents:
diff changeset
659 library features LLVM should use; avoid miscompiles in particular compiler
anatofuz
parents:
diff changeset
660 versions, etc).
anatofuz
parents:
diff changeset
661 - Detail downsides on important platforms (e.g. Ubuntu LTS status).
anatofuz
parents:
diff changeset
662
anatofuz
parents:
diff changeset
663 * Once the RFC reaches consensus, update the CMake toolchain version checks as
anatofuz
parents:
diff changeset
664 well as the :doc:`getting started<GettingStarted>` guide. We want to
anatofuz
parents:
diff changeset
665 soft-error when developers compile LLVM. We say "soft-error" because the
anatofuz
parents:
diff changeset
666 error can be turned into a warning using a CMake flag. This is an important
anatofuz
parents:
diff changeset
667 step: LLVM still doesn't have code which requires the new toolchains, but it
anatofuz
parents:
diff changeset
668 soon will. If you compile LLVM but don't read the mailing list, we should
anatofuz
parents:
diff changeset
669 tell you!
anatofuz
parents:
diff changeset
670
anatofuz
parents:
diff changeset
671 * Ensure that at least one LLVM release has had this soft-error. Not all
anatofuz
parents:
diff changeset
672 developers compile LLVM top-of-tree. These release-bound developers should
anatofuz
parents:
diff changeset
673 also be told about upcoming changes.
anatofuz
parents:
diff changeset
674
anatofuz
parents:
diff changeset
675 * Turn the soft-error into a hard-error after said LLVM release has branched.
anatofuz
parents:
diff changeset
676
anatofuz
parents:
diff changeset
677 * Update the :doc:`coding standards<CodingStandards>` to allow the new
anatofuz
parents:
diff changeset
678 features we've explicitly approved in the RFC.
anatofuz
parents:
diff changeset
679
anatofuz
parents:
diff changeset
680 * Start using the new features in LLVM's codebase.
anatofuz
parents:
diff changeset
681
anatofuz
parents:
diff changeset
682 Here's a `sample RFC
anatofuz
parents:
diff changeset
683 <http://lists.llvm.org/pipermail/llvm-dev/2019-January/129452.html>`_ and the
anatofuz
parents:
diff changeset
684 `corresponding change <https://reviews.llvm.org/D57264>`_.
anatofuz
parents:
diff changeset
685
anatofuz
parents:
diff changeset
686 .. _copyright-license-patents:
anatofuz
parents:
diff changeset
687
anatofuz
parents:
diff changeset
688 Copyright, License, and Patents
anatofuz
parents:
diff changeset
689 ===============================
anatofuz
parents:
diff changeset
690
anatofuz
parents:
diff changeset
691 .. note::
anatofuz
parents:
diff changeset
692
anatofuz
parents:
diff changeset
693 This section deals with legal matters but does not provide legal advice. We
anatofuz
parents:
diff changeset
694 are not lawyers --- please seek legal counsel from a licensed attorney.
anatofuz
parents:
diff changeset
695
anatofuz
parents:
diff changeset
696 This section addresses the issues of copyright, license and patents for the LLVM
anatofuz
parents:
diff changeset
697 project. The copyright for the code is held by the contributors of
anatofuz
parents:
diff changeset
698 the code. The code is licensed under permissive `open source licensing terms`_,
anatofuz
parents:
diff changeset
699 namely the Apache 2 license, which includes a copyright and `patent license`_.
anatofuz
parents:
diff changeset
700 When you contribute code to the LLVM project, you license it under these terms.
anatofuz
parents:
diff changeset
701
anatofuz
parents:
diff changeset
702 If you have questions or comments about these topics, please contact the
anatofuz
parents:
diff changeset
703 `LLVM Developer's Mailing List <mailto:llvm-dev@lists.llvm.org>`_. However,
anatofuz
parents:
diff changeset
704 please realize that most compiler developers are not lawyers, and therefore you
anatofuz
parents:
diff changeset
705 will not be getting official legal advice.
anatofuz
parents:
diff changeset
706
anatofuz
parents:
diff changeset
707 Copyright
anatofuz
parents:
diff changeset
708 ---------
anatofuz
parents:
diff changeset
709
anatofuz
parents:
diff changeset
710 The LLVM project does not collect copyright assignments, which means that the
anatofuz
parents:
diff changeset
711 copyright for the code in the project is held by the respective contributors.
anatofuz
parents:
diff changeset
712 Because you (or your company)
anatofuz
parents:
diff changeset
713 retain ownership of the code you contribute, you know it may only be used under
anatofuz
parents:
diff changeset
714 the terms of the open source license you contributed it under: the license for
anatofuz
parents:
diff changeset
715 your contributions cannot be changed in the future without your approval.
anatofuz
parents:
diff changeset
716
anatofuz
parents:
diff changeset
717 Because the LLVM project does not require copyright assignments, changing the
anatofuz
parents:
diff changeset
718 LLVM license requires tracking down the
anatofuz
parents:
diff changeset
719 contributors to LLVM and getting them to agree that a license change is
anatofuz
parents:
diff changeset
720 acceptable for their contributions. We feel that a high burden for relicensing
anatofuz
parents:
diff changeset
721 is good for the project, because contributors do not have to fear that their
anatofuz
parents:
diff changeset
722 code will be used in a way with which they disagree.
anatofuz
parents:
diff changeset
723
anatofuz
parents:
diff changeset
724 Relicensing
anatofuz
parents:
diff changeset
725 -----------
anatofuz
parents:
diff changeset
726
anatofuz
parents:
diff changeset
727 The last paragraph notwithstanding, the LLVM Project is in the middle of a large
anatofuz
parents:
diff changeset
728 effort to change licenses, which aims to solve several problems:
anatofuz
parents:
diff changeset
729
anatofuz
parents:
diff changeset
730 * The old licenses made it difficult to move code from (e.g.) the compiler to
anatofuz
parents:
diff changeset
731 runtime libraries, because runtime libraries used a different license from the
anatofuz
parents:
diff changeset
732 rest of the compiler.
anatofuz
parents:
diff changeset
733 * Some contributions were not submitted to LLVM due to concerns that
anatofuz
parents:
diff changeset
734 the patent grant required by the project was overly broad.
anatofuz
parents:
diff changeset
735 * The patent grant was unique to the LLVM Project, not written by a lawyer, and
anatofuz
parents:
diff changeset
736 was difficult to determine what protection was provided (if any).
anatofuz
parents:
diff changeset
737
anatofuz
parents:
diff changeset
738 The scope of relicensing is all code that is considered part of the LLVM
anatofuz
parents:
diff changeset
739 project, including the main LLVM repository, runtime libraries (compiler_rt,
anatofuz
parents:
diff changeset
740 OpenMP, etc), Polly, and all other subprojects. There are a few exceptions:
anatofuz
parents:
diff changeset
741
anatofuz
parents:
diff changeset
742 * Code imported from other projects (e.g. Google Test, Autoconf, etc) will
anatofuz
parents:
diff changeset
743 remain as it is. This code isn't developed as part of the LLVM project, it
anatofuz
parents:
diff changeset
744 is used by LLVM.
anatofuz
parents:
diff changeset
745 * Some subprojects are impractical or uninteresting to relicense (e.g. llvm-gcc
anatofuz
parents:
diff changeset
746 and dragonegg). These will be split off from the LLVM project (e.g. to
anatofuz
parents:
diff changeset
747 separate GitHub projects), allowing interested people to continue their
anatofuz
parents:
diff changeset
748 development elsewhere.
anatofuz
parents:
diff changeset
749
anatofuz
parents:
diff changeset
750 To relicense LLVM, we will be seeking approval from all of the copyright holders
anatofuz
parents:
diff changeset
751 of code in the repository, or potentially remove/rewrite code if we cannot.
anatofuz
parents:
diff changeset
752 This is a large
anatofuz
parents:
diff changeset
753 and challenging project which will take a significant amount of time to
anatofuz
parents:
diff changeset
754 complete. In the interim, **all contributions to the project will be made under
anatofuz
parents:
diff changeset
755 the terms of both the new license and the legacy license scheme** (each of which
anatofuz
parents:
diff changeset
756 is described below). The exception to this is the legacy patent grant, which
anatofuz
parents:
diff changeset
757 will not be required for new contributions.
anatofuz
parents:
diff changeset
758
anatofuz
parents:
diff changeset
759 When all of the code in the project has been converted to the new license or
anatofuz
parents:
diff changeset
760 removed, we will drop the requirement to contribute under the legacy license.
anatofuz
parents:
diff changeset
761 This will achieve the goal of having
anatofuz
parents:
diff changeset
762 a single standardized license for the entire codebase.
anatofuz
parents:
diff changeset
763
anatofuz
parents:
diff changeset
764 If you are a prior contributor to LLVM and have not done so already, please do
anatofuz
parents:
diff changeset
765 *TODO* to allow us to use your code. *Add a link to a separate page here, which
anatofuz
parents:
diff changeset
766 is probably a click through web form or something like that. Details to be
anatofuz
parents:
diff changeset
767 determined later*.
anatofuz
parents:
diff changeset
768
anatofuz
parents:
diff changeset
769
anatofuz
parents:
diff changeset
770 .. _open source licensing terms:
anatofuz
parents:
diff changeset
771
anatofuz
parents:
diff changeset
772 New LLVM Project License Framework
anatofuz
parents:
diff changeset
773 ----------------------------------
anatofuz
parents:
diff changeset
774
anatofuz
parents:
diff changeset
775 Contributions to LLVM are licensed under the `Apache License, Version 2.0
anatofuz
parents:
diff changeset
776 <https://www.apache.org/licenses/LICENSE-2.0>`_, with two limited
anatofuz
parents:
diff changeset
777 exceptions intended to ensure that LLVM is very permissively licensed.
anatofuz
parents:
diff changeset
778 Collectively, the name of this license is "Apache 2.0 License with LLVM
anatofuz
parents:
diff changeset
779 exceptions". The exceptions read:
anatofuz
parents:
diff changeset
780
anatofuz
parents:
diff changeset
781 ::
anatofuz
parents:
diff changeset
782
anatofuz
parents:
diff changeset
783 ---- LLVM Exceptions to the Apache 2.0 License ----
anatofuz
parents:
diff changeset
784
anatofuz
parents:
diff changeset
785 As an exception, if, as a result of your compiling your source code, portions
anatofuz
parents:
diff changeset
786 of this Software are embedded into an Object form of such source code, you
anatofuz
parents:
diff changeset
787 may redistribute such embedded portions in such Object form without complying
anatofuz
parents:
diff changeset
788 with the conditions of Sections 4(a), 4(b) and 4(d) of the License.
anatofuz
parents:
diff changeset
789
anatofuz
parents:
diff changeset
790 In addition, if you combine or link compiled forms of this Software with
anatofuz
parents:
diff changeset
791 software that is licensed under the GPLv2 ("Combined Software") and if a
anatofuz
parents:
diff changeset
792 court of competent jurisdiction determines that the patent provision (Section
anatofuz
parents:
diff changeset
793 3), the indemnity provision (Section 9) or other Section of the License
anatofuz
parents:
diff changeset
794 conflicts with the conditions of the GPLv2, you may retroactively and
anatofuz
parents:
diff changeset
795 prospectively choose to deem waived or otherwise exclude such Section(s) of
anatofuz
parents:
diff changeset
796 the License, but only in their entirety and only with respect to the Combined
anatofuz
parents:
diff changeset
797 Software.
anatofuz
parents:
diff changeset
798
anatofuz
parents:
diff changeset
799
anatofuz
parents:
diff changeset
800 We intend to keep LLVM perpetually open source and available under a permissive
anatofuz
parents:
diff changeset
801 license - this fosters the widest adoption of LLVM by
anatofuz
parents:
diff changeset
802 **allowing commercial products to be derived from LLVM** with few restrictions
anatofuz
parents:
diff changeset
803 and without a requirement for making any derived works also open source. In
anatofuz
parents:
diff changeset
804 particular, LLVM's license is not a "copyleft" license like the GPL.
anatofuz
parents:
diff changeset
805
anatofuz
parents:
diff changeset
806 The "Apache 2.0 License with LLVM exceptions" allows you to:
anatofuz
parents:
diff changeset
807
anatofuz
parents:
diff changeset
808 * freely download and use LLVM (in whole or in part) for personal, internal, or
anatofuz
parents:
diff changeset
809 commercial purposes.
anatofuz
parents:
diff changeset
810 * include LLVM in packages or distributions you create.
anatofuz
parents:
diff changeset
811 * combine LLVM with code licensed under every other major open source
anatofuz
parents:
diff changeset
812 license (including BSD, MIT, GPLv2, GPLv3...).
anatofuz
parents:
diff changeset
813 * make changes to LLVM code without being required to contribute it back
anatofuz
parents:
diff changeset
814 to the project - contributions are appreciated though!
anatofuz
parents:
diff changeset
815
anatofuz
parents:
diff changeset
816 However, it imposes these limitations on you:
anatofuz
parents:
diff changeset
817
anatofuz
parents:
diff changeset
818 * You must retain the copyright notice if you redistribute LLVM: You cannot
anatofuz
parents:
diff changeset
819 strip the copyright headers off or replace them with your own.
anatofuz
parents:
diff changeset
820 * Binaries that include LLVM must reproduce the copyright notice (e.g. in an
anatofuz
parents:
diff changeset
821 included README file or in an "About" box), unless the LLVM code was added as
anatofuz
parents:
diff changeset
822 a by-product of compilation. For example, if an LLVM runtime library like
anatofuz
parents:
diff changeset
823 compiler_rt or libc++ was automatically included into your application by the
anatofuz
parents:
diff changeset
824 compiler, you do not need to attribute it.
anatofuz
parents:
diff changeset
825 * You can't use our names to promote your products (LLVM derived or not) -
anatofuz
parents:
diff changeset
826 though you can make truthful statements about your use of the LLVM code,
anatofuz
parents:
diff changeset
827 without implying our sponsorship.
anatofuz
parents:
diff changeset
828 * There's no warranty on LLVM at all.
anatofuz
parents:
diff changeset
829
anatofuz
parents:
diff changeset
830 We want LLVM code to be widely used, and believe that this provides a model that
anatofuz
parents:
diff changeset
831 is great for contributors and users of the project. For more information about
anatofuz
parents:
diff changeset
832 the Apache 2.0 License, please see the `Apache License FAQ
anatofuz
parents:
diff changeset
833 <http://www.apache.org/foundation/license-faq.html>`_, maintained by the
anatofuz
parents:
diff changeset
834 Apache Project.
anatofuz
parents:
diff changeset
835
anatofuz
parents:
diff changeset
836
anatofuz
parents:
diff changeset
837 .. note::
anatofuz
parents:
diff changeset
838
anatofuz
parents:
diff changeset
839 The LLVM Project includes some really old subprojects (dragonegg,
anatofuz
parents:
diff changeset
840 llvm-gcc-4.0, and llvm-gcc-4.2), which are licensed under **GPL
anatofuz
parents:
diff changeset
841 licenses**. This code is not actively maintained - it does not even
anatofuz
parents:
diff changeset
842 build successfully. This code is cleanly separated into distinct SVN
anatofuz
parents:
diff changeset
843 repositories from the rest of LLVM, and the LICENSE.txt files specifically
anatofuz
parents:
diff changeset
844 indicate that they contain GPL code. When LLVM transitions from SVN to Git,
anatofuz
parents:
diff changeset
845 we plan to drop these code bases from the new repository structure.
anatofuz
parents:
diff changeset
846
anatofuz
parents:
diff changeset
847
anatofuz
parents:
diff changeset
848 .. _patent license:
anatofuz
parents:
diff changeset
849
anatofuz
parents:
diff changeset
850 Patents
anatofuz
parents:
diff changeset
851 -------
anatofuz
parents:
diff changeset
852
anatofuz
parents:
diff changeset
853 Section 3 of the Apache 2.0 license is a patent grant under which
anatofuz
parents:
diff changeset
854 contributors of code to the project contribute the rights to use any of
anatofuz
parents:
diff changeset
855 their patents that would otherwise be infringed by that code contribution
anatofuz
parents:
diff changeset
856 (protecting uses of that code). Further, the patent grant is revoked
anatofuz
parents:
diff changeset
857 from anyone who files a patent lawsuit about code in LLVM - this protects the
anatofuz
parents:
diff changeset
858 community by providing a "patent commons" for the code base and reducing the
anatofuz
parents:
diff changeset
859 odds of patent lawsuits in general.
anatofuz
parents:
diff changeset
860
anatofuz
parents:
diff changeset
861 The license specifically scopes which patents are included with code
anatofuz
parents:
diff changeset
862 contributions. To help explain this, the `Apache License FAQ
anatofuz
parents:
diff changeset
863 <http://www.apache.org/foundation/license-faq.html>`_ explains this scope using
anatofuz
parents:
diff changeset
864 some questions and answers, which we reproduce here for your convenience (for
anatofuz
parents:
diff changeset
865 reference, the "ASF" is the Apache Software Foundation, the guidance still
anatofuz
parents:
diff changeset
866 holds though)::
anatofuz
parents:
diff changeset
867
anatofuz
parents:
diff changeset
868 Q1: If I own a patent and contribute to a Work, and, at the time my
anatofuz
parents:
diff changeset
869 contribution is included in that Work, none of my patent's claims are subject
anatofuz
parents:
diff changeset
870 to Apache's Grant of Patent License, is there a way any of those claims would
anatofuz
parents:
diff changeset
871 later become subject to the Grant of Patent License solely due to subsequent
anatofuz
parents:
diff changeset
872 contributions by other parties who are not licensees of that patent.
anatofuz
parents:
diff changeset
873
anatofuz
parents:
diff changeset
874 A1: No.
anatofuz
parents:
diff changeset
875
anatofuz
parents:
diff changeset
876 Q2: If at any time after my contribution, I am able to license other patent
anatofuz
parents:
diff changeset
877 claims that would have been subject to Apache's Grant of Patent License if
anatofuz
parents:
diff changeset
878 they were licensable by me at the time of my contribution, do those other
anatofuz
parents:
diff changeset
879 claims become subject to the Grant of Patent License?
anatofuz
parents:
diff changeset
880
anatofuz
parents:
diff changeset
881 A2: Yes.
anatofuz
parents:
diff changeset
882
anatofuz
parents:
diff changeset
883 Q3: If I own or control a licensable patent and contribute code to a specific
anatofuz
parents:
diff changeset
884 Apache product, which of my patent claims are subject to Apache's Grant of
anatofuz
parents:
diff changeset
885 Patent License?
anatofuz
parents:
diff changeset
886
anatofuz
parents:
diff changeset
887 A3: The only patent claims that are licensed to the ASF are those you own or
anatofuz
parents:
diff changeset
888 have the right to license that read on your contribution or on the
anatofuz
parents:
diff changeset
889 combination of your contribution with the specific Apache product to which
anatofuz
parents:
diff changeset
890 you contributed as it existed at the time of your contribution. No additional
anatofuz
parents:
diff changeset
891 patent claims become licensed as a result of subsequent combinations of your
anatofuz
parents:
diff changeset
892 contribution with any other software. Note, however, that licensable patent
anatofuz
parents:
diff changeset
893 claims include those that you acquire in the future, as long as they read on
anatofuz
parents:
diff changeset
894 your original contribution as made at the original time. Once a patent claim
anatofuz
parents:
diff changeset
895 is subject to Apache's Grant of Patent License, it is licensed under the
anatofuz
parents:
diff changeset
896 terms of that Grant to the ASF and to recipients of any software distributed
anatofuz
parents:
diff changeset
897 by the ASF for any Apache software product whatsoever.
anatofuz
parents:
diff changeset
898
anatofuz
parents:
diff changeset
899 .. _legacy:
anatofuz
parents:
diff changeset
900
anatofuz
parents:
diff changeset
901 Legacy License Structure
anatofuz
parents:
diff changeset
902 ------------------------
anatofuz
parents:
diff changeset
903
anatofuz
parents:
diff changeset
904 .. note::
anatofuz
parents:
diff changeset
905 The code base was previously licensed under the Terms described here.
anatofuz
parents:
diff changeset
906 We are in the middle of relicensing to a new approach (described above), but
anatofuz
parents:
diff changeset
907 until this effort is complete, the code is also still available under these
anatofuz
parents:
diff changeset
908 terms. Once we finish the relicensing project, new versions of the code will
anatofuz
parents:
diff changeset
909 not be available under these terms. However, nothing takes away your right
anatofuz
parents:
diff changeset
910 to use old versions under the licensing terms under which they were
anatofuz
parents:
diff changeset
911 originally released.
anatofuz
parents:
diff changeset
912
anatofuz
parents:
diff changeset
913 We intend to keep LLVM perpetually open source and to use a permissive open
anatofuz
parents:
diff changeset
914 source license. The code in
anatofuz
parents:
diff changeset
915 LLVM is available under the `University of Illinois/NCSA Open Source License
anatofuz
parents:
diff changeset
916 <http://www.opensource.org/licenses/UoI-NCSA.php>`_, which boils down to
anatofuz
parents:
diff changeset
917 this:
anatofuz
parents:
diff changeset
918
anatofuz
parents:
diff changeset
919 * You can freely distribute LLVM.
anatofuz
parents:
diff changeset
920 * You must retain the copyright notice if you redistribute LLVM.
anatofuz
parents:
diff changeset
921 * Binaries derived from LLVM must reproduce the copyright notice (e.g. in an
anatofuz
parents:
diff changeset
922 included README file).
anatofuz
parents:
diff changeset
923 * You can't use our names to promote your LLVM derived products.
anatofuz
parents:
diff changeset
924 * There's no warranty on LLVM at all.
anatofuz
parents:
diff changeset
925
anatofuz
parents:
diff changeset
926 We believe this fosters the widest adoption of LLVM because it **allows
anatofuz
parents:
diff changeset
927 commercial products to be derived from LLVM** with few restrictions and without
anatofuz
parents:
diff changeset
928 a requirement for making any derived works also open source (i.e. LLVM's
anatofuz
parents:
diff changeset
929 license is not a "copyleft" license like the GPL). We suggest that you read the
anatofuz
parents:
diff changeset
930 `License <http://www.opensource.org/licenses/UoI-NCSA.php>`_ if further
anatofuz
parents:
diff changeset
931 clarification is needed.
anatofuz
parents:
diff changeset
932
anatofuz
parents:
diff changeset
933 In addition to the UIUC license, the runtime library components of LLVM
anatofuz
parents:
diff changeset
934 (**compiler_rt, libc++, and libclc**) are also licensed under the `MIT License
anatofuz
parents:
diff changeset
935 <http://www.opensource.org/licenses/mit-license.php>`_, which does not contain
anatofuz
parents:
diff changeset
936 the binary redistribution clause. As a user of these runtime libraries, it
anatofuz
parents:
diff changeset
937 means that you can choose to use the code under either license (and thus don't
anatofuz
parents:
diff changeset
938 need the binary redistribution clause), and as a contributor to the code that
anatofuz
parents:
diff changeset
939 you agree that any contributions to these libraries be licensed under both
anatofuz
parents:
diff changeset
940 licenses. We feel that this is important for runtime libraries, because they
anatofuz
parents:
diff changeset
941 are implicitly linked into applications and therefore should not subject those
anatofuz
parents:
diff changeset
942 applications to the binary redistribution clause. This also means that it is ok
anatofuz
parents:
diff changeset
943 to move code from (e.g.) libc++ to the LLVM core without concern, but that code
anatofuz
parents:
diff changeset
944 cannot be moved from the LLVM core to libc++ without the copyright owner's
anatofuz
parents:
diff changeset
945 permission.