Skip to content

Commit a30f9ab

Browse files
kazutakahirataaokblast
authored andcommitted
[llvm] Proofread TableGen/index.rst (llvm#164756)
1 parent 5c77aa0 commit a30f9ab

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

llvm/docs/TableGen/index.rst

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ domain-specific information. Because there may be a large number of these
2020
records, it is specifically designed to allow writing flexible descriptions and
2121
for common features of these records to be factored out. This reduces the
2222
amount of duplication in the description, reduces the chance of error, and makes
23-
it easier to structure domain specific information.
23+
it easier to structure domain-specific information.
2424

2525
The TableGen front end parses a file, instantiates the declarations, and
2626
hands the result off to a domain-specific `backend`_ for processing. See
@@ -44,8 +44,8 @@ distribution, respectively.
4444
The TableGen program
4545
====================
4646

47-
TableGen files are interpreted by the TableGen program: `llvm-tblgen` available
48-
on your build directory under `bin`. It is not installed in the system (or where
47+
TableGen files are interpreted by the TableGen program: ``llvm-tblgen`` available
48+
in your build directory under ``bin``. It is not installed in the system (or where
4949
your sysroot is set to), since it has no use beyond LLVM's build process.
5050

5151
Running TableGen
@@ -86,7 +86,7 @@ the `-dump-json` option.
8686

8787
If you plan to use TableGen, you will most likely have to write a `backend`_
8888
that extracts the information specific to what you need and formats it in the
89-
appropriate way. You can do this by extending TableGen itself in C++, or by
89+
appropriate way. You can do this by extending TableGen itself in C++ or by
9090
writing a script in any language that can consume the JSON output.
9191

9292
Example
@@ -152,7 +152,7 @@ of the x86 architecture. ``def ADD32rr`` defines a record named
152152
``ADD32rr``, and the comment at the end of the line indicates the superclasses
153153
of the definition. The body of the record contains all of the data that
154154
TableGen assembled for the record, indicating that the instruction is part of
155-
the "X86" namespace, the pattern indicating how the instruction is selected by
155+
the ``X86`` namespace, the pattern indicating how the instruction is selected by
156156
the code generator, that it is a two-address instruction, has a particular
157157
encoding, etc. The contents and semantics of the information in the record are
158158
specific to the needs of the X86 backend, and are only shown as an example.
@@ -175,13 +175,13 @@ TableGen, all of the information was derived from the following definition:
175175
This definition makes use of the custom class ``I`` (extended from the custom
176176
class ``X86Inst``), which is defined in the X86-specific TableGen file, to
177177
factor out the common features that instructions of its class share. A key
178-
feature of TableGen is that it allows the end-user to define the abstractions
178+
feature of TableGen is that it allows the end user to define the abstractions
179179
they prefer to use when describing their information.
180180

181181
Syntax
182182
======
183183

184-
TableGen has a syntax that is loosely based on C++ templates, with built-in
184+
TableGen has a syntax loosely based on C++ templates, with built-in
185185
types and specification. In addition, TableGen's syntax introduces some
186186
automation concepts like multiclass, foreach, let, etc.
187187

@@ -193,41 +193,41 @@ which are considered 'records'.
193193

194194
**TableGen records** have a unique name, a list of values, and a list of
195195
superclasses. The list of values is the main data that TableGen builds for each
196-
record; it is this that holds the domain specific information for the
196+
record; it is this that holds the domain-specific information for the
197197
application. The interpretation of this data is left to a specific `backend`_,
198-
but the structure and format rules are taken care of and are fixed by
198+
but the structure and format rules are taken care of and fixed by
199199
TableGen.
200200

201201
**TableGen definitions** are the concrete form of 'records'. These generally do
202-
not have any undefined values, and are marked with the '``def``' keyword.
202+
not have any undefined values and are marked with the '``def``' keyword.
203203

204204
.. code-block:: text
205205
206206
def FeatureFPARMv8 : SubtargetFeature<"fp-armv8", "HasFPARMv8", "true",
207207
"Enable ARMv8 FP">;
208208
209-
In this example, FeatureFPARMv8 is ``SubtargetFeature`` record initialised
209+
In this example, ``FeatureFPARMv8`` is ``SubtargetFeature`` record initialised
210210
with some values. The names of the classes are defined via the
211-
keyword `class` either on the same file or some other included. Most target
211+
keyword `class` either in the same file or some other included. Most target
212212
TableGen files include the generic ones in ``include/llvm/Target``.
213213

214214
**TableGen classes** are abstract records that are used to build and describe
215215
other records. These classes allow the end-user to build abstractions for
216-
either the domain they are targeting (such as "Register", "RegisterClass", and
217-
"Instruction" in the LLVM code generator) or for the implementor to help factor
218-
out common properties of records (such as "FPInst", which is used to represent
216+
either the domain they are targeting (such as ``Register``, ``RegisterClass``, and
217+
``Instruction`` in the LLVM code generator) or for the implementor to help factor
218+
out common properties of records (such as ``FPInst``, which is used to represent
219219
floating point instructions in the X86 backend). TableGen keeps track of all of
220220
the classes that are used to build up a definition, so the backend can find all
221-
definitions of a particular class, such as "Instruction".
221+
definitions of a particular class, such as ``Instruction``.
222222

223223
.. code-block:: text
224224
225225
class ProcNoItin<string Name, list<SubtargetFeature> Features>
226226
: Processor<Name, NoItineraries, Features>;
227227
228-
Here, the class ProcNoItin, receiving parameters `Name` of type `string` and
229-
a list of target features is specializing the class Processor by passing the
230-
arguments down as well as hard-coding NoItineraries.
228+
Here, the class ``ProcNoItin``, receiving parameters ``Name`` of type ``string`` and
229+
a list of target features is specializing the class ``Processor`` by passing the
230+
arguments down as well as hard-coding ``NoItineraries``.
231231

232232
**TableGen multiclasses** are groups of abstract records that are instantiated
233233
all at once. Each instantiation can result in multiple TableGen definitions.
@@ -295,8 +295,8 @@ TableGen Deficiencies
295295

296296
Despite being very generic, TableGen has some deficiencies that have been
297297
pointed out numerous times. The common theme is that, while TableGen allows
298-
you to build domain specific languages, the final languages that you create
299-
lack the power of other DSLs, which in turn increase considerably the size
298+
you to build domain-specific languages, the final languages that you create
299+
lack the power of other DSLs, which in turn considerably increases the size
300300
and complexity of TableGen files.
301301

302302
At the same time, TableGen allows you to create virtually any meaning of
@@ -305,6 +305,6 @@ design and make it very hard for newcomers to understand the evil TableGen
305305
file.
306306

307307
There are some in favor of extending the semantics even more, but making sure
308-
backends adhere to strict rules. Others are suggesting we should move to less,
308+
backends adhere to strict rules. Others suggest moving to fewer,
309309
more powerful DSLs designed with specific purposes, or even reusing existing
310310
DSLs.

0 commit comments

Comments
 (0)