11 This document contains the LLVM Developer Policy which defines the project's
12 policy towards developers and their contributions. The intent of this policy is
13 to eliminate miscommunication, rework, and confusion that might arise from the
14 distributed nature of LLVM's development. By stating the policy in clear terms,
15 we hope each developer can know ahead of time what to expect when making LLVM
16 contributions. This policy covers all llvm.org subprojects, including Clang,
19 This policy is also designed to accomplish the following objectives:
21 #. Attract both users and developers to the LLVM project.
23 #. Make life as simple and easy for contributors as possible.
25 #. Keep the top of tree as stable as possible.
27 #. Establish awareness of the project's :ref:`copyright, license, and patent
28 policies <copyright-license-patents>` with contributors to the project.
30 This policy is aimed at frequent contributors to LLVM. People interested in
31 contributing one-off patches can do so in an informal way by sending them to the
32 `llvm-commits mailing list
33 <http://lists.llvm.org/mailman/listinfo/llvm-commits>`_ and engaging another
34 developer to see it through the process.
39 This section contains policies that pertain to frequent LLVM developers. We
40 always welcome `one-off patches`_ from people who do not routinely contribute to
41 LLVM, but we expect more from frequent contributors to keep the system as
42 efficient as possible for everyone. Frequent LLVM contributors are expected to
43 meet the following requirements in order for LLVM to maintain a high standard of
49 Developers should stay informed by reading the `LLVM Discourse forums`_ and subscribing
50 to the categories of interest for notifications.
52 Paying attention to changes being made by others is a good way to see what other people
53 are interested in and watching the flow of the project as a whole.
55 Contibutions to the project are made through :ref:`GitHub Pull Requests <github-reviews>`.
56 You can subscribe to notification for areas of the codebase by joining
57 one of the `pr-subscribers-* <https://github.com/orgs/llvm/teams?query=pr-subscribers>`_
58 GitHub teams. This `mapping <https://github.com/llvm/llvm-project/blob/main/.github/new-prs-labeler.yml>`_
59 indicates which team is associated with a particular paths in the repository.
61 You can also subscribe to the "commits" mailing list for a subproject you're interested in,
63 <http://lists.llvm.org/mailman/listinfo/llvm-commits>`_, `cfe-commits
64 <http://lists.llvm.org/mailman/listinfo/cfe-commits>`_, or `lldb-commits
65 <http://lists.llvm.org/mailman/listinfo/lldb-commits>`_.
67 Missing features and bugs are tracked through our `GitHub issue tracker <https://github.com/llvm/llvm-project/issues>`_
68 and assigned labels. We recommend that active developers monitor incoming issues.
69 You can subscribe for notification for specific components by joining
70 one of the `issue-subscribers-* <https://github.com/orgs/llvm/teams?query=issue-subscribers>`_
72 You may also subscribe to the `llvm-bugs
73 <http://lists.llvm.org/mailman/listinfo/llvm-bugs>`_ email list to keep track
74 of bugs and enhancements occurring in the entire project. We really appreciate people
75 who are proactive at catching incoming bugs in their components and dealing with them
78 Please be aware that all public LLVM mailing lists and discourse forums are public and archived, and
79 that notices of confidentiality or non-disclosure cannot be respected.
84 Making and Submitting a Patch
85 -----------------------------
87 When making a patch for review, the goal is to make it as easy for the reviewer
88 to read it as possible. As such, we recommend that you:
90 #. Make your patch against git main, not a branch, and not an old version
91 of LLVM. This makes it easy to apply the patch. For information on how to
92 clone from git, please see the :ref:`Getting Started Guide
95 #. Similarly, patches should be submitted soon after they are generated. Old
96 patches may not apply correctly if the underlying code changes between the
97 time the patch was created and the time it is applied.
99 #. Once you have created your patch, create a
100 :ref:`GitHub Pull Request <github-reviews>` for
101 it (or commit it directly if applicable).
103 When submitting patches, please do not add confidentiality or non-disclosure
104 notices to the patches themselves. These notices conflict with the LLVM
105 licensing terms and may result in your contribution being excluded.
112 LLVM has a code-review policy. Code review is one way to increase the quality of
113 software. Please see :doc:`CodeReview` for more information on LLVM's code-review
118 Making Potentially Breaking Changes
119 -----------------------------------
121 Please help notify users and vendors of potential disruptions when upgrading to
122 a newer version of a tool. For example, deprecating a feature that is expected
123 to be removed in the future, removing an already-deprecated feature, upgrading a
124 diagnostic from a warning to an error, switching important default behavior, or
125 any other potentially disruptive situation thought to be worth raising
126 awareness of. For such changes, the following should be done:
130 Phabricator is deprecated and will be switched to read-only mode in October
131 2023, for new code contributions use :ref:`GitHub Pull Requests <github-reviews>`.
132 This section contains old information that needs to be updated.
134 * When performing the code review for the change, please add any applicable
135 "vendors" group to the review for their awareness. The purpose of these
136 groups is to give vendors early notice that potentially disruptive changes
137 are being considered but have not yet been accepted. Vendors can give early
138 testing feedback on the changes to alert us to unacceptable breakages. The
139 current list of vendor groups is:
141 * `Clang vendors <https://reviews.llvm.org/project/members/113/>`_
142 * `libc++ vendors <https://reviews.llvm.org/project/members/109/>`_
144 People interested in joining the vendors group can do so by clicking the
145 "Join Project" link on the vendor's "Members" page in Phabricator.
147 * When committing the change to the repository, add appropriate information
148 about the potentially breaking changes to the ``Potentially Breaking Changes``
149 section of the project's release notes. The release note should have
150 information about what the change is, what is potentially disruptive about
151 it, as well as any code examples, links, and motivation that is appropriate
152 to share with users. This helps users to learn about potential issues with
153 upgrading to that release.
155 * After the change has been committed to the repository, the potentially
156 disruptive changes described in the release notes should be posted to the
157 `Announcements <https://discourse.llvm.org/c/announce/>`_ channel on
158 Discourse. The post should be tagged with the ``potentially-breaking`` label
159 and a label specific to the project (such as ``clang``, ``llvm``, etc). This
160 is another mechanism by which we can give pre-release notice to users about
161 potentially disruptive changes. It is a lower-traffic alternative to the
162 joining "vendors" group. To automatically be notified of new announcements
163 with the ``potentially-breaking`` label, go to your user preferences page in
164 Discourse, and add the label to one of the watch categories under
165 ``Notifications->Tags``.
172 The LLVM Project relies on two features of its process to maintain rapid
173 development in addition to the high quality of its source base: the combination
174 of code review plus post-commit review for trusted maintainers. Having both is
175 a great way for the project to take advantage of the fact that most people do
176 the right thing most of the time, and only commit patches without pre-commit
177 review when they are confident they are right.
179 The trick to this is that the project has to guarantee that all patches that are
180 committed are reviewed after they go in: you don't want everyone to assume
181 someone else will review it, allowing the patch to go unreviewed. To solve this
182 problem, we have a notion of an 'owner' for a piece of the code. The sole
183 responsibility of a code owner is to ensure that a commit to their area of the
184 code is appropriately reviewed, either by themself or by someone else. The list
185 of current code owners can be found in the file `CODE_OWNERS.TXT
186 <https://github.com/llvm/llvm-project/blob/main/llvm/CODE_OWNERS.TXT>`_ in the
187 root of the LLVM source tree.
189 Note that code ownership is completely different than reviewers: anyone can
190 review a piece of code, and we welcome code review from anyone who is
191 interested. Code owners are the "last line of defense" to guarantee that all
192 patches that are committed are actually reviewed.
194 Being a code owner is a somewhat unglamorous position, but it is incredibly
195 important for the ongoing success of the project. Because people get busy,
196 interests change, and unexpected things happen, code ownership is purely opt-in,
197 and anyone can choose to resign their "title" at any time. For now, we do not
198 have an official policy on how one gets elected to be a code owner.
200 .. _include a testcase:
205 Developers are required to create test cases for any bugs fixed and any new
206 features added. Some tips for getting your testcase approved:
208 * All feature and regression test cases are added to the ``llvm/test``
209 directory. The appropriate sub-directory should be selected (see the
210 :doc:`Testing Guide <TestingGuide>` for details).
212 * Test cases should be written in :doc:`LLVM assembly language <LangRef>`.
214 * Test cases, especially for regressions, should be reduced as much as possible,
215 by :doc:`bugpoint <Bugpoint>` or manually. It is unacceptable to place an
216 entire failing program into ``llvm/test`` as this creates a *time-to-test*
217 burden on all developers. Please keep them short.
219 * Avoid adding links to resources that are not available to the entire
220 community, such as links to private bug trackers, internal corporate
221 documentation, etc. Instead, add sufficient comments to the test to provide
222 the context behind such links.
224 Note that llvm/test and clang/test are designed for regression and small feature
225 tests only. More extensive test cases (e.g., entire applications, benchmarks,
226 etc) should be added to the ``llvm-test`` test suite. The llvm-test suite is
227 for coverage (correctness, performance, etc) testing, not feature or regression
233 Many projects in LLVM communicate important changes to users through release
234 notes, typically found in ``docs/ReleaseNotes.rst`` for the project. Changes to
235 a project that are user-facing, or that users may wish to know about, should be
236 added to the project's release notes at the author's or code reviewer's
237 discretion, preferably as part of the commit landing the changes. Examples of
238 changes that would typically warrant adding a release note (this list is not
241 * Adding, removing, or modifying command-line options.
242 * Adding, removing, or regrouping a diagnostic.
243 * Fixing a bug that potentially has significant user-facing impact (please link
244 to the issue fixed in the bug database).
245 * Adding or removing optimizations that have widespread impact or enables new
246 programming paradigms.
247 * Modifying a C stable API.
248 * Notifying users about a potentially disruptive change expected to be made in
249 a future release, such as removal of a deprecated feature. In this case, the
250 release note should be added to a ``Potentially Breaking Changes`` section of
251 the notes with sufficient information and examples to demonstrate the
252 potential disruption. Additionally, any new entries to this section should be
253 announced in the `Announcements <https://discourse.llvm.org/c/announce/>`_
254 channel on Discourse. See :ref:`breaking` for more details.
256 Code reviewers are encouraged to request a release note if they think one is
257 warranted when performing a code review.
262 The minimum quality standards that any change must satisfy before being
263 committed to the main development branch are:
265 #. Code must adhere to the `LLVM Coding Standards <CodingStandards.html>`_.
267 #. Code must compile cleanly (no errors, no warnings) on at least one platform.
269 #. Bug fixes and new features should `include a testcase`_ so we know if the
270 fix/feature ever regresses in the future.
272 #. Code must pass the ``llvm/test`` test suite.
274 #. The code must not cause regressions on a reasonable subset of llvm-test,
275 where "reasonable" depends on the contributor's judgement and the scope of
276 the change (more invasive changes require more testing). A reasonable subset
277 might be something like "``llvm-test/MultiSource/Benchmarks``".
279 #. Ensure that links in source code and test files point to publicly available
280 resources and are used primarily to add additional information rather than
281 to supply critical context. The surrounding comments should be sufficient
282 to provide the context behind such links.
284 Additionally, the committer is responsible for addressing any problems found in
285 the future that the change is responsible for. For example:
287 * The code should compile cleanly on all supported platforms.
289 * The changes should not cause any correctness regressions in the ``llvm-test``
290 suite and must not cause any major performance regressions.
292 * The change set should not cause performance or correctness regressions for the
295 * The changes should not cause performance or correctness regressions in code
296 compiled by LLVM on all applicable targets.
298 * You are expected to address any `GitHub Issues <https://github.com/llvm/llvm-project/issues>`_ that
299 result from your change.
301 We prefer for this to be handled before submission but understand that it isn't
302 possible to test all of this for every submission. Our build bots and nightly
303 testing infrastructure normally finds these problems. A good rule of thumb is
304 to check the nightly testers for regressions the day after your change. Build
305 bots will directly email you if a group of commits that included yours caused a
306 failure. You are expected to check the build bot messages to see if they are
307 your fault and, if so, fix the breakage.
309 Commits that violate these quality standards (e.g. are very broken) may be
310 reverted. This is necessary when the change blocks other developers from making
311 progress. The developer is welcome to re-commit the change after the problem has
319 Although we don't enforce the format of commit messages, we prefer that
320 you follow these guidelines to help review, search in logs, email formatting
321 and so on. These guidelines are very similar to rules used by other open source
324 Most importantly, the contents of the message should be carefully written to
325 convey the rationale of the change (without delving too much in detail). It
326 also should avoid being vague or overly specific. For example, "bits were not
327 set right" will leave the reviewer wondering about which bits, and why they
328 weren't right, while "Correctly set overflow bits in TargetInfo" conveys almost
329 all there is to the change.
331 Below are some guidelines about the format of the message itself:
333 * Separate the commit message into title and body separated by a blank line.
335 * If you're not the original author, ensure the 'Author' property of the commit is
336 set to the original author and the 'Committer' property is set to yourself.
337 You can use a command similar to
338 ``git commit --amend --author="John Doe <jdoe@llvm.org>"`` to correct the
339 author property if it is incorrect. See `Attribution of Changes`_ for more
340 information including the method we used for attribution before the project
343 In the rare situation where there are multiple authors, please use the `git
344 tag 'Co-authored-by:' to list the additional authors
345 <https://github.blog/2018-01-29-commit-together-with-co-authors/>`_.
347 * The title should be concise. Because all commits are emailed to the list with
348 the first line as the subject, long titles are frowned upon. Short titles
349 also look better in `git log`.
351 * When the changes are restricted to a specific part of the code (e.g. a
352 back-end or optimization pass), it is customary to add a tag to the
353 beginning of the line in square brackets. For example, "[SCEV] ..."
354 or "[OpenMP] ...". This helps email filters and searches for post-commit
357 * The body, if it exists, should be separated from the title by an empty line.
359 * The body should be concise, but explanatory, including a complete
360 reasoning. Unless it is required to understand the change, examples,
361 code snippets and gory details should be left to bug comments, web
362 review or the mailing list.
364 * Text formatting and spelling should follow the same rules as documentation
365 and in-code comments, ex. capitalization, full stop, etc.
367 * If the commit is a bug fix on top of another recently committed patch, or a
368 revert or reapply of a patch, include the git commit hash of the prior
369 related commit. This could be as simple as "Revert commit NNNN because it
372 * If the patch has been reviewed, add a link to its review page, as shown
373 `here <https://www.llvm.org/docs/Phabricator.html#committing-a-change>`__.
374 If the patch fixes a bug in GitHub Issues, we encourage adding a reference to
375 the issue being closed, as described
376 `here <https://llvm.org/docs/BugLifeCycle.html#resolving-closing-bugs>`__.
378 * It is also acceptable to add other metadata to the commit message to automate
379 processes, including for downstream consumers. This metadata can include
380 links to resources that are not available to the entire community. However,
381 such links and/or metadata should not be used in place of making the commit
382 message self-explanatory. Note that such non-public links should not be
383 included in the submitted code.
385 For minor violations of these recommendations, the community normally favors
386 reminding the contributor of this policy over reverting. Minor corrections and
387 omissions can be handled by sending a reply to the commits mailing list.
391 Patch reversion policy
392 ----------------------
394 As a community, we strongly value having the tip of tree in a good state while
395 allowing rapid iterative development. As such, we tend to make much heavier
396 use of reverts to keep the tree healthy than some other open source projects,
397 and our norms are a bit different.
399 How should you respond if someone reverted your change?
401 * Remember, it is normal and healthy to have patches reverted. Having a patch
402 reverted does not necessarily mean you did anything wrong.
403 * We encourage explicitly thanking the person who reverted the patch for doing
404 the task on your behalf.
405 * If you need more information to address the problem, please follow up in the
406 original commit thread with the reverting patch author.
408 When should you revert your own change?
410 * Any time you learn of a serious problem with a change, you should revert it.
411 We strongly encourage "revert to green" as opposed to "fixing forward". We
412 encourage reverting first, investigating offline, and then reapplying the
413 fixed patch - possibly after another round of review if warranted.
414 * If you break a buildbot in a way which can't be quickly fixed, please revert.
415 * If a test case that demonstrates a problem is reported in the commit thread,
416 please revert and investigate offline.
417 * If you receive substantial :ref:`post-commit review <post_commit_review>`
418 feedback, please revert and address said feedback before recommitting.
419 (Possibly after another round of review.)
420 * If you are asked to revert by another contributor, please revert and discuss
421 the merits of the request offline (unless doing so would further destabilize
424 When should you revert someone else's change?
426 * In general, if the author themselves would revert the change per these
427 guidelines, we encourage other contributors to do so as a courtesy to the
428 author. This is one of the major cases where our norms differ from others;
429 we generally consider reverting a normal part of development. We don't
430 expect contributors to be always available, and the assurance that a
431 problematic patch will be reverted and we can return to it at our next
432 opportunity enables this.
434 What are the expectations around a revert?
436 * Use your best judgment. If you're uncertain, please start an email on
437 the commit thread asking for assistance. We aren't trying to enumerate
438 every case, but rather give a set of guidelines.
439 * You should be sure that reverting the change improves the stability of tip
440 of tree. Sometimes reverting one change in a series can worsen things
441 instead of improving them. We expect reasonable judgment to ensure that
442 the proper patch or set of patches is being reverted.
443 * The commit message for the reverting commit should explain why patch
445 * It is customary to respond to the original commit email mentioning the
446 revert. This serves as both a notice to the original author that their
447 patch was reverted, and helps others following llvm-commits track context.
448 * Ideally, you should have a publicly reproducible test case ready to share.
449 Where possible, we encourage sharing of test cases in commit threads, or
450 in PRs. We encourage the reverter to minimize the test case and to prune
451 dependencies where practical. This even applies when reverting your own
452 patch; documenting the reasons for others who might be following along
454 * It is not considered reasonable to revert without at least the promise to
455 provide a means for the patch author to debug the root issue. If a situation
456 arises where a public reproducer can not be shared for some reason (e.g.
457 requires hardware patch author doesn't have access to, sharp regression in
458 compile time of internal workload, etc.), the reverter is expected to be
459 proactive about working with the patch author to debug and test candidate
461 * Reverts should be reasonably timely. A change submitted two hours ago
462 can be reverted without prior discussion. A change submitted two years ago
463 should not be. Where exactly the transition point is is hard to say, but
464 it's probably in the handful of days in tree territory. If you are unsure,
465 we encourage you to reply to the commit thread, give the author a bit to
466 respond, and then proceed with the revert if the author doesn't seem to be
468 * When re-applying a reverted patch, the commit message should be updated to
469 indicate the problem that was addressed and how it was addressed.
471 Obtaining Commit Access
472 -----------------------
474 We grant commit access to contributors with a track record of submitting high
475 quality patches. If you would like commit access, please send an email to
476 `Chris <mailto:clattner@llvm.org>`_ with your GitHub username. This is true
477 for former contributors with SVN access as well as new contributors. If
478 approved, a GitHub invitation will be sent to your GitHub account. In case you
479 don't get notification from GitHub, go to
480 `Invitation Link <https://github.com/orgs/llvm/invitation>`_ directly. Once
481 accept the invitation, you'll get commit access.
483 Prior to obtaining commit access, it is common practice to request that
484 someone with commit access commits on your behalf. When doing so, please
485 provide the name and email address you would like to use in the Author
486 property of the commit.
488 For external tracking purposes, committed changes are automatically reflected
489 on a commits mailing list soon after the commit lands (e.g. llvm-commits_).
490 Note that these mailing lists are moderated, and it is not unusual for a large
491 commit to require a moderator to approve the email, so do not be concerned if a
492 commit does not immediately appear in the archives.
494 If you have recently been granted commit access, these policies apply:
496 #. You are granted *commit-after-approval* to all parts of LLVM. For
497 information on how to get approval for a patch, please see :doc:`CodeReview`.
498 When approved, you may commit it yourself.
500 #. You are allowed to commit patches without approval which you think are
501 obvious. This is clearly a subjective decision --- we simply expect you to
502 use good judgement. Examples include: fixing build breakage, reverting
503 obviously broken patches, documentation/comment changes, any other minor
504 changes. Avoid committing formatting- or whitespace-only changes outside of
505 code you plan to make subsequent changes to. Also, try to separate
506 formatting or whitespace changes from functional changes, either by
507 correcting the format first (ideally) or afterward. Such changes should be
508 highly localized and the commit message should clearly state that the commit
509 is not intended to change functionality, usually by stating it is
512 #. You are allowed to commit patches without approval to those portions of LLVM
513 that you have contributed or maintain (i.e., have been assigned
514 responsibility for), with the proviso that such commits must not break the
515 build. This is a "trust but verify" policy, and commits of this nature are
516 reviewed after they are committed.
518 #. Multiple violations of these policies or a single egregious violation may
519 cause commit access to be revoked.
521 In any case, your changes are still subject to `code review`_ (either before or
522 after they are committed, depending on the nature of the change). You are
523 encouraged to review other peoples' patches as well, but you aren't required
526 .. _discuss the change/gather consensus:
528 Making a Major Change
529 ---------------------
531 When a developer begins a major new project with the aim of contributing it back
532 to LLVM, they should inform the community with a post to the `LLVM Discourse forums`_, to the extent
533 possible. The reason for this is to:
535 #. keep the community informed about future changes to LLVM,
537 #. avoid duplication of effort by preventing multiple parties working on the
538 same thing and not knowing about it, and
540 #. ensure that any technical issues around the proposed work are discussed and
541 resolved before any significant work is done.
543 The design of LLVM is carefully controlled to ensure that all the pieces fit
544 together well and are as consistent as possible. If you plan to make a major
545 change to the way LLVM works or want to add a major new extension, it is a good
546 idea to get consensus with the development community before you start working on
549 Once the design of the new feature is finalized, the work itself should be done
550 as a series of `incremental changes`_, not as a long-term development branch.
552 .. _incremental changes:
554 Incremental Development
555 -----------------------
557 In the LLVM project, we do all significant changes as a series of incremental
558 patches. We have a strong dislike for huge changes or long-term development
559 branches. Long-term development branches have a number of drawbacks:
561 #. Branches must have mainline merged into them periodically. If the branch
562 development and mainline development occur in the same pieces of code,
563 resolving merge conflicts can take a lot of time.
565 #. Other people in the community tend to ignore work on branches.
567 #. Huge changes (produced when a branch is merged back onto mainline) are
568 extremely difficult to `code review`_.
570 #. Branches are not routinely tested by our nightly tester infrastructure.
572 #. Changes developed as monolithic large changes often don't work until the
573 entire set of changes is done. Breaking it down into a set of smaller
574 changes increases the odds that any of the work will be committed to the main
577 To address these problems, LLVM uses an incremental development style and we
578 require contributors to follow this practice when making a large/invasive
581 * Large/invasive changes usually have a number of secondary changes that are
582 required before the big change can be made (e.g. API cleanup, etc). These
583 sorts of changes can often be done before the major change is done,
584 independently of that work.
586 * The remaining inter-related work should be decomposed into unrelated sets of
587 changes if possible. Once this is done, define the first increment and get
588 consensus on what the end goal of the change is.
590 * Each change in the set can be stand alone (e.g. to fix a bug), or part of a
591 planned series of changes that works towards the development goal.
593 * Each change should be kept as small as possible. This simplifies your work
594 (into a logical progression), simplifies code review and reduces the chance
595 that you will get negative feedback on the change. Small increments also
596 facilitate the maintenance of a high quality code base.
598 * Often, an independent precursor to a big change is to add a new API and slowly
599 migrate clients to use the new API. Each change to use the new API is often
600 "obvious" and can be committed without review. Once the new API is in place
601 and used, it is much easier to replace the underlying implementation of the
602 API. This implementation change is logically separate from the API
605 If you are interested in making a large change, and this scares you, please make
606 sure to first `discuss the change/gather consensus`_ then ask about the best way
607 to go about making the change.
609 Attribution of Changes
610 ----------------------
612 When contributors submit a patch to an LLVM project, other developers with
613 commit access may commit it for the author once appropriate (based on the
614 progression of code review, etc.). When doing so, it is important to retain
615 correct attribution of contributions to their contributors. However, we do not
616 want the source code to be littered with random attributions "this code written
617 by J. Random Hacker" (this is noisy and distracting). In practice, the revision
618 control system keeps a perfect history of who changed what, and the CREDITS.txt
619 file describes higher-level contributions. If you commit a patch for someone
620 else, please follow the attribution of changes in the simple manner as outlined
621 by the `commit messages`_ section. Overall, please do not add contributor names
624 Also, don't commit patches authored by others unless they have submitted the
625 patch to the project or you have been authorized to submit them on their behalf
626 (you work together and your company authorized you to contribute the patches,
627 etc.). The author should first submit them to the relevant project's commit
628 list, development list, or LLVM bug tracker component. If someone sends you
629 a patch privately, encourage them to submit it to the appropriate list first.
631 Our previous version control system (subversion) did not distinguish between the
632 author and the committer like git does. As such, older commits used a different
633 attribution mechanism. The previous method was to include "Patch by John Doe."
634 in a separate line of the commit message and there are automated processes that
637 .. _IR backwards compatibility:
639 IR Backwards Compatibility
640 --------------------------
642 When the IR format has to be changed, keep in mind that we try to maintain some
643 backwards compatibility. The rules are intended as a balance between convenience
644 for llvm users and not imposing a big burden on llvm developers:
646 * The textual format is not backwards compatible. We don't change it too often,
647 but there are no specific promises.
649 * Additions and changes to the IR should be reflected in
650 ``test/Bitcode/compatibility.ll``.
652 * The current LLVM version supports loading any bitcode since version 3.0.
654 * After each X.Y release, ``compatibility.ll`` must be copied to
655 ``compatibility-X.Y.ll``. The corresponding bitcode file should be assembled
656 using the X.Y build and committed as ``compatibility-X.Y.ll.bc``.
658 * Newer releases can ignore features from older releases, but they cannot
659 miscompile them. For example, if nsw is ever replaced with something else,
660 dropping it would be a valid way to upgrade the IR.
662 * Debug metadata is special in that it is currently dropped during upgrades.
664 * Non-debug metadata is defined to be safe to drop, so a valid way to upgrade
665 it is to drop it. That is not very user friendly and a bit more effort is
666 expected, but no promises are made.
671 * Stability Guarantees: The C API is, in general, a "best effort" for stability.
672 This means that we make every attempt to keep the C API stable, but that
673 stability will be limited by the abstractness of the interface and the
674 stability of the C++ API that it wraps. In practice, this means that things
675 like "create debug info" or "create this type of instruction" are likely to be
676 less stable than "take this IR file and JIT it for my current machine".
678 * Release stability: We won't break the C API on the release branch with patches
679 that go on that branch, with the exception that we will fix an unintentional
680 C API break that will keep the release consistent with both the previous and
683 * Testing: Patches to the C API are expected to come with tests just like any
686 * Including new things into the API: If an LLVM subcomponent has a C API already
687 included, then expanding that C API is acceptable. Adding C API for
688 subcomponents that don't currently have one needs to be discussed on the
689 `LLVM Discourse forums`_ for design and maintainability feedback prior to implementation.
691 * Documentation: Any changes to the C API are required to be documented in the
692 release notes so that it's clear to external users who do not follow the
693 project how the C API is changing and evolving.
697 Updating Toolchain Requirements
698 -------------------------------
700 We intend to require newer toolchains as time goes by. This means LLVM's
701 codebase can use newer versions of C++ as they get standardized. Requiring newer
702 toolchains to build LLVM can be painful for those building LLVM; therefore, it
703 will only be done through the following process:
705 * It is a general goal to support LLVM and GCC versions from the last 3 years
706 at a minimum. This time-based guideline is not strict: we may support much
707 older compilers, or decide to support fewer versions.
709 * An RFC is sent to the `LLVM Discourse forums`_
711 - Detail upsides of the version increase (e.g. which newer C++ language or
712 library features LLVM should use; avoid miscompiles in particular compiler
714 - Detail downsides on important platforms (e.g. Ubuntu LTS status).
716 * Once the RFC reaches consensus, update the CMake toolchain version checks as
717 well as the :doc:`getting started<GettingStarted>` guide. This provides a
718 softer transition path for developers compiling LLVM, because the
719 error can be turned into a warning using a CMake flag. This is an important
720 step: LLVM still doesn't have code which requires the new toolchains, but it
721 soon will. If you compile LLVM but don't read the forums, we should
724 * Ensure that at least one LLVM release has had this soft-error. Not all
725 developers compile LLVM top-of-tree. These release-bound developers should
726 also be told about upcoming changes.
728 * Turn the soft-error into a hard-error after said LLVM release has branched.
730 * Update the :doc:`coding standards<CodingStandards>` to allow the new
731 features we've explicitly approved in the RFC.
733 * Start using the new features in LLVM's codebase.
736 <https://discourse.llvm.org/t/rfc-migrating-past-c-11/50943>`_ and the
737 `corresponding change <https://reviews.llvm.org/D57264>`_.
741 Working with the CI system
742 --------------------------
744 The main continuous integration (CI) tool for the LLVM project is the
745 `LLVM Buildbot <https://lab.llvm.org/buildbot/>`_. It uses different *builders*
746 to cover a wide variety of sub-projects and configurations. The builds are
747 executed on different *workers*. Builders and workers are configured and
748 provided by community members.
750 The Buildbot tracks the commits on the main branch and the release branches.
751 This means that patches are built and tested after they are merged to the these
752 branches (aka post-merge testing). This also means it's okay to break the build
753 occasionally, as it's unreasonable to expect contributors to build and test
754 their patch with every possible configuration.
756 *If your commit broke the build:*
758 * Fix the build as soon as possible as this might block other contributors or
760 * If you need more time to analyze and fix the bug, please revert your change to
763 *If someone else broke the build and this blocks your work*
765 * Comment on the code review in `GitHub <https://github.com/llvm/llvm-project/pulls>`_
766 (if available) or email the author, explain the problem and how this impacts
767 you. Add a link to the broken build and the error message so folks can
768 understand the problem.
769 * Revert the commit if this blocks your work, see revert_policy_ .
771 *If a build/worker is permanently broken*
773 * 1st step: contact the owner of the worker. You can find the name and contact
774 information for the *Admin* of worker on the page of the build in the
777 .. image:: buildbot_worker_contact.png
779 * 2nd step: If the owner does not respond or fix the worker, please escalate
780 to Galina Kostanova, the maintainer of the BuildBot master.
781 * 3rd step: If Galina could not help you, please escalate to the
782 `Infrastructure Working Group <mailto:iwg@llvm.org>`_.
784 .. _new-llvm-components:
786 Introducing New Components into LLVM
787 ====================================
789 The LLVM community is a vibrant and exciting place to be, and we look to be
790 inclusive of new projects and foster new communities, and increase
791 collaboration across industry and academia.
793 That said, we need to strike a balance between being inclusive of new ideas and
794 people and the cost of ongoing maintenance that new code requires. As such, we
795 have a general :doc:`support policy<SupportPolicy>` for introducing major new
796 components into the LLVM world, depending on the degree of detail and
797 responsibility required. *Core* projects need a higher degree of scrutiny
798 than *peripheral* projects, and the latter may have additional differences.
800 However, this is really only intended to cover common cases
801 that we have seen arise: different situations are different, and we are open
802 to discussing unusual cases as well - just start an RFC thread on the
803 `LLVM Discourse forums`_.
808 LLVM is very receptive to new targets, even experimental ones, but a number of
809 problems can appear when adding new large portions of code, and back-ends are
810 normally added in bulk. New targets need the same level of support as other
811 *core* parts of the compiler, so they are covered in the *core tier* of our
812 :doc:`support policy<SupportPolicy>`.
814 We have found that landing large pieces of new code and then trying to fix
815 emergent problems in-tree is problematic for a variety of reasons. For these
816 reasons, new targets are *always* added as *experimental* until they can be
817 proven stable, and later moved to non-experimental.
819 The differences between both classes are:
821 * Experimental targets are not built by default (they need to be explicitly
822 enabled at CMake time).
824 * Test failures, bugs, and build breakages that only appear when the
825 experimental target is enabled, caused by changes unrelated to the target, are
826 the responsibility of the community behind the target to fix.
828 The basic rules for a back-end to be upstreamed in **experimental** mode are:
830 * Every target must have a :ref:`code owner<code owners>`. The `CODE_OWNERS.TXT`
831 file has to be updated as part of the first merge. The code owner makes sure
832 that changes to the target get reviewed and steers the overall effort.
834 * There must be an active community behind the target. This community
835 will help maintain the target by providing buildbots, fixing
836 bugs, answering the LLVM community's questions and making sure the new
837 target doesn't break any of the other targets, or generic code. This
838 behavior is expected to continue throughout the lifetime of the
841 * The code must be free of contentious issues, for example, large
842 changes in how the IR behaves or should be formed by the front-ends,
843 unless agreed by the majority of the community via refactoring of the
844 (:doc:`IR standard<LangRef>`) **before** the merge of the new target changes,
845 following the :ref:`IR backwards compatibility`.
847 * The code conforms to all of the policies laid out in this developer policy
848 document, including license, patent, and coding standards.
850 * The target should have either reasonable documentation on how it
851 works (ISA, ABI, etc.) or a publicly available simulator/hardware
852 (either free or cheap enough) - preferably both. This allows
853 developers to validate assumptions, understand constraints and review code
854 that can affect the target.
856 In addition, the rules for a back-end to be promoted to **official** are:
858 * The target must have addressed every other minimum requirement and
859 have been stable in tree for at least 3 months. This cool down
860 period is to make sure that the back-end and the target community can
861 endure continuous upstream development for the foreseeable future.
863 * The target's code must have been completely adapted to this policy
864 as well as the :doc:`coding standards<CodingStandards>`. Any exceptions that
865 were made to move into experimental mode must have been fixed **before**
868 * The test coverage needs to be broad and well written (small tests,
869 well documented). The build target ``check-all`` must pass with the
870 new target built, and where applicable, the ``test-suite`` must also
871 pass without errors, in at least one configuration (publicly
872 demonstrated, for example, via buildbots).
874 * Public buildbots need to be created and actively maintained, unless
875 the target requires no additional buildbots (ex. ``check-all`` covers
876 all tests). The more relevant and public the new target's CI infrastructure
877 is, the more the LLVM community will embrace it.
879 To **continue** as a supported and official target:
881 * The maintainer(s) must continue following these rules throughout the lifetime
882 of the target. Continuous violations of aforementioned rules and policies
883 could lead to complete removal of the target from the code base.
885 * Degradation in support, documentation or test coverage will make the target as
886 nuisance to other targets and be considered a candidate for deprecation and
889 In essence, these rules are necessary for targets to gain and retain their
890 status, but also markers to define bit-rot, and will be used to clean up the
891 tree from unmaintained targets.
893 Those wishing to add a new target to LLVM must follow the procedure below:
895 1. Read this section and make sure your target follows all requirements. For
896 minor issues, your community will be responsible for making all necessary
897 adjustments soon after the initial merge.
898 2. Send a request for comment (RFC) to the `LLVM Discourse forums`_ describing
899 your target and how it follows all the requirements and what work has been
900 done and will need to be done to accommodate the official target requirements.
901 Make sure to expose any and all controversial issues, changes needed in the
902 base code, table gen, etc.
903 3. Once the response is positive, the LLVM community can start reviewing the
904 actual patches (but they can be prepared before, to support the RFC). Create
905 a sequence of N patches, numbered '1/N' to 'N/N' (make sure N is an actual
906 number, not the letter 'N'), that completes the basic structure of the target.
907 4. The initial patch should add documentation, code owners and triple support in
908 clang and LLVM. The following patches add TableGen infrastructure to describe
909 the target and lower instructions to assembly. The final patch must show that
910 the target can lower correctly with extensive LIT tests (IR to MIR, MIR to
912 5. Some patches may be approved before others, but only after *all* patches are
913 approved that the whole set can be merged in one go. This is to guarantee
914 that all changes are good as a single block.
915 6. After the initial merge, the target community can stop numbering patches and
916 start working asynchronously on the target to complete support. They should
917 still seek review from those who helped them in the initial phase, to make
918 sure the progress is still consistent.
919 7. Once all official requirements have been fulfilled (as above), the code owner
920 should request the target to be enabled by default by sending another RFC to
921 the `LLVM Discourse forums`_.
923 Adding an Established Project To the LLVM Monorepo
924 --------------------------------------------------
926 The `LLVM monorepo <https://github.com/llvm/llvm-project>`_ is the centerpoint
927 of development in the LLVM world, and has all of the primary LLVM components,
928 including the LLVM optimizer and code generators, Clang, LLDB, etc. `Monorepos
929 in general <https://en.wikipedia.org/wiki/Monorepo>`_ are great because they
930 allow atomic commits to the project, simplify CI, and make it easier for
931 subcommunities to collaborate.
933 Like new targets, most projects already in the monorepo are considered to be in
934 the *core tier* of our :doc:`support policy<SupportPolicy>`. The burden to add
935 things to the LLVM monorepo needs to be very high - code that is added to this
936 repository is checked out by everyone in the community. As such, we hold
937 components to a high bar similar to "official targets", they:
939 * Must be generally aligned with the mission of the LLVM project to advance
940 compilers, languages, tools, runtimes, etc.
941 * Must conform to all of the policies laid out in this developer policy
942 document, including license, patent, coding standards, and code of conduct.
943 * Must have an active community that maintains the code, including established
945 * Should have reasonable documentation about how it works, including a high
947 * Should have CI to catch breakage within the project itself or due to
948 underlying LLVM dependencies.
949 * Should have code free of issues the community finds contentious, or be on a
950 clear path to resolving them.
951 * Must be proposed through the LLVM RFC process, and have its addition approved
952 by the LLVM community - this ultimately mediates the resolution of the
953 "should" concerns above.
955 If you have a project that you think would make sense to add to the LLVM
956 monorepo, please start an RFC topic on the `LLVM Discourse forums`_ to kick off
957 the discussion. This process can take some time and iteration - please don’t
958 be discouraged or intimidated by that!
960 If you have an earlier stage project that you think is aligned with LLVM, please
961 see the "Incubating New Projects" section.
963 Incubating New Projects
964 -----------------------
966 The burden to add a new project to the LLVM monorepo is intentionally very high,
967 but that can have a chilling effect on new and innovative projects. To help
968 foster these sorts of projects, LLVM supports an "incubator" process that is
969 much easier to get started with. It provides space for potentially valuable,
970 new top-level and sub-projects to reach a critical mass before they have enough
971 code to prove their utility and grow a community. This also allows
972 collaboration between teams that already have permissions to make contributions
973 to projects under the LLVM umbrella.
975 Projects which can be considered for the LLVM incubator meet the following
978 * Must be generally aligned with the mission of the LLVM project to advance
979 compilers, languages, tools, runtimes, etc.
980 * Must conform to the license, patent, and code of conduct policies laid out
981 in this developer policy document.
982 * Must have a documented charter and development plan, e.g. in the form of a
983 README file, mission statement, and/or manifesto.
984 * Should conform to coding standards, incremental development process, and
986 * Should have a sense of the community that it hopes to eventually foster, and
987 there should be interest from members with different affiliations /
989 * Should have a feasible path to eventually graduate as a dedicated top-level
990 or sub-project within the `LLVM monorepo
991 <https://github.com/llvm/llvm-project>`_.
992 * Should include a notice (e.g. in the project README or web page) that the
993 project is in ‘incubation status’ and is not included in LLVM releases (see
994 suggested wording below).
995 * Must be proposed through the LLVM RFC process, and have its addition
996 approved by the LLVM community - this ultimately mediates the resolution of
997 the "should" concerns above.
999 That said, the project need not have any code to get started, and need not have
1000 an established community at all! Furthermore, incubating projects may pass
1001 through transient states that violate the "Should" guidelines above, or would
1002 otherwise make them unsuitable for direct inclusion in the monorepo (e.g.
1003 dependencies that have not yet been factored appropriately, leveraging
1004 experimental components or APIs that are not yet upstream, etc).
1006 When approved, the llvm-admin group can grant the new project:
1007 * A new repository in the LLVM Github Organization - but not the LLVM monorepo.
1008 * New mailing list, discourse forum, and/or discord chat hosted with other LLVM
1010 * Other infrastructure integration can be discussed on a case-by-case basis.
1012 Graduation to the mono-repo would follow existing processes and standards for
1013 becoming a first-class part of the monorepo. Similarly, an incubating project
1014 may be eventually retired, but no process has been established for that yet. If
1015 and when this comes up, please start an RFC discussion on the `LLVM Discourse forums`_.
1017 This process is very new - please expect the details to change, it is always
1018 safe to ask on the `LLVM Discourse forums`_ about this.
1020 Suggested disclaimer for the project README and the main project web page:
1024 This project is participating in the LLVM Incubator process: as such, it is
1025 not part of any official LLVM release. While incubation status is not
1026 necessarily a reflection of the completeness or stability of the code, it
1027 does indicate that the project is not yet endorsed as a component of LLVM.
1029 .. _copyright-license-patents:
1031 Copyright, License, and Patents
1032 ===============================
1036 This section deals with legal matters but does not provide legal advice. We
1037 are not lawyers --- please seek legal counsel from a licensed attorney.
1039 This section addresses the issues of copyright, license and patents for the LLVM
1040 project. The copyright for the code is held by the contributors of
1041 the code. The code is licensed under permissive `open source licensing terms`_,
1042 namely the Apache-2.0 with LLVM-exception license, which includes a copyright
1043 and `patent license`_. When you contribute code to the LLVM project, you
1044 license it under these terms.
1046 In certain circumstances, code licensed under other licenses can be added
1047 to the codebase. However, this may only be done with approval of the LLVM
1048 Foundation Board of Directors, and contributors should plan for the approval
1049 process to take at least 4-6 weeks. If you would like to contribute code
1050 under a different license, please create a Phabricator review with the code
1051 you want to contribute and email board@llvm.org requesting a review.
1053 If you have questions or comments about these topics, please ask on the
1054 `LLVM Discourse forums`_. However,
1055 please realize that most compiler developers are not lawyers, and therefore you
1056 will not be getting official legal advice.
1061 The LLVM project does not collect copyright assignments, which means that the
1062 copyright for the code in the project is held by the respective contributors.
1063 Because you (or your company)
1064 retain ownership of the code you contribute, you know it may only be used under
1065 the terms of the open source license you contributed it under: the license for
1066 your contributions cannot be changed in the future without your approval.
1068 Because the LLVM project does not require copyright assignments, changing the
1069 LLVM license requires tracking down the
1070 contributors to LLVM and getting them to agree that a license change is
1071 acceptable for their contributions. We feel that a high burden for relicensing
1072 is good for the project, because contributors do not have to fear that their
1073 code will be used in a way with which they disagree.
1078 The last paragraph notwithstanding, the LLVM Project is in the middle of a large
1079 effort to change licenses, which aims to solve several problems:
1081 * The old licenses made it difficult to move code from (e.g.) the compiler to
1082 runtime libraries, because runtime libraries used a different license from the
1083 rest of the compiler.
1084 * Some contributions were not submitted to LLVM due to concerns that
1085 the patent grant required by the project was overly broad.
1086 * The patent grant was unique to the LLVM Project, not written by a lawyer, and
1087 was difficult to determine what protection was provided (if any).
1089 The scope of relicensing is all code that is considered part of the LLVM
1090 project, including the main LLVM repository, runtime libraries (compiler_rt,
1091 OpenMP, etc), Polly, and all other subprojects. There are a few exceptions:
1093 * Code imported from other projects (e.g. Google Test, Autoconf, etc) will
1094 remain as it is. This code isn't developed as part of the LLVM project, it
1096 * Some subprojects are impractical or uninteresting to relicense (e.g. llvm-gcc
1097 and dragonegg). These will be split off from the LLVM project (e.g. to
1098 separate GitHub projects), allowing interested people to continue their
1099 development elsewhere.
1101 To relicense LLVM, we will be seeking approval from all of the copyright holders
1102 of code in the repository, or potentially remove/rewrite code if we cannot.
1104 and challenging project which will take a significant amount of time to
1105 complete. In the interim, **all contributions to the project will be made under
1106 the terms of both the new license and the legacy license scheme** (each of which
1107 is described below). The exception to this is the legacy patent grant, which
1108 will not be required for new contributions.
1110 When all of the code in the project has been converted to the new license or
1111 removed, we will drop the requirement to contribute under the legacy license.
1112 This will achieve the goal of having
1113 a single standardized license for the entire codebase.
1115 If you are a prior contributor to LLVM and have not done so already, please do
1116 *TODO* to allow us to use your code. *Add a link to a separate page here, which
1117 is probably a click through web form or something like that. Details to be
1121 .. _open source licensing terms:
1123 New LLVM Project License Framework
1124 ----------------------------------
1126 Contributions to LLVM are licensed under the `Apache License, Version 2.0
1127 <https://www.apache.org/licenses/LICENSE-2.0>`_, with two limited
1128 exceptions intended to ensure that LLVM is very permissively licensed.
1129 Collectively, the name of this license is "Apache 2.0 License with LLVM
1130 exceptions". The exceptions read:
1134 ---- LLVM Exceptions to the Apache 2.0 License ----
1136 As an exception, if, as a result of your compiling your source code, portions
1137 of this Software are embedded into an Object form of such source code, you
1138 may redistribute such embedded portions in such Object form without complying
1139 with the conditions of Sections 4(a), 4(b) and 4(d) of the License.
1141 In addition, if you combine or link compiled forms of this Software with
1142 software that is licensed under the GPLv2 ("Combined Software") and if a
1143 court of competent jurisdiction determines that the patent provision (Section
1144 3), the indemnity provision (Section 9) or other Section of the License
1145 conflicts with the conditions of the GPLv2, you may retroactively and
1146 prospectively choose to deem waived or otherwise exclude such Section(s) of
1147 the License, but only in their entirety and only with respect to the Combined
1151 We intend to keep LLVM perpetually open source and available under a permissive
1152 license - this fosters the widest adoption of LLVM by
1153 **allowing commercial products to be derived from LLVM** with few restrictions
1154 and without a requirement for making any derived works also open source. In
1155 particular, LLVM's license is not a "copyleft" license like the GPL.
1157 The "Apache 2.0 License with LLVM exceptions" allows you to:
1159 * freely download and use LLVM (in whole or in part) for personal, internal, or
1160 commercial purposes.
1161 * include LLVM in packages or distributions you create.
1162 * combine LLVM with code licensed under every other major open source
1163 license (including BSD, MIT, GPLv2, GPLv3...).
1164 * make changes to LLVM code without being required to contribute it back
1165 to the project - contributions are appreciated though!
1167 However, it imposes these limitations on you:
1169 * You must retain the copyright notice if you redistribute LLVM: You cannot
1170 strip the copyright headers off or replace them with your own.
1171 * Binaries that include LLVM must reproduce the copyright notice (e.g. in an
1172 included README file or in an "About" box), unless the LLVM code was added as
1173 a by-product of compilation. For example, if an LLVM runtime library like
1174 compiler_rt or libc++ was automatically included into your application by the
1175 compiler, you do not need to attribute it.
1176 * You can't use our names to promote your products (LLVM derived or not) -
1177 though you can make truthful statements about your use of the LLVM code,
1178 without implying our sponsorship.
1179 * There's no warranty on LLVM at all.
1181 We want LLVM code to be widely used, and believe that this provides a model that
1182 is great for contributors and users of the project. For more information about
1183 the Apache 2.0 License, please see the `Apache License FAQ
1184 <http://www.apache.org/foundation/license-faq.html>`_, maintained by the
1192 Section 3 of the Apache 2.0 license is a patent grant under which
1193 contributors of code to the project contribute the rights to use any of
1194 their patents that would otherwise be infringed by that code contribution
1195 (protecting uses of that code). Further, the patent grant is revoked
1196 from anyone who files a patent lawsuit about code in LLVM - this protects the
1197 community by providing a "patent commons" for the code base and reducing the
1198 odds of patent lawsuits in general.
1200 The license specifically scopes which patents are included with code
1201 contributions. To help explain this, the `Apache License FAQ
1202 <http://www.apache.org/foundation/license-faq.html>`_ explains this scope using
1203 some questions and answers, which we reproduce here for your convenience (for
1204 reference, the "ASF" is the Apache Software Foundation, the guidance still
1207 Q1: If I own a patent and contribute to a Work, and, at the time my
1208 contribution is included in that Work, none of my patent's claims are subject
1209 to Apache's Grant of Patent License, is there a way any of those claims would
1210 later become subject to the Grant of Patent License solely due to subsequent
1211 contributions by other parties who are not licensees of that patent.
1215 Q2: If at any time after my contribution, I am able to license other patent
1216 claims that would have been subject to Apache's Grant of Patent License if
1217 they were licensable by me at the time of my contribution, do those other
1218 claims become subject to the Grant of Patent License?
1222 Q3: If I own or control a licensable patent and contribute code to a specific
1223 Apache product, which of my patent claims are subject to Apache's Grant of
1226 A3: The only patent claims that are licensed to the ASF are those you own or
1227 have the right to license that read on your contribution or on the
1228 combination of your contribution with the specific Apache product to which
1229 you contributed as it existed at the time of your contribution. No additional
1230 patent claims become licensed as a result of subsequent combinations of your
1231 contribution with any other software. Note, however, that licensable patent
1232 claims include those that you acquire in the future, as long as they read on
1233 your original contribution as made at the original time. Once a patent claim
1234 is subject to Apache's Grant of Patent License, it is licensed under the
1235 terms of that Grant to the ASF and to recipients of any software distributed
1236 by the ASF for any Apache software product whatsoever.
1240 Legacy License Structure
1241 ------------------------
1244 The code base was previously licensed under the Terms described here.
1245 We are in the middle of relicensing to a new approach (described above), but
1246 until this effort is complete, the code is also still available under these
1247 terms. Once we finish the relicensing project, new versions of the code will
1248 not be available under these terms. However, nothing takes away your right
1249 to use old versions under the licensing terms under which they were
1250 originally released.
1252 We intend to keep LLVM perpetually open source and to use a permissive open
1253 source license. The code in
1254 LLVM is available under the `University of Illinois/NCSA Open Source License
1255 <http://www.opensource.org/licenses/UoI-NCSA.php>`_, which boils down to
1258 * You can freely distribute LLVM.
1259 * You must retain the copyright notice if you redistribute LLVM.
1260 * Binaries derived from LLVM must reproduce the copyright notice (e.g. in an
1261 included README file).
1262 * You can't use our names to promote your LLVM derived products.
1263 * There's no warranty on LLVM at all.
1265 We believe this fosters the widest adoption of LLVM because it **allows
1266 commercial products to be derived from LLVM** with few restrictions and without
1267 a requirement for making any derived works also open source (i.e. LLVM's
1268 license is not a "copyleft" license like the GPL). We suggest that you read the
1269 `License <http://www.opensource.org/licenses/UoI-NCSA.php>`_ if further
1270 clarification is needed.
1272 In addition to the UIUC license, the runtime library components of LLVM
1273 (**compiler_rt, libc++, and libclc**) are also licensed under the `MIT License
1274 <http://www.opensource.org/licenses/mit-license.php>`_, which does not contain
1275 the binary redistribution clause. As a user of these runtime libraries, it
1276 means that you can choose to use the code under either license (and thus don't
1277 need the binary redistribution clause), and as a contributor to the code that
1278 you agree that any contributions to these libraries be licensed under both
1279 licenses. We feel that this is important for runtime libraries, because they
1280 are implicitly linked into applications and therefore should not subject those
1281 applications to the binary redistribution clause. This also means that it is ok
1282 to move code from (e.g.) libc++ to the LLVM core without concern, but that code
1283 cannot be moved from the LLVM core to libc++ without the copyright owner's
1286 .. _LLVM Discourse forums: https://discourse.llvm.org