-
Notifications
You must be signed in to change notification settings - Fork 14.5k
[llvm] Improve grammar and punctuation of several documents #149630
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
kazutakahirata
wants to merge
1
commit into
llvm:main
Choose a base branch
from
kazutakahirata:cleanup_20250718_doc_typos_getting_started
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[llvm] Improve grammar and punctuation of several documents #149630
kazutakahirata
wants to merge
1
commit into
llvm:main
from
kazutakahirata:cleanup_20250718_doc_typos_getting_started
+58
−58
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@llvm/pr-subscribers-llvm-ir Author: Kazu Hirata (kazutakahirata) ChangesPatch is 24.11 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/149630.diff 3 Files Affected:
diff --git a/llvm/docs/GettingStarted.rst b/llvm/docs/GettingStarted.rst
index 372fd403ef65d..3036dae192077 100644
--- a/llvm/docs/GettingStarted.rst
+++ b/llvm/docs/GettingStarted.rst
@@ -12,7 +12,7 @@ Welcome to the LLVM project!
The LLVM project has multiple components. The core of the project is
itself called "LLVM". This contains all of the tools, libraries, and header
-files needed to process intermediate representations and converts it into
+files needed to process intermediate representations and convert them into
object files. Tools include an assembler, disassembler, bitcode analyzer, and
bitcode optimizer. It also contains basic regression tests.
@@ -32,11 +32,11 @@ Getting the Source Code and Building LLVM
#. Check out LLVM (including subprojects like Clang):
* ``git clone https://github.com/llvm/llvm-project.git``
- * Or, on windows:
+ * Or, on Windows:
``git clone --config core.autocrlf=false
https://github.com/llvm/llvm-project.git``
- * To save storage and speed-up the checkout time, you may want to do a
+ * To save storage and speed up the checkout time, you may want to do a
`shallow clone <https://git-scm.com/docs/git-clone#Documentation/git-clone.txt---depthltdepthgt>`_.
For example, to get the latest revision of the LLVM project, use
@@ -71,7 +71,7 @@ Getting the Source Code and Building LLVM
Some common options:
- * ``-DLLVM_ENABLE_PROJECTS='...'`` --- semicolon-separated list of the LLVM
+ * ``-DLLVM_ENABLE_PROJECTS='...'`` --- A semicolon-separated list of the LLVM
subprojects you'd like to additionally build. Can include any of: clang,
clang-tools-extra, lldb, lld, polly, or cross-project-tests.
@@ -82,10 +82,10 @@ Getting the Source Code and Building LLVM
pathname of where you want the LLVM tools and libraries to be installed
(default ``/usr/local``).
- * ``-DCMAKE_BUILD_TYPE=type`` --- Controls optimization level and debug
+ * ``-DCMAKE_BUILD_TYPE=type`` --- Controls the optimization level and debug
information of the build. Valid options for *type* are ``Debug``,
``Release``, ``RelWithDebInfo``, and ``MinSizeRel``. For more detailed
- information see :ref:`CMAKE_BUILD_TYPE <cmake_build_type>`.
+ information, see :ref:`CMAKE_BUILD_TYPE <cmake_build_type>`.
* ``-DLLVM_ENABLE_ASSERTIONS=ON`` --- Compile with assertion checks enabled
(default is ON for Debug builds, OFF for all other build types).
@@ -124,7 +124,7 @@ Getting the Source Code and Building LLVM
``ninja -C build check-llvm``
- This will setup an LLVM build with debugging info, then compile LLVM and
+ This will set up an LLVM build with debugging info, then compile LLVM and
run LLVM tests.
* For more detailed information on CMake options, see `CMake <CMake.html>`__
@@ -150,7 +150,7 @@ page.
For stand-alone builds, you must have an llvm install that is configured
properly to be consumable by stand-alone builds of the other projects.
-This could be a distro provided LLVM install, or you can build it yourself,
+This could be a distro-provided LLVM install, or you can build it yourself,
like this:
.. code-block:: console
@@ -195,7 +195,7 @@ clang clang, cmake CLANG_INCLUDE_TESTS=ON (Required for check
lld lld, cmake
============ ======================== ======================
-Example for building stand-alone `clang`:
+Example of building stand-alone `clang`:
.. code-block:: console
@@ -224,7 +224,7 @@ Example for building stand-alone `clang`:
Requirements
============
-Before you begin to use the LLVM system, review the requirements given below.
+Before you begin to use the LLVM system, review the requirements below.
This may save you some trouble by knowing ahead of time what hardware and
software you will need.
@@ -265,7 +265,7 @@ Windows on Arm ARM64 Visual Studio, Clang\ :sup:`4`
#. Code generation supported for Pentium processors and up
#. Code generation supported for 32-bit ABI only
- #. To use LLVM modules on Win32-based system, you may configure LLVM
+ #. To use LLVM modules on a Win32-based system, you may configure LLVM
with ``-DBUILD_SHARED_LIBS=On``.
#. Visual Studio alone can compile LLVM. When using Clang, you
must also have Visual Studio installed.
@@ -309,7 +309,7 @@ Package Version Notes
#. Only needed if you want to run the automated test suite in the
``llvm/test`` directory, or if you plan to utilize any Python libraries,
utilities, or bindings.
- #. Optional, adds compression / uncompression capabilities to selected LLVM
+ #. Optional, adds compression/uncompression capabilities to selected LLVM
tools.
#. Optional, you can use any other build tool supported by CMake.
#. Only needed when building libc with New Headergen. Mainly used by libc.
@@ -401,11 +401,11 @@ Studio 2019 (or later), or a recent version of mingw64. FreeBSD 10.0 and newer
have a modern Clang as the system compiler.
However, some Linux distributions and some other or older BSDs sometimes have
-extremely old versions of GCC. These steps attempt to help you upgrade you
+extremely old versions of GCC. These steps attempt to help you upgrade your
compiler even on such a system. However, if at all possible, we encourage you
to use a recent version of a distribution with a modern system compiler that
meets these requirements. Note that it is tempting to install a prior
-version of Clang and libc++ to be the host compiler, however libc++ was not
+version of Clang and libc++ to be the host compiler; however, libc++ was not
well tested or set up to build on Linux until relatively recently. As
a consequence, this guide suggests just using libstdc++ and a modern GCC as the
initial host in a bootstrap, and then using Clang (and potentially libc++).
@@ -514,11 +514,11 @@ appropriate pathname on your local system. All these paths are absolute:
``SRC_ROOT``
- This is the top level directory of the LLVM source tree.
+ This is the top-level directory of the LLVM source tree.
``OBJ_ROOT``
- This is the top level directory of the LLVM object tree (i.e. the tree where
+ This is the top-level directory of the LLVM object tree (i.e. the tree where
object files and compiled programs will be placed. It can be the same as
SRC_ROOT).
@@ -666,7 +666,7 @@ cross-compiling CMake provides a variable ``CMAKE_TOOLCHAIN_FILE`` which can
define compiler flags and variables used during the CMake test operations.
The result of such a build is executables that are not runnable on the build
-host but can be executed on the target. As an example the following CMake
+host but can be executed on the target. As an example, the following CMake
invocation can generate build files targeting iOS. This will work on macOS
with the latest Xcode:
@@ -770,7 +770,7 @@ Generates system build files.
- Some simple examples showing how to use LLVM as a compiler for a custom
language - including lowering, optimization, and code generation.
-- Kaleidoscope Tutorial: Kaleidoscope language tutorial run through the
+- Kaleidoscope Tutorial: Kaleidoscope language tutorial runs through the
implementation of a nice little compiler for a non-trivial language
including a hand-written lexer, parser, AST, as well as code generation
support using LLVM- both static (ahead of time) and various approaches to
@@ -858,7 +858,7 @@ share code among the `tools`_.
``llvm/lib/Support/``
- Source code that corresponding to the header files in ``llvm/include/ADT/``
+ Source code that corresponds to the header files in ``llvm/include/ADT/``
and ``llvm/include/Support/``.
``llvm/bindings``
@@ -1051,7 +1051,7 @@ Example with clang
% lli hello.bc
- The second examples shows how to invoke the LLVM JIT, :doc:`lli
+ The second example shows how to invoke the LLVM JIT, :doc:`lli
<CommandGuide/lli>`.
#. Use the ``llvm-dis`` utility to take a look at the LLVM assembly code:
@@ -1163,7 +1163,7 @@ following options with cmake:
Consider setting this to ``ON`` if you require a debug build, as this will ease
memory pressure on the linker. This will make linking much faster, as the
- binaries will not contain any of the debug information. Instead the debug
+ binaries will not contain any of the debug information. Instead, the debug
information is in a separate DWARF object file (with the extension ``.dwo``).
This only applies to host platforms using ELF, such as Linux.
diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index 9a32f0cd15dd3..b568f343d8e83 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -2892,7 +2892,7 @@ site, these bundles may contain any values that are needed by the
generated code. For more details, see :ref:`GC Transitions
<gc_transition_args>`.
-The bundle contain an arbitrary list of Values which need to be passed
+The bundle contains an arbitrary list of Values which need to be passed
to GC transition code. They will be lowered and passed as operands to
the appropriate GC_TRANSITION nodes in the selection DAG. It is assumed
that these arguments must be available before and after (but not
@@ -2903,7 +2903,7 @@ necessarily during) the execution of the callee.
Assume Operand Bundles
^^^^^^^^^^^^^^^^^^^^^^
-Operand bundles on an :ref:`llvm.assume <int_assume>` allows representing
+Operand bundles on an :ref:`llvm.assume <int_assume>` allow representing
assumptions, such as that a :ref:`parameter attribute <paramattrs>` or a
:ref:`function attribute <fnattrs>` holds for a certain value at a certain
location. Operand bundles enable assumptions that are either hard or impossible
@@ -2922,11 +2922,11 @@ restricted form:
"<tag>"([ <holds for value> [, <attribute argument>] ])
-* The tag of the operand bundle is usually the name of attribute that can be
- assumed to hold. It can also be `ignore`, this tag doesn't contain any
+* The tag of the operand bundle is usually the name of the attribute that can be
+ assumed to hold. It can also be `ignore`; this tag doesn't contain any
information and should be ignored.
-* The first argument if present is the value for which the attribute hold.
-* The second argument if present is an argument of the attribute.
+* The first argument, if present, is the value for which the attribute holds.
+* The second argument, if present, is an argument of the attribute.
If there are no arguments the attribute is a property of the call location.
@@ -2968,7 +2968,7 @@ the behavior is undefined, unless one of the following exceptions applies:
dereferenceable at later pointers, e.g. because it could have been freed.
In addition to allowing operand bundles encoding function and parameter
-attributes, an assume operand bundle my also encode a ``separate_storage``
+attributes, an assume operand bundle may also encode a ``separate_storage``
operand bundle. This has the form:
.. code-block:: llvm
@@ -3115,7 +3115,7 @@ Note that the assembly string *must* be parseable by LLVM's integrated assembler
Data Layout
-----------
-A module may specify a target specific data layout string that specifies
+A module may specify a target-specific data layout string that specifies
how data is to be laid out in memory. The syntax for the data layout is
simply:
@@ -3611,7 +3611,7 @@ operation may modify the memory at that address. A volatile operation
may not modify any other memory accessible by the module being compiled.
A volatile operation may not call any code in the current module.
-In general (without target specific context), the address space of a
+In general (without target-specific context), the address space of a
volatile operation may not be changed. Different address spaces may
have different trapping behavior when dereferencing an invalid
pointer.
@@ -3794,7 +3794,7 @@ If an atomic operation is marked ``syncscope("singlethread")``, it only
other operations running in the same thread (for example, in signal handlers).
If an atomic operation is marked ``syncscope("<target-scope>")``, where
-``<target-scope>`` is a target specific synchronization scope, then it is target
+``<target-scope>`` is a target-specific synchronization scope, then it is target
dependent if it *synchronizes with* and participates in the seq\_cst total
orderings of other operations.
@@ -3896,10 +3896,10 @@ Floating-Point Semantics
------------------------
This section defines the semantics for core floating-point operations on types
-that use a format specified by IEEE-745. These types are: ``half``, ``float``,
+that use a format specified by IEEE-754. These types are: ``half``, ``float``,
``double``, and ``fp128``, which correspond to the binary16, binary32, binary64,
and binary128 formats, respectively. The "core" operations are those defined in
-section 5 of IEEE-745, which all have corresponding LLVM operations.
+section 5 of IEEE-754, which all have corresponding LLVM operations.
The value returned by those operations matches that of the corresponding
IEEE-754 operation executed in the :ref:`default LLVM floating-point environment
@@ -8746,11 +8746,11 @@ framework::
The metadata encoding as lists of lists of options, as opposed to a collapsed
list of options, is chosen so that the IR encoding can use multiple option
strings to specify e.g., a single library, while still having that specifier be
-preserved as an atomic element that can be recognized by a target specific
+preserved as an atomic element that can be recognized by a target-specific
assembly writer or object file emitter.
Each individual option is required to be either a valid option for the target's
-linker, or an option that is reserved by the target specific assembly writer or
+linker, or an option that is reserved by the target-specific assembly writer or
object file emitter. No other aspect of these options is defined by the IR.
Dependent Libs Named Metadata
@@ -19508,7 +19508,7 @@ Semantics:
The '``llvm.set.loop.iterations.*``' intrinsics do not perform any arithmetic
on their operand. It's a hint to the backend that can use this to set up the
-hardware-loop count with a target specific instruction, usually a move of this
+hardware-loop count with a target-specific instruction, usually a move of this
value to a special register or a hardware-loop instruction.
@@ -19547,7 +19547,7 @@ Semantics:
The '``llvm.start.loop.iterations.*``' intrinsics do not perform any arithmetic
on their operand. It's a hint to the backend that can use this to set up the
-hardware-loop count with a target specific instruction, usually a move of this
+hardware-loop count with a target-specific instruction, usually a move of this
value to a special register or a hardware-loop instruction.
'``llvm.test.set.loop.iterations.*``' Intrinsic
@@ -19583,7 +19583,7 @@ Semantics:
The '``llvm.test.set.loop.iterations.*``' intrinsics do not perform any
arithmetic on their operand. It's a hint to the backend that can use this to
-set up the hardware-loop count with a target specific instruction, usually a
+set up the hardware-loop count with a target-specific instruction, usually a
move of this value to a special register or a hardware-loop instruction.
The result is the conditional value of whether the given count is not zero.
@@ -19621,7 +19621,7 @@ Semantics:
The '``llvm.test.start.loop.iterations.*``' intrinsics do not perform any
arithmetic on their operand. It's a hint to the backend that can use this to
-set up the hardware-loop count with a target specific instruction, usually a
+set up the hardware-loop count with a target-specific instruction, usually a
move of this value to a special register or a hardware-loop instruction.
The result is a pair of the input and a conditional value of whether the
given count is not zero.
diff --git a/llvm/docs/ProgrammersManual.rst b/llvm/docs/ProgrammersManual.rst
index d417de73d0590..68490c8a247ba 100644
--- a/llvm/docs/ProgrammersManual.rst
+++ b/llvm/docs/ProgrammersManual.rst
@@ -135,7 +135,7 @@ rarely have to include this file directly).
return !L->contains(cast<Instruction>(V)->getParent());
}
- Note that you should **not** use an ``isa<>`` test followed by a ``cast<>``,
+ Note that you should **not** use an ``isa<>`` test followed by a ``cast<>``;
for that use the ``dyn_cast<>`` operator.
``dyn_cast<>``:
@@ -234,8 +234,8 @@ the ``str`` member function. See ``llvm/ADT/StringRef.h`` (`doxygen
<https://llvm.org/doxygen/StringRef_8h_source.html>`__) for more
information.
-You should rarely use the ``StringRef`` class directly, because it contains
-pointers to external memory it is not generally safe to store an instance of the
+You should rarely use the ``StringRef`` class directly. Because it contains
+pointers to external memory, it is not generally safe to store an instance of the
class (unless you know that the external storage will not be freed).
``StringRef`` is small and pervasive enough in LLVM that it should always be
passed by value.
@@ -416,14 +416,14 @@ to abort quickly at the point of failure (providing some basic diagnostic) when
invariants are broken at runtime.
The fundamental tools for handling programmatic errors are assertions and the
-llvm_unreachable function. Assertions are used to express invariant conditions,
+``llvm_unreachable`` function. Assertions are used to express invariant conditions,
and should include a message describing the invariant:
.. code-block:: c++
assert(isPhysReg(R) && "All virt regs should have been allocated already.");
-The llvm_unreachable function can be used to document areas of control flow
+The ``llvm_unreachable`` function can be used to document areas of control flow
that should never be entered if the program invariants hold:
.. code-block:: c++
@@ -598,7 +598,7 @@ semantics. For example:
}
This third form works with any type that can be assigned to from ``T&&``. This
-can be useful if the ``Expected<T>`` value needs to be stored an already-declared
+can be useful if the ``Expected<T>`` value needs to be stored in an already-declared
``std::optional<T>``. For example:
.. code-block:: c++
@@ -619,7 +619,7 @@ can be useful if the ``Expected<T>`` value needs to be stored an already-declare
All ``Error`` instances, whether success or failure, must be either checked or
moved from (via ``std::move`` or a return) before they are destructed.
-Accidentally discarding an unchecked error will cause a program abort at the
+Accidentally discarding an unchecked error will cause a program to abort at the
point where the unchecked value's destructor is run, making it easy to identify
and fix violations of this rule.
@@ -661,7 +661,7 @@ a variadic list of "handlers", each of which must be a callable type (a
function, lambda, or class with a call operator) with one argument. The
``handleErrors`` function will visit each handler in the sequence and check its
argument type against the dynamic type of the error, running the first handler
-that matches. This is the same decision process that is used decide which catch
+that matches. This is the same decision process that is used to decide which catch
clause to run for a C++ exception.
Since the list of handlers passed to ``handleErrors`` may not cover every error
@@ -869,10 +869,10 @@ T value:
}
Like the ExitOnError utility, cantFail simplifies control flow. Their treatment
-of error cases is very different however: Where ExitOnError is guaranteed to
+of error cases is very different, however: Where ExitOnError is guaranteed to
terminate the program on an error input, cantFail simply asserts that the result
is success. In debug builds this will result in an assertion failure if an error
-is encountered. In release builds the behavior of cantFail for failure values is
+is encountered. In release builds, the behavior of cantFail for failure values is
undefined. As such, care must be taken in the use of cantFail: clients must be
certain that a cantFail wrapped call really can not fail with the given
arguments.
@@ -928,7 +928,7 @@ well-formed Foo or an Error, never an object in an invalid state.
Propagating and consuming errors based on t...
[truncated]
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.