Skip to content

Commit 936176f

Browse files
committed
[llvm][Docs] Improve the formatting of the Common Problems section
I realised this existed after answering https://discourse.llvm.org/t/clang-development-environment/81140. * Mark options, option values and program names as plain text. * Add a blank line between the option and the explanatory text so that it doesn't get printed on the same line. (this seems to be the original intent of the rst source anyway) * Update the phrasing of a couple of the options.
1 parent 5d1d2f0 commit 936176f

File tree

1 file changed

+40
-27
lines changed

1 file changed

+40
-27
lines changed

llvm/docs/GettingStarted.rst

Lines changed: 40 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,67 +1085,80 @@ general questions about LLVM, please consult the `Frequently Asked
10851085
Questions <FAQ.html>`_ page.
10861086

10871087
If you are having problems with limited memory and build time, please try
1088-
building with ninja instead of make. Please consider configuring the
1088+
building with ``ninja`` instead of ``make``. Please consider configuring the
10891089
following options with cmake:
10901090

1091-
* -G Ninja
1091+
* ``-G Ninja``
1092+
10921093
Setting this option will allow you to build with ninja instead of make.
10931094
Building with ninja significantly improves your build time, especially with
10941095
incremental builds, and improves your memory usage.
10951096

1096-
* -DLLVM_USE_LINKER
1097-
Setting this option to lld will significantly reduce linking time for LLVM
1097+
* ``-DLLVM_USE_LINKER``
1098+
1099+
Setting this option to ``lld`` will significantly reduce linking time for LLVM
10981100
executables on ELF-based platforms, such as Linux. If you are building LLVM
10991101
for the first time and lld is not available to you as a binary package, then
11001102
you may want to use the gold linker as a faster alternative to GNU ld.
11011103

1102-
* -DCMAKE_BUILD_TYPE
1104+
* ``-DCMAKE_BUILD_TYPE``
1105+
11031106
Controls optimization level and debug information of the build. This setting
11041107
can affect RAM and disk usage, see :ref:`CMAKE_BUILD_TYPE <cmake_build_type>`
11051108
for more information.
11061109

1107-
* -DLLVM_ENABLE_ASSERTIONS
1108-
This option defaults to ON for Debug builds and defaults to OFF for Release
1110+
* ``-DLLVM_ENABLE_ASSERTIONS``
1111+
1112+
This option defaults to ``ON`` for Debug builds and defaults to ``OFF`` for Release
11091113
builds. As mentioned in the previous option, using the Release build type and
11101114
enabling assertions may be a good alternative to using the Debug build type.
11111115

1112-
* -DLLVM_PARALLEL_LINK_JOBS
1116+
* ``-DLLVM_PARALLEL_LINK_JOBS``
1117+
11131118
Set this equal to number of jobs you wish to run simultaneously. This is
1114-
similar to the -j option used with make, but only for link jobs. This option
1119+
similar to the ``-j`` option used with ``make``, but only for link jobs. This option
11151120
can only be used with ninja. You may wish to use a very low number of jobs,
11161121
as this will greatly reduce the amount of memory used during the build
1117-
process. If you have limited memory, you may wish to set this to 1.
1122+
process. If you have limited memory, you may wish to set this to ``1``.
1123+
1124+
* ``-DLLVM_TARGETS_TO_BUILD``
11181125

1119-
* -DLLVM_TARGETS_TO_BUILD
11201126
Set this equal to the target you wish to build. You may wish to set this to
1121-
X86; however, you will find a full list of targets within the
1122-
llvm-project/llvm/lib/Target directory.
1127+
only your host architecture. For example `X86` if you are using an AMD64 machine.
1128+
You will find a full list of targets within the
1129+
`llvm-project/llvm/lib/Target <https://github.com/llvm/llvm-project/tree/main/llvm/lib/Target>`_
1130+
directory.
11231131

1124-
* -DLLVM_OPTIMIZED_TABLEGEN
1125-
Set this to ON to generate a fully optimized tablegen during your build. This
1132+
* ``-DLLVM_OPTIMIZED_TABLEGEN``
1133+
1134+
Set this to ``ON`` to generate a fully optimized tablegen during your build. This
11261135
will significantly improve your build time. This is only useful if you are
1127-
using the Debug build type.
1136+
using the ``Debug`` build type.
1137+
1138+
* ``-DLLVM_ENABLE_PROJECTS``
11281139

1129-
* -DLLVM_ENABLE_PROJECTS
1130-
Set this equal to the projects you wish to compile (e.g. clang, lld, etc.) If
1140+
Set this equal to the projects you wish to compile (e.g. ``clang``, ``lld``, etc.) If
11311141
compiling more than one project, separate the items with a semicolon. Should
11321142
you run into issues with the semicolon, try surrounding it with single quotes.
11331143

1134-
* -DLLVM_ENABLE_RUNTIMES
1135-
Set this equal to the runtimes you wish to compile (e.g. libcxx, libcxxabi, etc.)
1144+
* ``-DLLVM_ENABLE_RUNTIMES``
1145+
1146+
Set this equal to the runtimes you wish to compile (e.g. ``libcxx``, ``libcxxabi``, etc.)
11361147
If compiling more than one runtime, separate the items with a semicolon. Should
11371148
you run into issues with the semicolon, try surrounding it with single quotes.
11381149

1139-
* -DCLANG_ENABLE_STATIC_ANALYZER
1140-
Set this option to OFF if you do not require the clang static analyzer. This
1150+
* ``-DCLANG_ENABLE_STATIC_ANALYZER``
1151+
1152+
Set this option to ``OFF`` if you do not require the clang static analyzer. This
11411153
should improve your build time slightly.
11421154

1143-
* -DLLVM_USE_SPLIT_DWARF
1144-
Consider setting this to ON if you require a debug build, as this will ease
1155+
* ``-DLLVM_USE_SPLIT_DWARF``
1156+
1157+
Consider setting this to ``ON`` if you require a debug build, as this will ease
11451158
memory pressure on the linker. This will make linking much faster, as the
1146-
binaries will not contain any of the debug information; however, this will
1147-
generate the debug information in the form of a DWARF object file (with the
1148-
extension .dwo). This only applies to host platforms using ELF, such as Linux.
1159+
binaries will not contain any of the debug information. Instead the debug
1160+
information is in a separate DWARF object file (with the extension ``.dwo``).
1161+
This only applies to host platforms using ELF, such as Linux.
11491162

11501163
.. _links:
11511164

0 commit comments

Comments
 (0)