aboutsummaryrefslogtreecommitdiff
path: root/llvm/docs/TableGen
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/docs/TableGen')
-rw-r--r--llvm/docs/TableGen/BackEnds.rst50
-rw-r--r--llvm/docs/TableGen/BackGuide.rst24
2 files changed, 37 insertions, 37 deletions
diff --git a/llvm/docs/TableGen/BackEnds.rst b/llvm/docs/TableGen/BackEnds.rst
index 14232bc..7f57137 100644
--- a/llvm/docs/TableGen/BackEnds.rst
+++ b/llvm/docs/TableGen/BackEnds.rst
@@ -48,7 +48,7 @@ the TableGen files, the back-ends and their users.
For instance, a global contract is that each back-end produces macro-guarded
sections. Based on whether the file is included by a header or a source file,
or even in which context of each file the include is being used, you have
-todefine a macro just before including it, to get the right output:
+to define a macro just before including it, to get the right output:
.. code-block:: c++
@@ -80,8 +80,8 @@ in the TableGen files.
CodeEmitter
-----------
-**Purpose**: CodeEmitterGen uses the descriptions of instructions and their fields to
-construct an automated code emitter: a function that, given a MachineInstr,
+**Purpose**: ``CodeEmitterGen`` uses the descriptions of instructions and their fields to
+construct an automated code emitter: a function that, given a ``MachineInstr``,
returns the (currently, 32-bit unsigned) value of the instruction.
**Output**: C++ code, implementing the target's CodeEmitter
@@ -130,7 +130,7 @@ AsmMatcher
----------
**Purpose**: Emits a target specifier matcher for
-converting parsed assembly operands in the MCInst structures. It also
+converting parsed assembly operands in the ``MCInst`` structures. It also
emits a matcher for custom operand parsing. Extensive documentation is
written on the ``AsmMatcherEmitter.cpp`` file.
@@ -167,7 +167,7 @@ CallingConv
conventions supported by this target.
**Output**: Implement static functions to deal with calling conventions
-chained by matching styles, returning false on no match.
+chained by matching styles, returning ``false`` on no match.
**Usage**: Used in ISelLowering and FastIsel as function pointers to
implementation returned by a CC selection function.
@@ -200,7 +200,7 @@ FastISel
**Purpose**: This tablegen backend emits code for use by the "fast"
instruction selection algorithm. See the comments at the top of
-lib/CodeGen/SelectionDAG/FastISel.cpp for background. This file
+``lib/CodeGen/SelectionDAG/FastISel.cpp`` for background. This file
scans through the target's tablegen instruction-info files
and extracts instructions with obvious-looking patterns, and it emits
code to look up these instructions by type and operator.
@@ -270,23 +270,23 @@ This file is included as part of ``Attr.h``.
ClangAttrParserStringSwitches
-----------------------------
-**Purpose**: Creates AttrParserStringSwitches.inc, which contains
-StringSwitch::Case statements for parser-related string switches. Each switch
+**Purpose**: Creates ``AttrParserStringSwitches.inc``, which contains
+``StringSwitch::Case`` statements for parser-related string switches. Each switch
is given its own macro (such as ``CLANG_ATTR_ARG_CONTEXT_LIST``, or
``CLANG_ATTR_IDENTIFIER_ARG_LIST``), which is expected to be defined before
-including AttrParserStringSwitches.inc, and undefined after.
+including ``AttrParserStringSwitches.inc``, and undefined after.
ClangAttrImpl
-------------
-**Purpose**: Creates AttrImpl.inc, which contains semantic attribute class
+**Purpose**: Creates ``AttrImpl.inc``, which contains semantic attribute class
definitions for any attribute in ``Attr.td`` that has not set ``ASTNode = 0``.
This file is included as part of ``AttrImpl.cpp``.
ClangAttrList
-------------
-**Purpose**: Creates AttrList.inc, which is used when a list of semantic
+**Purpose**: Creates ``AttrList.inc``, which is used when a list of semantic
attribute identifiers is required. For instance, ``AttrKinds.h`` includes this
file to generate the list of ``attr::Kind`` enumeration values. This list is
separated out into multiple categories: attributes, inheritable attributes, and
@@ -297,25 +297,25 @@ functionality required for ``dyn_cast`` and similar APIs.
ClangAttrPCHRead
----------------
-**Purpose**: Creates AttrPCHRead.inc, which is used to deserialize attributes
+**Purpose**: Creates ``AttrPCHRead.inc``, which is used to deserialize attributes
in the ``ASTReader::ReadAttributes`` function.
ClangAttrPCHWrite
-----------------
-**Purpose**: Creates AttrPCHWrite.inc, which is used to serialize attributes in
+**Purpose**: Creates ``AttrPCHWrite.inc``, which is used to serialize attributes in
the ``ASTWriter::WriteAttributes`` function.
ClangAttrSpellings
---------------------
-**Purpose**: Creates AttrSpellings.inc, which is used to implement the
+**Purpose**: Creates ``AttrSpellings.inc``, which is used to implement the
``__has_attribute`` feature test macro.
ClangAttrSpellingListIndex
--------------------------
-**Purpose**: Creates AttrSpellingListIndex.inc, which is used to map parsed
+**Purpose**: Creates ``AttrSpellingListIndex.inc``, which is used to map parsed
attribute spellings (including which syntax or scope was used) to an attribute
spelling list index. These spelling list index values are internal
implementation details exposed via
@@ -324,26 +324,26 @@ implementation details exposed via
ClangAttrVisitor
-------------------
-**Purpose**: Creates AttrVisitor.inc, which is used when implementing
+**Purpose**: Creates ``AttrVisitor.inc``, which is used when implementing
recursive AST visitors.
ClangAttrTemplateInstantiate
----------------------------
-**Purpose**: Creates AttrTemplateInstantiate.inc, which implements the
+**Purpose**: Creates ``AttrTemplateInstantiate.inc``, which implements the
``instantiateTemplateAttribute`` function, used when instantiating a template
that requires an attribute to be cloned.
ClangAttrParsedAttrList
-----------------------
-**Purpose**: Creates AttrParsedAttrList.inc, which is used to generate the
+**Purpose**: Creates ``AttrParsedAttrList.inc``, which is used to generate the
``AttributeList::Kind`` parsed attribute enumeration.
ClangAttrParsedAttrImpl
-----------------------
-**Purpose**: Creates AttrParsedAttrImpl.inc, which is used by
+**Purpose**: Creates ``AttrParsedAttrImpl.inc``, which is used by
``AttributeList.cpp`` to implement several functions on the ``AttributeList``
class. This functionality is implemented via the ``AttrInfoMap ParsedAttrInfo``
array, which contains one element per parsed attribute object.
@@ -351,14 +351,14 @@ array, which contains one element per parsed attribute object.
ClangAttrParsedAttrKinds
------------------------
-**Purpose**: Creates AttrParsedAttrKinds.inc, which is used to implement the
+**Purpose**: Creates ``AttrParsedAttrKinds.inc``, which is used to implement the
``AttributeList::getKind`` function, mapping a string (and syntax) to a parsed
attribute ``AttributeList::Kind`` enumeration.
ClangAttrDump
-------------
-**Purpose**: Creates AttrDump.inc, which dumps information about an attribute.
+**Purpose**: Creates ``AttrDump.inc``, which dumps information about an attribute.
It is used to implement ``ASTDumper::dumpAttr``.
ClangDiagsDefs
@@ -424,7 +424,7 @@ Generate list of commands that are used in documentation comments.
ArmNeon
-------
-Generate arm_neon.h for clang.
+Generate ``arm_neon.h`` for clang.
ArmNeonSema
-----------
@@ -473,7 +473,7 @@ to a built-in backend.
**Output**:
-The root of the output file is a JSON object (i.e. dictionary),
+The root of the output file is a JSON object (i.e., dictionary),
containing the following fixed keys:
* ``!tablegen_json_version``: a numeric version field that will
@@ -520,7 +520,7 @@ conventions described below.
Some TableGen data types are translated directly into the
corresponding JSON type:
-* A completely undefined value (e.g. for a variable declared without
+* A completely undefined value (e.g., for a variable declared without
initializer in some superclass of this record, and never initialized
by the record itself or any other superclass) is emitted as the JSON
``null`` value.
@@ -964,7 +964,7 @@ Here is the modified lookup function.
The new lookup function will return an iterator range with first pointer to the
first result and the last pointer to the last matching result from the table.
-However, please note that the support for emitting modified definition exists
+However, please note that the support for emitting a modified definition exists
for ``PrimaryKeyName`` only.
The ``PrimaryKeyEarlyOut`` field, when set to 1, modifies the lookup
diff --git a/llvm/docs/TableGen/BackGuide.rst b/llvm/docs/TableGen/BackGuide.rst
index 83f8f470..7883d7c 100644
--- a/llvm/docs/TableGen/BackGuide.rst
+++ b/llvm/docs/TableGen/BackGuide.rst
@@ -17,7 +17,7 @@ information is coded in a declarative style involving classes and records,
which are then processed by TableGen. The internalized records are passed on
to various backends, which extract information from a subset of the records
and generate an output file. These output files are typically ``.inc`` files
-for C++, but may be any type of file that the backend developer needs.
+for C++, but they may be any type of file that the backend developer needs.
This document is a guide to writing a backend for TableGen. It is not a
complete reference manual, but rather a guide to using the facilities
@@ -114,7 +114,7 @@ The ``Record`` class provides many useful functions.
superclasses.
* Functions to get a particular field value by specifying its name in various
- forms, and returning its value in various forms
+ forms and returning its value in various forms
(see `Getting Record Names and Fields`_).
* Boolean functions to check the various attributes of the record.
@@ -301,7 +301,7 @@ The ``BitInit`` class is a subclass of ``TypedInit``. Its instances
represent the possible values of a bit: 0 or 1. It includes a data member
that contains the bit.
-*All* of the classes derived from ``TypedInit`` provide the following functions.
+*All* of the classes derived from ``TypedInit`` provide the following functions:
* A static function named ``get()`` that returns an ``Init`` representing
the specified value(s). In the case of ``BitInit``, ``get(true)`` returns
@@ -334,7 +334,7 @@ The class provides the following additional functions.
~~~~~~~~~~~
The ``DagInit`` class is a subclass of ``TypedInit``. Its instances
-represent the possible direct acyclic graphs (``dag``).
+represent the possible directed acyclic graphs (``dag``).
The class includes a pointer to an ``Init`` for the DAG operator and a
pointer to a ``StringInit`` for the operator name. It includes the count of
@@ -357,7 +357,7 @@ The class provides many additional functions:
* Functions to get the operands, both individually and together.
* Functions to determine whether there are any names and to
- get the number of names
+ get the number of names.
* Functions to get the names, both individually and together.
@@ -410,7 +410,7 @@ The class provides the usual ``get()`` and ``getValues()`` functions. The
latter function returns an ``ArrayRef`` of the vector of pointers to ``Init``
instances.
-The class provides these additional functions.
+The class provides these additional functions:
* A function to get the element type.
@@ -461,7 +461,7 @@ The Backend Skeleton
====================
The file ``TableGenBackendSkeleton.cpp`` provides a skeleton C++ translation
-unit for writing a new TableGen backend. Here are a few notes on the file.
+unit for writing a new TableGen backend. Here are a few notes on the file:
* The list of includes is the minimal list required by most backends.
@@ -484,7 +484,7 @@ unit for writing a new TableGen backend. Here are a few notes on the file.
* The ``run`` function should use the ``emitSourceFileHeader`` helper function
to include a standard header in the emitted file.
-* Register the class or the function as the command line option
+* Register the class or the function as the command-line option
with ``llvm/TableGen/TableGenBackend.h``.
* Use ``llvm::TableGen::Emitter::OptClass<AddressModesEmitter>``
@@ -516,7 +516,7 @@ If you need to iterate over all the class records:
...
}
-``ClassPair.second`` gets the class's ``unique_ptr``, then ``.get()`` gets the
+``ClassPair.second`` gets the class's ``unique_ptr``, and then ``.get()`` gets the
class ``Record`` itself.
@@ -612,7 +612,7 @@ Getting Record Superclasses
The ``Record`` class provides a function to obtain the direct superclasses
of a record. It is named ``getDirectSuperClasses`` and returns an
-``ArrayRef`` of an array of ``std::pair`` pairs. Each pair consists of a
+``ArrayRef`` of an array of ``std::pair`` instances. Each pair consists of a
pointer to the ``Record`` instance for a superclass record and an instance
of the ``SMRange`` class. The range indicates the source file locations of
the beginning and end of the class definition.
@@ -630,7 +630,7 @@ then iterates over the pairs in the returned array.
The ``Record`` class also provides a function, ``getSuperClasses``, to
return a vector of *all* superclasses of a record. The superclasses are in
-post-order: the order in which the superclasses were visited while copying
+postorder: the order in which the superclasses were visited while copying
their fields into the record.
Emitting Text to the Output Stream
@@ -752,7 +752,7 @@ The ``PrintDetailedRecords`` Backend
The TableGen command option ``--print-detailed-records`` invokes a backend
that prints all the global variables, classes, and records defined in the
source files. The format of the output is *not* guaranteed to be constant
-over time. The output looks like this.
+over time. The output looks like this:
.. code-block:: text