xref: /aosp_15_r20/external/llvm/docs/TableGen/BackEnds.rst (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker=================
2*9880d681SAndroid Build Coastguard WorkerTableGen BackEnds
3*9880d681SAndroid Build Coastguard Worker=================
4*9880d681SAndroid Build Coastguard Worker
5*9880d681SAndroid Build Coastguard Worker.. contents::
6*9880d681SAndroid Build Coastguard Worker   :local:
7*9880d681SAndroid Build Coastguard Worker
8*9880d681SAndroid Build Coastguard WorkerIntroduction
9*9880d681SAndroid Build Coastguard Worker============
10*9880d681SAndroid Build Coastguard Worker
11*9880d681SAndroid Build Coastguard WorkerTableGen backends are at the core of TableGen's functionality. The source files
12*9880d681SAndroid Build Coastguard Workerprovide the semantics to a generated (in memory) structure, but it's up to the
13*9880d681SAndroid Build Coastguard Workerbackend to print this out in a way that is meaningful to the user (normally a
14*9880d681SAndroid Build Coastguard WorkerC program including a file or a textual list of warnings, options and error
15*9880d681SAndroid Build Coastguard Workermessages).
16*9880d681SAndroid Build Coastguard Worker
17*9880d681SAndroid Build Coastguard WorkerTableGen is used by both LLVM and Clang with very different goals. LLVM uses it
18*9880d681SAndroid Build Coastguard Workeras a way to automate the generation of massive amounts of information regarding
19*9880d681SAndroid Build Coastguard Workerinstructions, schedules, cores and architecture features. Some backends generate
20*9880d681SAndroid Build Coastguard Workeroutput that is consumed by more than one source file, so they need to be created
21*9880d681SAndroid Build Coastguard Workerin a way that is easy to use pre-processor tricks. Some backends can also print
22*9880d681SAndroid Build Coastguard WorkerC code structures, so that they can be directly included as-is.
23*9880d681SAndroid Build Coastguard Worker
24*9880d681SAndroid Build Coastguard WorkerClang, on the other hand, uses it mainly for diagnostic messages (errors,
25*9880d681SAndroid Build Coastguard Workerwarnings, tips) and attributes, so more on the textual end of the scale.
26*9880d681SAndroid Build Coastguard Worker
27*9880d681SAndroid Build Coastguard WorkerLLVM BackEnds
28*9880d681SAndroid Build Coastguard Worker=============
29*9880d681SAndroid Build Coastguard Worker
30*9880d681SAndroid Build Coastguard Worker.. warning::
31*9880d681SAndroid Build Coastguard Worker   This document is raw. Each section below needs three sub-sections: description
32*9880d681SAndroid Build Coastguard Worker   of its purpose with a list of users, output generated from generic input, and
33*9880d681SAndroid Build Coastguard Worker   finally why it needed a new backend (in case there's something similar).
34*9880d681SAndroid Build Coastguard Worker
35*9880d681SAndroid Build Coastguard WorkerOverall, each backend will take the same TableGen file type and transform into
36*9880d681SAndroid Build Coastguard Workersimilar output for different targets/uses. There is an implicit contract between
37*9880d681SAndroid Build Coastguard Workerthe TableGen files, the back-ends and their users.
38*9880d681SAndroid Build Coastguard Worker
39*9880d681SAndroid Build Coastguard WorkerFor instance, a global contract is that each back-end produces macro-guarded
40*9880d681SAndroid Build Coastguard Workersections. Based on whether the file is included by a header or a source file,
41*9880d681SAndroid Build Coastguard Workeror even in which context of each file the include is being used, you have
42*9880d681SAndroid Build Coastguard Workertodefine a macro just before including it, to get the right output:
43*9880d681SAndroid Build Coastguard Worker
44*9880d681SAndroid Build Coastguard Worker.. code-block:: c++
45*9880d681SAndroid Build Coastguard Worker
46*9880d681SAndroid Build Coastguard Worker  #define GET_REGINFO_TARGET_DESC
47*9880d681SAndroid Build Coastguard Worker  #include "ARMGenRegisterInfo.inc"
48*9880d681SAndroid Build Coastguard Worker
49*9880d681SAndroid Build Coastguard WorkerAnd just part of the generated file would be included. This is useful if
50*9880d681SAndroid Build Coastguard Workeryou need the same information in multiple formats (instantiation, initialization,
51*9880d681SAndroid Build Coastguard Workergetter/setter functions, etc) from the same source TableGen file without having
52*9880d681SAndroid Build Coastguard Workerto re-compile the TableGen file multiple times.
53*9880d681SAndroid Build Coastguard Worker
54*9880d681SAndroid Build Coastguard WorkerSometimes, multiple macros might be defined before the same include file to
55*9880d681SAndroid Build Coastguard Workeroutput multiple blocks:
56*9880d681SAndroid Build Coastguard Worker
57*9880d681SAndroid Build Coastguard Worker.. code-block:: c++
58*9880d681SAndroid Build Coastguard Worker
59*9880d681SAndroid Build Coastguard Worker  #define GET_REGISTER_MATCHER
60*9880d681SAndroid Build Coastguard Worker  #define GET_SUBTARGET_FEATURE_NAME
61*9880d681SAndroid Build Coastguard Worker  #define GET_MATCHER_IMPLEMENTATION
62*9880d681SAndroid Build Coastguard Worker  #include "ARMGenAsmMatcher.inc"
63*9880d681SAndroid Build Coastguard Worker
64*9880d681SAndroid Build Coastguard WorkerThe macros will be undef'd automatically as they're used, in the include file.
65*9880d681SAndroid Build Coastguard Worker
66*9880d681SAndroid Build Coastguard WorkerOn all LLVM back-ends, the ``llvm-tblgen`` binary will be executed on the root
67*9880d681SAndroid Build Coastguard WorkerTableGen file ``<Target>.td``, which should include all others. This guarantees
68*9880d681SAndroid Build Coastguard Workerthat all information needed is accessible, and that no duplication is needed
69*9880d681SAndroid Build Coastguard Workerin the TbleGen files.
70*9880d681SAndroid Build Coastguard Worker
71*9880d681SAndroid Build Coastguard WorkerCodeEmitter
72*9880d681SAndroid Build Coastguard Worker-----------
73*9880d681SAndroid Build Coastguard Worker
74*9880d681SAndroid Build Coastguard Worker**Purpose**: CodeEmitterGen uses the descriptions of instructions and their fields to
75*9880d681SAndroid Build Coastguard Workerconstruct an automated code emitter: a function that, given a MachineInstr,
76*9880d681SAndroid Build Coastguard Workerreturns the (currently, 32-bit unsigned) value of the instruction.
77*9880d681SAndroid Build Coastguard Worker
78*9880d681SAndroid Build Coastguard Worker**Output**: C++ code, implementing the target's CodeEmitter
79*9880d681SAndroid Build Coastguard Workerclass by overriding the virtual functions as ``<Target>CodeEmitter::function()``.
80*9880d681SAndroid Build Coastguard Worker
81*9880d681SAndroid Build Coastguard Worker**Usage**: Used to include directly at the end of ``<Target>MCCodeEmitter.cpp``.
82*9880d681SAndroid Build Coastguard Worker
83*9880d681SAndroid Build Coastguard WorkerRegisterInfo
84*9880d681SAndroid Build Coastguard Worker------------
85*9880d681SAndroid Build Coastguard Worker
86*9880d681SAndroid Build Coastguard Worker**Purpose**: This tablegen backend is responsible for emitting a description of a target
87*9880d681SAndroid Build Coastguard Workerregister file for a code generator.  It uses instances of the Register,
88*9880d681SAndroid Build Coastguard WorkerRegisterAliases, and RegisterClass classes to gather this information.
89*9880d681SAndroid Build Coastguard Worker
90*9880d681SAndroid Build Coastguard Worker**Output**: C++ code with enums and structures representing the register mappings,
91*9880d681SAndroid Build Coastguard Workerproperties, masks, etc.
92*9880d681SAndroid Build Coastguard Worker
93*9880d681SAndroid Build Coastguard Worker**Usage**: Both on ``<Target>BaseRegisterInfo`` and ``<Target>MCTargetDesc`` (headers
94*9880d681SAndroid Build Coastguard Workerand source files) with macros defining in which they are for declaration vs.
95*9880d681SAndroid Build Coastguard Workerinitialization issues.
96*9880d681SAndroid Build Coastguard Worker
97*9880d681SAndroid Build Coastguard WorkerInstrInfo
98*9880d681SAndroid Build Coastguard Worker---------
99*9880d681SAndroid Build Coastguard Worker
100*9880d681SAndroid Build Coastguard Worker**Purpose**: This tablegen backend is responsible for emitting a description of the target
101*9880d681SAndroid Build Coastguard Workerinstruction set for the code generator. (what are the differences from CodeEmitter?)
102*9880d681SAndroid Build Coastguard Worker
103*9880d681SAndroid Build Coastguard Worker**Output**: C++ code with enums and structures representing the register mappings,
104*9880d681SAndroid Build Coastguard Workerproperties, masks, etc.
105*9880d681SAndroid Build Coastguard Worker
106*9880d681SAndroid Build Coastguard Worker**Usage**: Both on ``<Target>BaseInstrInfo`` and ``<Target>MCTargetDesc`` (headers
107*9880d681SAndroid Build Coastguard Workerand source files) with macros defining in which they are for declaration vs.
108*9880d681SAndroid Build Coastguard Worker
109*9880d681SAndroid Build Coastguard WorkerAsmWriter
110*9880d681SAndroid Build Coastguard Worker---------
111*9880d681SAndroid Build Coastguard Worker
112*9880d681SAndroid Build Coastguard Worker**Purpose**: Emits an assembly printer for the current target.
113*9880d681SAndroid Build Coastguard Worker
114*9880d681SAndroid Build Coastguard Worker**Output**: Implementation of ``<Target>InstPrinter::printInstruction()``, among
115*9880d681SAndroid Build Coastguard Workerother things.
116*9880d681SAndroid Build Coastguard Worker
117*9880d681SAndroid Build Coastguard Worker**Usage**: Included directly into ``InstPrinter/<Target>InstPrinter.cpp``.
118*9880d681SAndroid Build Coastguard Worker
119*9880d681SAndroid Build Coastguard WorkerAsmMatcher
120*9880d681SAndroid Build Coastguard Worker----------
121*9880d681SAndroid Build Coastguard Worker
122*9880d681SAndroid Build Coastguard Worker**Purpose**: Emits a target specifier matcher for
123*9880d681SAndroid Build Coastguard Workerconverting parsed assembly operands in the MCInst structures. It also
124*9880d681SAndroid Build Coastguard Workeremits a matcher for custom operand parsing. Extensive documentation is
125*9880d681SAndroid Build Coastguard Workerwritten on the ``AsmMatcherEmitter.cpp`` file.
126*9880d681SAndroid Build Coastguard Worker
127*9880d681SAndroid Build Coastguard Worker**Output**: Assembler parsers' matcher functions, declarations, etc.
128*9880d681SAndroid Build Coastguard Worker
129*9880d681SAndroid Build Coastguard Worker**Usage**: Used in back-ends' ``AsmParser/<Target>AsmParser.cpp`` for
130*9880d681SAndroid Build Coastguard Workerbuilding the AsmParser class.
131*9880d681SAndroid Build Coastguard Worker
132*9880d681SAndroid Build Coastguard WorkerDisassembler
133*9880d681SAndroid Build Coastguard Worker------------
134*9880d681SAndroid Build Coastguard Worker
135*9880d681SAndroid Build Coastguard Worker**Purpose**: Contains disassembler table emitters for various
136*9880d681SAndroid Build Coastguard Workerarchitectures. Extensive documentation is written on the
137*9880d681SAndroid Build Coastguard Worker``DisassemblerEmitter.cpp`` file.
138*9880d681SAndroid Build Coastguard Worker
139*9880d681SAndroid Build Coastguard Worker**Output**: Decoding tables, static decoding functions, etc.
140*9880d681SAndroid Build Coastguard Worker
141*9880d681SAndroid Build Coastguard Worker**Usage**: Directly included in ``Disassembler/<Target>Disassembler.cpp``
142*9880d681SAndroid Build Coastguard Workerto cater for all default decodings, after all hand-made ones.
143*9880d681SAndroid Build Coastguard Worker
144*9880d681SAndroid Build Coastguard WorkerPseudoLowering
145*9880d681SAndroid Build Coastguard Worker--------------
146*9880d681SAndroid Build Coastguard Worker
147*9880d681SAndroid Build Coastguard Worker**Purpose**: Generate pseudo instruction lowering.
148*9880d681SAndroid Build Coastguard Worker
149*9880d681SAndroid Build Coastguard Worker**Output**: Implements ``ARMAsmPrinter::emitPseudoExpansionLowering()``.
150*9880d681SAndroid Build Coastguard Worker
151*9880d681SAndroid Build Coastguard Worker**Usage**: Included directly into ``<Target>AsmPrinter.cpp``.
152*9880d681SAndroid Build Coastguard Worker
153*9880d681SAndroid Build Coastguard WorkerCallingConv
154*9880d681SAndroid Build Coastguard Worker-----------
155*9880d681SAndroid Build Coastguard Worker
156*9880d681SAndroid Build Coastguard Worker**Purpose**: Responsible for emitting descriptions of the calling
157*9880d681SAndroid Build Coastguard Workerconventions supported by this target.
158*9880d681SAndroid Build Coastguard Worker
159*9880d681SAndroid Build Coastguard Worker**Output**: Implement static functions to deal with calling conventions
160*9880d681SAndroid Build Coastguard Workerchained by matching styles, returning false on no match.
161*9880d681SAndroid Build Coastguard Worker
162*9880d681SAndroid Build Coastguard Worker**Usage**: Used in ISelLowering and FastIsel as function pointers to
163*9880d681SAndroid Build Coastguard Workerimplementation returned by a CC sellection function.
164*9880d681SAndroid Build Coastguard Worker
165*9880d681SAndroid Build Coastguard WorkerDAGISel
166*9880d681SAndroid Build Coastguard Worker-------
167*9880d681SAndroid Build Coastguard Worker
168*9880d681SAndroid Build Coastguard Worker**Purpose**: Generate a DAG instruction selector.
169*9880d681SAndroid Build Coastguard Worker
170*9880d681SAndroid Build Coastguard Worker**Output**: Creates huge functions for automating DAG selection.
171*9880d681SAndroid Build Coastguard Worker
172*9880d681SAndroid Build Coastguard Worker**Usage**: Included in ``<Target>ISelDAGToDAG.cpp`` inside the target's
173*9880d681SAndroid Build Coastguard Workerimplementation of ``SelectionDAGISel``.
174*9880d681SAndroid Build Coastguard Worker
175*9880d681SAndroid Build Coastguard WorkerDFAPacketizer
176*9880d681SAndroid Build Coastguard Worker-------------
177*9880d681SAndroid Build Coastguard Worker
178*9880d681SAndroid Build Coastguard Worker**Purpose**: This class parses the Schedule.td file and produces an API that
179*9880d681SAndroid Build Coastguard Workercan be used to reason about whether an instruction can be added to a packet
180*9880d681SAndroid Build Coastguard Workeron a VLIW architecture. The class internally generates a deterministic finite
181*9880d681SAndroid Build Coastguard Workerautomaton (DFA) that models all possible mappings of machine instructions
182*9880d681SAndroid Build Coastguard Workerto functional units as instructions are added to a packet.
183*9880d681SAndroid Build Coastguard Worker
184*9880d681SAndroid Build Coastguard Worker**Output**: Scheduling tables for GPU back-ends (Hexagon, AMD).
185*9880d681SAndroid Build Coastguard Worker
186*9880d681SAndroid Build Coastguard Worker**Usage**: Included directly on ``<Target>InstrInfo.cpp``.
187*9880d681SAndroid Build Coastguard Worker
188*9880d681SAndroid Build Coastguard WorkerFastISel
189*9880d681SAndroid Build Coastguard Worker--------
190*9880d681SAndroid Build Coastguard Worker
191*9880d681SAndroid Build Coastguard Worker**Purpose**: This tablegen backend emits code for use by the "fast"
192*9880d681SAndroid Build Coastguard Workerinstruction selection algorithm. See the comments at the top of
193*9880d681SAndroid Build Coastguard Workerlib/CodeGen/SelectionDAG/FastISel.cpp for background. This file
194*9880d681SAndroid Build Coastguard Workerscans through the target's tablegen instruction-info files
195*9880d681SAndroid Build Coastguard Workerand extracts instructions with obvious-looking patterns, and it emits
196*9880d681SAndroid Build Coastguard Workercode to look up these instructions by type and operator.
197*9880d681SAndroid Build Coastguard Worker
198*9880d681SAndroid Build Coastguard Worker**Output**: Generates ``Predicate`` and ``FastEmit`` methods.
199*9880d681SAndroid Build Coastguard Worker
200*9880d681SAndroid Build Coastguard Worker**Usage**: Implements private methods of the targets' implementation
201*9880d681SAndroid Build Coastguard Workerof ``FastISel`` class.
202*9880d681SAndroid Build Coastguard Worker
203*9880d681SAndroid Build Coastguard WorkerSubtarget
204*9880d681SAndroid Build Coastguard Worker---------
205*9880d681SAndroid Build Coastguard Worker
206*9880d681SAndroid Build Coastguard Worker**Purpose**: Generate subtarget enumerations.
207*9880d681SAndroid Build Coastguard Worker
208*9880d681SAndroid Build Coastguard Worker**Output**: Enums, globals, local tables for sub-target information.
209*9880d681SAndroid Build Coastguard Worker
210*9880d681SAndroid Build Coastguard Worker**Usage**: Populates ``<Target>Subtarget`` and
211*9880d681SAndroid Build Coastguard Worker``MCTargetDesc/<Target>MCTargetDesc`` files (both headers and source).
212*9880d681SAndroid Build Coastguard Worker
213*9880d681SAndroid Build Coastguard WorkerIntrinsic
214*9880d681SAndroid Build Coastguard Worker---------
215*9880d681SAndroid Build Coastguard Worker
216*9880d681SAndroid Build Coastguard Worker**Purpose**: Generate (target) intrinsic information.
217*9880d681SAndroid Build Coastguard Worker
218*9880d681SAndroid Build Coastguard WorkerOptParserDefs
219*9880d681SAndroid Build Coastguard Worker-------------
220*9880d681SAndroid Build Coastguard Worker
221*9880d681SAndroid Build Coastguard Worker**Purpose**: Print enum values for a class.
222*9880d681SAndroid Build Coastguard Worker
223*9880d681SAndroid Build Coastguard WorkerCTags
224*9880d681SAndroid Build Coastguard Worker-----
225*9880d681SAndroid Build Coastguard Worker
226*9880d681SAndroid Build Coastguard Worker**Purpose**: This tablegen backend emits an index of definitions in ctags(1)
227*9880d681SAndroid Build Coastguard Workerformat. A helper script, utils/TableGen/tdtags, provides an easier-to-use
228*9880d681SAndroid Build Coastguard Workerinterface; run 'tdtags -H' for documentation.
229*9880d681SAndroid Build Coastguard Worker
230*9880d681SAndroid Build Coastguard WorkerClang BackEnds
231*9880d681SAndroid Build Coastguard Worker==============
232*9880d681SAndroid Build Coastguard Worker
233*9880d681SAndroid Build Coastguard WorkerClangAttrClasses
234*9880d681SAndroid Build Coastguard Worker----------------
235*9880d681SAndroid Build Coastguard Worker
236*9880d681SAndroid Build Coastguard Worker**Purpose**: Creates Attrs.inc, which contains semantic attribute class
237*9880d681SAndroid Build Coastguard Workerdeclarations for any attribute in ``Attr.td`` that has not set ``ASTNode = 0``.
238*9880d681SAndroid Build Coastguard WorkerThis file is included as part of ``Attr.h``.
239*9880d681SAndroid Build Coastguard Worker
240*9880d681SAndroid Build Coastguard WorkerClangAttrParserStringSwitches
241*9880d681SAndroid Build Coastguard Worker-----------------------------
242*9880d681SAndroid Build Coastguard Worker
243*9880d681SAndroid Build Coastguard Worker**Purpose**: Creates AttrParserStringSwitches.inc, which contains
244*9880d681SAndroid Build Coastguard WorkerStringSwitch::Case statements for parser-related string switches. Each switch
245*9880d681SAndroid Build Coastguard Workeris given its own macro (such as ``CLANG_ATTR_ARG_CONTEXT_LIST``, or
246*9880d681SAndroid Build Coastguard Worker``CLANG_ATTR_IDENTIFIER_ARG_LIST``), which is expected to be defined before
247*9880d681SAndroid Build Coastguard Workerincluding AttrParserStringSwitches.inc, and undefined after.
248*9880d681SAndroid Build Coastguard Worker
249*9880d681SAndroid Build Coastguard WorkerClangAttrImpl
250*9880d681SAndroid Build Coastguard Worker-------------
251*9880d681SAndroid Build Coastguard Worker
252*9880d681SAndroid Build Coastguard Worker**Purpose**: Creates AttrImpl.inc, which contains semantic attribute class
253*9880d681SAndroid Build Coastguard Workerdefinitions for any attribute in ``Attr.td`` that has not set ``ASTNode = 0``.
254*9880d681SAndroid Build Coastguard WorkerThis file is included as part of ``AttrImpl.cpp``.
255*9880d681SAndroid Build Coastguard Worker
256*9880d681SAndroid Build Coastguard WorkerClangAttrList
257*9880d681SAndroid Build Coastguard Worker-------------
258*9880d681SAndroid Build Coastguard Worker
259*9880d681SAndroid Build Coastguard Worker**Purpose**: Creates AttrList.inc, which is used when a list of semantic
260*9880d681SAndroid Build Coastguard Workerattribute identifiers is required. For instance, ``AttrKinds.h`` includes this
261*9880d681SAndroid Build Coastguard Workerfile to generate the list of ``attr::Kind`` enumeration values. This list is
262*9880d681SAndroid Build Coastguard Workerseparated out into multiple categories: attributes, inheritable attributes, and
263*9880d681SAndroid Build Coastguard Workerinheritable parameter attributes. This categorization happens automatically
264*9880d681SAndroid Build Coastguard Workerbased on information in ``Attr.td`` and is used to implement the ``classof``
265*9880d681SAndroid Build Coastguard Workerfunctionality required for ``dyn_cast`` and similar APIs.
266*9880d681SAndroid Build Coastguard Worker
267*9880d681SAndroid Build Coastguard WorkerClangAttrPCHRead
268*9880d681SAndroid Build Coastguard Worker----------------
269*9880d681SAndroid Build Coastguard Worker
270*9880d681SAndroid Build Coastguard Worker**Purpose**: Creates AttrPCHRead.inc, which is used to deserialize attributes
271*9880d681SAndroid Build Coastguard Workerin the ``ASTReader::ReadAttributes`` function.
272*9880d681SAndroid Build Coastguard Worker
273*9880d681SAndroid Build Coastguard WorkerClangAttrPCHWrite
274*9880d681SAndroid Build Coastguard Worker-----------------
275*9880d681SAndroid Build Coastguard Worker
276*9880d681SAndroid Build Coastguard Worker**Purpose**: Creates AttrPCHWrite.inc, which is used to serialize attributes in
277*9880d681SAndroid Build Coastguard Workerthe ``ASTWriter::WriteAttributes`` function.
278*9880d681SAndroid Build Coastguard Worker
279*9880d681SAndroid Build Coastguard WorkerClangAttrSpellings
280*9880d681SAndroid Build Coastguard Worker---------------------
281*9880d681SAndroid Build Coastguard Worker
282*9880d681SAndroid Build Coastguard Worker**Purpose**: Creates AttrSpellings.inc, which is used to implement the
283*9880d681SAndroid Build Coastguard Worker``__has_attribute`` feature test macro.
284*9880d681SAndroid Build Coastguard Worker
285*9880d681SAndroid Build Coastguard WorkerClangAttrSpellingListIndex
286*9880d681SAndroid Build Coastguard Worker--------------------------
287*9880d681SAndroid Build Coastguard Worker
288*9880d681SAndroid Build Coastguard Worker**Purpose**: Creates AttrSpellingListIndex.inc, which is used to map parsed
289*9880d681SAndroid Build Coastguard Workerattribute spellings (including which syntax or scope was used) to an attribute
290*9880d681SAndroid Build Coastguard Workerspelling list index. These spelling list index values are internal
291*9880d681SAndroid Build Coastguard Workerimplementation details exposed via
292*9880d681SAndroid Build Coastguard Worker``AttributeList::getAttributeSpellingListIndex``.
293*9880d681SAndroid Build Coastguard Worker
294*9880d681SAndroid Build Coastguard WorkerClangAttrVisitor
295*9880d681SAndroid Build Coastguard Worker-------------------
296*9880d681SAndroid Build Coastguard Worker
297*9880d681SAndroid Build Coastguard Worker**Purpose**: Creates AttrVisitor.inc, which is used when implementing
298*9880d681SAndroid Build Coastguard Workerrecursive AST visitors.
299*9880d681SAndroid Build Coastguard Worker
300*9880d681SAndroid Build Coastguard WorkerClangAttrTemplateInstantiate
301*9880d681SAndroid Build Coastguard Worker----------------------------
302*9880d681SAndroid Build Coastguard Worker
303*9880d681SAndroid Build Coastguard Worker**Purpose**: Creates AttrTemplateInstantiate.inc, which implements the
304*9880d681SAndroid Build Coastguard Worker``instantiateTemplateAttribute`` function, used when instantiating a template
305*9880d681SAndroid Build Coastguard Workerthat requires an attribute to be cloned.
306*9880d681SAndroid Build Coastguard Worker
307*9880d681SAndroid Build Coastguard WorkerClangAttrParsedAttrList
308*9880d681SAndroid Build Coastguard Worker-----------------------
309*9880d681SAndroid Build Coastguard Worker
310*9880d681SAndroid Build Coastguard Worker**Purpose**: Creates AttrParsedAttrList.inc, which is used to generate the
311*9880d681SAndroid Build Coastguard Worker``AttributeList::Kind`` parsed attribute enumeration.
312*9880d681SAndroid Build Coastguard Worker
313*9880d681SAndroid Build Coastguard WorkerClangAttrParsedAttrImpl
314*9880d681SAndroid Build Coastguard Worker-----------------------
315*9880d681SAndroid Build Coastguard Worker
316*9880d681SAndroid Build Coastguard Worker**Purpose**: Creates AttrParsedAttrImpl.inc, which is used by
317*9880d681SAndroid Build Coastguard Worker``AttributeList.cpp`` to implement several functions on the ``AttributeList``
318*9880d681SAndroid Build Coastguard Workerclass. This functionality is implemented via the ``AttrInfoMap ParsedAttrInfo``
319*9880d681SAndroid Build Coastguard Workerarray, which contains one element per parsed attribute object.
320*9880d681SAndroid Build Coastguard Worker
321*9880d681SAndroid Build Coastguard WorkerClangAttrParsedAttrKinds
322*9880d681SAndroid Build Coastguard Worker------------------------
323*9880d681SAndroid Build Coastguard Worker
324*9880d681SAndroid Build Coastguard Worker**Purpose**: Creates AttrParsedAttrKinds.inc, which is used to implement the
325*9880d681SAndroid Build Coastguard Worker``AttributeList::getKind`` function, mapping a string (and syntax) to a parsed
326*9880d681SAndroid Build Coastguard Workerattribute ``AttributeList::Kind`` enumeration.
327*9880d681SAndroid Build Coastguard Worker
328*9880d681SAndroid Build Coastguard WorkerClangAttrDump
329*9880d681SAndroid Build Coastguard Worker-------------
330*9880d681SAndroid Build Coastguard Worker
331*9880d681SAndroid Build Coastguard Worker**Purpose**: Creates AttrDump.inc, which dumps information about an attribute.
332*9880d681SAndroid Build Coastguard WorkerIt is used to implement ``ASTDumper::dumpAttr``.
333*9880d681SAndroid Build Coastguard Worker
334*9880d681SAndroid Build Coastguard WorkerClangDiagsDefs
335*9880d681SAndroid Build Coastguard Worker--------------
336*9880d681SAndroid Build Coastguard Worker
337*9880d681SAndroid Build Coastguard WorkerGenerate Clang diagnostics definitions.
338*9880d681SAndroid Build Coastguard Worker
339*9880d681SAndroid Build Coastguard WorkerClangDiagGroups
340*9880d681SAndroid Build Coastguard Worker---------------
341*9880d681SAndroid Build Coastguard Worker
342*9880d681SAndroid Build Coastguard WorkerGenerate Clang diagnostic groups.
343*9880d681SAndroid Build Coastguard Worker
344*9880d681SAndroid Build Coastguard WorkerClangDiagsIndexName
345*9880d681SAndroid Build Coastguard Worker-------------------
346*9880d681SAndroid Build Coastguard Worker
347*9880d681SAndroid Build Coastguard WorkerGenerate Clang diagnostic name index.
348*9880d681SAndroid Build Coastguard Worker
349*9880d681SAndroid Build Coastguard WorkerClangCommentNodes
350*9880d681SAndroid Build Coastguard Worker-----------------
351*9880d681SAndroid Build Coastguard Worker
352*9880d681SAndroid Build Coastguard WorkerGenerate Clang AST comment nodes.
353*9880d681SAndroid Build Coastguard Worker
354*9880d681SAndroid Build Coastguard WorkerClangDeclNodes
355*9880d681SAndroid Build Coastguard Worker--------------
356*9880d681SAndroid Build Coastguard Worker
357*9880d681SAndroid Build Coastguard WorkerGenerate Clang AST declaration nodes.
358*9880d681SAndroid Build Coastguard Worker
359*9880d681SAndroid Build Coastguard WorkerClangStmtNodes
360*9880d681SAndroid Build Coastguard Worker--------------
361*9880d681SAndroid Build Coastguard Worker
362*9880d681SAndroid Build Coastguard WorkerGenerate Clang AST statement nodes.
363*9880d681SAndroid Build Coastguard Worker
364*9880d681SAndroid Build Coastguard WorkerClangSACheckers
365*9880d681SAndroid Build Coastguard Worker---------------
366*9880d681SAndroid Build Coastguard Worker
367*9880d681SAndroid Build Coastguard WorkerGenerate Clang Static Analyzer checkers.
368*9880d681SAndroid Build Coastguard Worker
369*9880d681SAndroid Build Coastguard WorkerClangCommentHTMLTags
370*9880d681SAndroid Build Coastguard Worker--------------------
371*9880d681SAndroid Build Coastguard Worker
372*9880d681SAndroid Build Coastguard WorkerGenerate efficient matchers for HTML tag names that are used in documentation comments.
373*9880d681SAndroid Build Coastguard Worker
374*9880d681SAndroid Build Coastguard WorkerClangCommentHTMLTagsProperties
375*9880d681SAndroid Build Coastguard Worker------------------------------
376*9880d681SAndroid Build Coastguard Worker
377*9880d681SAndroid Build Coastguard WorkerGenerate efficient matchers for HTML tag properties.
378*9880d681SAndroid Build Coastguard Worker
379*9880d681SAndroid Build Coastguard WorkerClangCommentHTMLNamedCharacterReferences
380*9880d681SAndroid Build Coastguard Worker----------------------------------------
381*9880d681SAndroid Build Coastguard Worker
382*9880d681SAndroid Build Coastguard WorkerGenerate function to translate named character references to UTF-8 sequences.
383*9880d681SAndroid Build Coastguard Worker
384*9880d681SAndroid Build Coastguard WorkerClangCommentCommandInfo
385*9880d681SAndroid Build Coastguard Worker-----------------------
386*9880d681SAndroid Build Coastguard Worker
387*9880d681SAndroid Build Coastguard WorkerGenerate command properties for commands that are used in documentation comments.
388*9880d681SAndroid Build Coastguard Worker
389*9880d681SAndroid Build Coastguard WorkerClangCommentCommandList
390*9880d681SAndroid Build Coastguard Worker-----------------------
391*9880d681SAndroid Build Coastguard Worker
392*9880d681SAndroid Build Coastguard WorkerGenerate list of commands that are used in documentation comments.
393*9880d681SAndroid Build Coastguard Worker
394*9880d681SAndroid Build Coastguard WorkerArmNeon
395*9880d681SAndroid Build Coastguard Worker-------
396*9880d681SAndroid Build Coastguard Worker
397*9880d681SAndroid Build Coastguard WorkerGenerate arm_neon.h for clang.
398*9880d681SAndroid Build Coastguard Worker
399*9880d681SAndroid Build Coastguard WorkerArmNeonSema
400*9880d681SAndroid Build Coastguard Worker-----------
401*9880d681SAndroid Build Coastguard Worker
402*9880d681SAndroid Build Coastguard WorkerGenerate ARM NEON sema support for clang.
403*9880d681SAndroid Build Coastguard Worker
404*9880d681SAndroid Build Coastguard WorkerArmNeonTest
405*9880d681SAndroid Build Coastguard Worker-----------
406*9880d681SAndroid Build Coastguard Worker
407*9880d681SAndroid Build Coastguard WorkerGenerate ARM NEON tests for clang.
408*9880d681SAndroid Build Coastguard Worker
409*9880d681SAndroid Build Coastguard WorkerAttrDocs
410*9880d681SAndroid Build Coastguard Worker--------
411*9880d681SAndroid Build Coastguard Worker
412*9880d681SAndroid Build Coastguard Worker**Purpose**: Creates ``AttributeReference.rst`` from ``AttrDocs.td``, and is
413*9880d681SAndroid Build Coastguard Workerused for documenting user-facing attributes.
414*9880d681SAndroid Build Coastguard Worker
415*9880d681SAndroid Build Coastguard WorkerHow to write a back-end
416*9880d681SAndroid Build Coastguard Worker=======================
417*9880d681SAndroid Build Coastguard Worker
418*9880d681SAndroid Build Coastguard WorkerTODO.
419*9880d681SAndroid Build Coastguard Worker
420*9880d681SAndroid Build Coastguard WorkerUntil we get a step-by-step HowTo for writing TableGen backends, you can at
421*9880d681SAndroid Build Coastguard Workerleast grab the boilerplate (build system, new files, etc.) from Clang's
422*9880d681SAndroid Build Coastguard Workerr173931.
423*9880d681SAndroid Build Coastguard Worker
424*9880d681SAndroid Build Coastguard WorkerTODO: How they work, how to write one.  This section should not contain details
425*9880d681SAndroid Build Coastguard Workerabout any particular backend, except maybe ``-print-enums`` as an example.  This
426*9880d681SAndroid Build Coastguard Workershould highlight the APIs in ``TableGen/Record.h``.
427*9880d681SAndroid Build Coastguard Worker
428