annotate llvm/docs/Contributing.rst @ 173:0572611fdcc8 llvm10 llvm12

reorgnization done
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 11:55:54 +0900
parents 1d019706d866
children 2e18cbf3894f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 ==================================
anatofuz
parents:
diff changeset
2 Contributing to LLVM
anatofuz
parents:
diff changeset
3 ==================================
anatofuz
parents:
diff changeset
4
anatofuz
parents:
diff changeset
5
anatofuz
parents:
diff changeset
6 Thank you for your interest in contributing to LLVM! There are multiple ways to
anatofuz
parents:
diff changeset
7 contribute, and we appreciate all contributions. In case you
anatofuz
parents:
diff changeset
8 have questions, you can either use the `Developer's List (llvm-dev)`_
anatofuz
parents:
diff changeset
9 or the #llvm channel on `irc.oftc.net`_.
anatofuz
parents:
diff changeset
10
anatofuz
parents:
diff changeset
11 If you want to contribute code, please familiarize yourself with the :doc:`DeveloperPolicy`.
anatofuz
parents:
diff changeset
12
anatofuz
parents:
diff changeset
13 .. contents::
anatofuz
parents:
diff changeset
14 :local:
anatofuz
parents:
diff changeset
15
anatofuz
parents:
diff changeset
16
anatofuz
parents:
diff changeset
17 Ways to Contribute
anatofuz
parents:
diff changeset
18 ==================
anatofuz
parents:
diff changeset
19
anatofuz
parents:
diff changeset
20 Bug Reports
anatofuz
parents:
diff changeset
21 -----------
anatofuz
parents:
diff changeset
22 If you are working with LLVM and run into a bug, we definitely want to know
anatofuz
parents:
diff changeset
23 about it. Please let us know and follow the instructions in
anatofuz
parents:
diff changeset
24 :doc:`HowToSubmitABug` to create a bug report.
anatofuz
parents:
diff changeset
25
anatofuz
parents:
diff changeset
26 Bug Fixes
anatofuz
parents:
diff changeset
27 ---------
anatofuz
parents:
diff changeset
28 If you are interested in contributing code to LLVM, bugs labeled with the
anatofuz
parents:
diff changeset
29 `beginner keyword`_ in the `bug tracker`_ are a good way to get familiar with
anatofuz
parents:
diff changeset
30 the code base. If you are interested in fixing a bug, please create an account
anatofuz
parents:
diff changeset
31 for the bug tracker and assign it to yourself, to let people know you are working on
anatofuz
parents:
diff changeset
32 it.
anatofuz
parents:
diff changeset
33
anatofuz
parents:
diff changeset
34 Then try to reproduce and fix the bug with upstream LLVM. Start by building
anatofuz
parents:
diff changeset
35 LLVM from source as described in :doc:`GettingStarted` and
anatofuz
parents:
diff changeset
36 and use the built binaries to reproduce the failure described in the bug. Use
anatofuz
parents:
diff changeset
37 a debug build (`-DCMAKE_BUILD_TYPE=Debug`) or a build with assertions
anatofuz
parents:
diff changeset
38 (`-DLLVM_ENABLE_ASSERTIONS=On`, enabled for Debug builds).
anatofuz
parents:
diff changeset
39
anatofuz
parents:
diff changeset
40 Bigger Pieces of Work
anatofuz
parents:
diff changeset
41 ---------------------
anatofuz
parents:
diff changeset
42 In case you are interested in taking on a bigger piece of work, a list of
anatofuz
parents:
diff changeset
43 interesting projects is maintained at the `LLVM's Open Projects page`_. In case
anatofuz
parents:
diff changeset
44 you are interested in working on any of these projects, please send a mail to
anatofuz
parents:
diff changeset
45 the `LLVM Developer's mailing list`_, so that we know the project is being
anatofuz
parents:
diff changeset
46 worked on.
anatofuz
parents:
diff changeset
47
anatofuz
parents:
diff changeset
48 How to Submit a Patch
anatofuz
parents:
diff changeset
49 =====================
anatofuz
parents:
diff changeset
50 Once you have a patch ready, it is time to submit it. The patch should:
anatofuz
parents:
diff changeset
51
anatofuz
parents:
diff changeset
52 * include a small unit test
anatofuz
parents:
diff changeset
53 * conform to the :doc:`CodingStandards`. You can use the `clang-format-diff.py`_ or `git-clang-format`_ tools to automatically format your patch properly.
anatofuz
parents:
diff changeset
54 * not contain any unrelated changes
anatofuz
parents:
diff changeset
55 * be an isolated change. Independent changes should be submitted as separate patches as this makes reviewing easier.
anatofuz
parents:
diff changeset
56
anatofuz
parents:
diff changeset
57 .. _format patches:
anatofuz
parents:
diff changeset
58
anatofuz
parents:
diff changeset
59 Before sending a patch for review, please also try to ensure it is
anatofuz
parents:
diff changeset
60 formatted properly. We use ``clang-format`` for this, which has git integration
anatofuz
parents:
diff changeset
61 through the ``git-clang-format`` script. On some systems, it may already be
anatofuz
parents:
diff changeset
62 installed (or be installable via your package manager). If so, you can simply
anatofuz
parents:
diff changeset
63 run it -- the following command will format only the code changed in the most
anatofuz
parents:
diff changeset
64 recent commit:
anatofuz
parents:
diff changeset
65
anatofuz
parents:
diff changeset
66 .. code-block:: console
anatofuz
parents:
diff changeset
67
anatofuz
parents:
diff changeset
68 % git clang-format HEAD~1
anatofuz
parents:
diff changeset
69
anatofuz
parents:
diff changeset
70 Note that this modifies the files, but doesn't commit them -- you'll likely want
anatofuz
parents:
diff changeset
71 to run
anatofuz
parents:
diff changeset
72
anatofuz
parents:
diff changeset
73 .. code-block:: console
anatofuz
parents:
diff changeset
74
anatofuz
parents:
diff changeset
75 % git commit --amend -a
anatofuz
parents:
diff changeset
76
anatofuz
parents:
diff changeset
77 in order to update the last commit with all pending changes.
anatofuz
parents:
diff changeset
78
anatofuz
parents:
diff changeset
79 .. note::
anatofuz
parents:
diff changeset
80 If you don't already have ``clang-format`` or ``git clang-format`` installed
anatofuz
parents:
diff changeset
81 on your system, the ``clang-format`` binary will be built alongside clang, and
anatofuz
parents:
diff changeset
82 the git integration can be run from
anatofuz
parents:
diff changeset
83 ``clang/tools/clang-format/git-clang-format``.
anatofuz
parents:
diff changeset
84
anatofuz
parents:
diff changeset
85
anatofuz
parents:
diff changeset
86 To get a patch accepted, it has to be reviewed by the LLVM community. This can
anatofuz
parents:
diff changeset
87 be done using `LLVM's Phabricator`_ or the llvm-commits mailing list.
anatofuz
parents:
diff changeset
88 Please follow :ref:`Phabricator#requesting-a-review-via-the-web-interface <phabricator-request-review-web>`
anatofuz
parents:
diff changeset
89 to request a review using Phabricator.
anatofuz
parents:
diff changeset
90
anatofuz
parents:
diff changeset
91 To make sure the right people see your patch, please select suitable reviewers
anatofuz
parents:
diff changeset
92 and add them to your patch when requesting a review. Suitable reviewers are the
anatofuz
parents:
diff changeset
93 code owner (see CODE_OWNERS.txt) and other people doing work in the area your
anatofuz
parents:
diff changeset
94 patch touches. If you are using Phabricator, add them to the `Reviewers` field
anatofuz
parents:
diff changeset
95 when creating a review and if you are using `llvm-commits`, add them to the CC of
anatofuz
parents:
diff changeset
96 your email.
anatofuz
parents:
diff changeset
97
anatofuz
parents:
diff changeset
98 A reviewer may request changes or ask questions during the review. If you are
anatofuz
parents:
diff changeset
99 uncertain on how to provide test cases, documentation, etc., feel free to ask
anatofuz
parents:
diff changeset
100 for guidance during the review. Please address the feedback and re-post an
anatofuz
parents:
diff changeset
101 updated version of your patch. This cycle continues until all requests and comments
anatofuz
parents:
diff changeset
102 have been addressed and a reviewer accepts the patch with a `Looks good to me` or `LGTM`.
anatofuz
parents:
diff changeset
103 Once that is done the change can be committed. If you do not have commit
anatofuz
parents:
diff changeset
104 access, please let people know during the review and someone should commit it
anatofuz
parents:
diff changeset
105 on your behalf.
anatofuz
parents:
diff changeset
106
anatofuz
parents:
diff changeset
107 If you have received no comments on your patch for a week, you can request a
anatofuz
parents:
diff changeset
108 review by 'ping'ing a patch by responding to the email thread containing the
anatofuz
parents:
diff changeset
109 patch, or the Phabricator review with "Ping." The common courtesy 'ping' rate
anatofuz
parents:
diff changeset
110 is once a week. Please remember that you are asking for valuable time from other
anatofuz
parents:
diff changeset
111 professional developers.
anatofuz
parents:
diff changeset
112
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
113 For more information on LLVM's code-review process, please see :doc:`CodeReview`.
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
114
150
anatofuz
parents:
diff changeset
115
anatofuz
parents:
diff changeset
116 Helpful Information About LLVM
anatofuz
parents:
diff changeset
117 ==============================
anatofuz
parents:
diff changeset
118 :doc:`LLVM's documentation <index>` provides a wealth of information about LLVM's internals as
anatofuz
parents:
diff changeset
119 well as various user guides. The pages listed below should provide a good overview
anatofuz
parents:
diff changeset
120 of LLVM's high-level design, as well as its internals:
anatofuz
parents:
diff changeset
121
anatofuz
parents:
diff changeset
122 :doc:`GettingStarted`
anatofuz
parents:
diff changeset
123 Discusses how to get up and running quickly with the LLVM infrastructure.
anatofuz
parents:
diff changeset
124 Everything from unpacking and compilation of the distribution to execution
anatofuz
parents:
diff changeset
125 of some tools.
anatofuz
parents:
diff changeset
126
anatofuz
parents:
diff changeset
127 :doc:`LangRef`
anatofuz
parents:
diff changeset
128 Defines the LLVM intermediate representation.
anatofuz
parents:
diff changeset
129
anatofuz
parents:
diff changeset
130 :doc:`ProgrammersManual`
anatofuz
parents:
diff changeset
131 Introduction to the general layout of the LLVM sourcebase, important classes
anatofuz
parents:
diff changeset
132 and APIs, and some tips & tricks.
anatofuz
parents:
diff changeset
133
anatofuz
parents:
diff changeset
134 `LLVM for Grad Students`__
anatofuz
parents:
diff changeset
135 This is an introduction to the LLVM infrastructure by Adrian Sampson. While it
anatofuz
parents:
diff changeset
136 has been written for grad students, it provides a good, compact overview of
anatofuz
parents:
diff changeset
137 LLVM's architecture, LLVM's IR and how to write a new pass.
anatofuz
parents:
diff changeset
138
anatofuz
parents:
diff changeset
139 .. __: http://www.cs.cornell.edu/~asampson/blog/llvm.html
anatofuz
parents:
diff changeset
140
anatofuz
parents:
diff changeset
141 `Intro to LLVM`__
anatofuz
parents:
diff changeset
142 Book chapter providing a compiler hacker's introduction to LLVM.
anatofuz
parents:
diff changeset
143
anatofuz
parents:
diff changeset
144 .. __: http://www.aosabook.org/en/llvm.html
anatofuz
parents:
diff changeset
145
anatofuz
parents:
diff changeset
146 .. _Developer's List (llvm-dev): http://lists.llvm.org/mailman/listinfo/llvm-dev
anatofuz
parents:
diff changeset
147 .. _irc.oftc.net: irc://irc.oftc.net/llvm
anatofuz
parents:
diff changeset
148 .. _beginner keyword: https://bugs.llvm.org/buglist.cgi?bug_status=NEW&bug_status=REOPENED&keywords=beginner%2C%20&keywords_type=allwords&list_id=130748&query_format=advanced&resolution=---
anatofuz
parents:
diff changeset
149 .. _bug tracker: https://bugs.llvm.org
anatofuz
parents:
diff changeset
150 .. _clang-format-diff.py: https://reviews.llvm.org/source/clang/browse/cfe/trunk/tools/clang-format/clang-format-diff.py
anatofuz
parents:
diff changeset
151 .. _git-clang-format: https://reviews.llvm.org/source/clang/browse/cfe/trunk/tools/clang-format/git-clang-format
anatofuz
parents:
diff changeset
152 .. _LLVM's Phabricator: https://reviews.llvm.org/
anatofuz
parents:
diff changeset
153 .. _LLVM's Open Projects page: https://llvm.org/OpenProjects.html#what
anatofuz
parents:
diff changeset
154 .. _LLVM Developer's mailing list: http://lists.llvm.org/mailman/listinfo/llvm-dev