blob: 1c4682830d188393e63823773903ae4ca327ade1 [file] [log] [blame]
Daniel Dunbar3b709d52012-05-08 16:50:35 +00001tblgen - Target Description To C++ Code Generator
2=================================================
3
Daniel Dunbar3b709d52012-05-08 16:50:35 +00004SYNOPSIS
5--------
6
Dmitri Gribenko6a144e42012-11-29 17:41:05 +00007:program:`tblgen` [*options*] [*filename*]
Daniel Dunbar3b709d52012-05-08 16:50:35 +00008
9DESCRIPTION
10-----------
11
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000012:program:`tblgen` translates from target description (``.td``) files into C++
13code that can be included in the definition of an LLVM target library. Most
14users of LLVM will not need to use this program. It is only for assisting with
15writing an LLVM target backend.
Daniel Dunbar3b709d52012-05-08 16:50:35 +000016
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000017The input and output of :program:`tblgen` is beyond the scope of this short
18introduction. Please see :doc:`../TableGenFundamentals`.
Daniel Dunbar3b709d52012-05-08 16:50:35 +000019
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000020The *filename* argument specifies the name of a Target Description (``.td``)
21file to read as input.
Daniel Dunbar3b709d52012-05-08 16:50:35 +000022
23OPTIONS
24-------
25
Dmitri Gribenko595dd5a2013-04-27 16:34:24 +000026.. program:: tblgen
27
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000028.. option:: -help
Daniel Dunbar3b709d52012-05-08 16:50:35 +000029
30 Print a summary of command line options.
31
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000032.. option:: -o filename
Daniel Dunbar3b709d52012-05-08 16:50:35 +000033
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000034 Specify the output file name. If ``filename`` is ``-``, then
35 :program:`tblgen` sends its output to standard output.
Daniel Dunbar3b709d52012-05-08 16:50:35 +000036
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000037.. option:: -I directory
Daniel Dunbar3b709d52012-05-08 16:50:35 +000038
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000039 Specify where to find other target description files for inclusion. The
40 ``directory`` value should be a full or partial path to a directory that
41 contains target description files.
Daniel Dunbar3b709d52012-05-08 16:50:35 +000042
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000043.. option:: -asmparsernum N
Daniel Dunbar3b709d52012-05-08 16:50:35 +000044
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000045 Make -gen-asm-parser emit assembly writer number ``N``.
Daniel Dunbar3b709d52012-05-08 16:50:35 +000046
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000047.. option:: -asmwriternum N
Daniel Dunbar3b709d52012-05-08 16:50:35 +000048
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000049 Make -gen-asm-writer emit assembly writer number ``N``.
Daniel Dunbar3b709d52012-05-08 16:50:35 +000050
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000051.. option:: -class className
Daniel Dunbar3b709d52012-05-08 16:50:35 +000052
53 Print the enumeration list for this class.
54
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000055.. option:: -print-records
Daniel Dunbar3b709d52012-05-08 16:50:35 +000056
57 Print all records to standard output (default).
58
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000059.. option:: -print-enums
Daniel Dunbar3b709d52012-05-08 16:50:35 +000060
Dmitri Gribenko595dd5a2013-04-27 16:34:24 +000061 Print enumeration values for a class.
Daniel Dunbar3b709d52012-05-08 16:50:35 +000062
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000063.. option:: -print-sets
Daniel Dunbar3b709d52012-05-08 16:50:35 +000064
65 Print expanded sets for testing DAG exprs.
66
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000067.. option:: -gen-emitter
Daniel Dunbar3b709d52012-05-08 16:50:35 +000068
69 Generate machine code emitter.
70
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000071.. option:: -gen-register-info
Daniel Dunbar3b709d52012-05-08 16:50:35 +000072
73 Generate registers and register classes info.
74
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000075.. option:: -gen-instr-info
Daniel Dunbar3b709d52012-05-08 16:50:35 +000076
77 Generate instruction descriptions.
78
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000079.. option:: -gen-asm-writer
Daniel Dunbar3b709d52012-05-08 16:50:35 +000080
81 Generate the assembly writer.
82
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000083.. option:: -gen-disassembler
Daniel Dunbar3b709d52012-05-08 16:50:35 +000084
85 Generate disassembler.
86
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000087.. option:: -gen-pseudo-lowering
Daniel Dunbar3b709d52012-05-08 16:50:35 +000088
89 Generate pseudo instruction lowering.
90
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000091.. option:: -gen-dag-isel
Daniel Dunbar3b709d52012-05-08 16:50:35 +000092
93 Generate a DAG (Directed Acycle Graph) instruction selector.
94
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000095.. option:: -gen-asm-matcher
Daniel Dunbar3b709d52012-05-08 16:50:35 +000096
97 Generate assembly instruction matcher.
98
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000099.. option:: -gen-dfa-packetizer
Daniel Dunbar3b709d52012-05-08 16:50:35 +0000100
101 Generate DFA Packetizer for VLIW targets.
102
Dmitri Gribenko6a144e42012-11-29 17:41:05 +0000103.. option:: -gen-fast-isel
Daniel Dunbar3b709d52012-05-08 16:50:35 +0000104
105 Generate a "fast" instruction selector.
106
Dmitri Gribenko6a144e42012-11-29 17:41:05 +0000107.. option:: -gen-subtarget
Daniel Dunbar3b709d52012-05-08 16:50:35 +0000108
109 Generate subtarget enumerations.
110
Dmitri Gribenko6a144e42012-11-29 17:41:05 +0000111.. option:: -gen-intrinsic
Daniel Dunbar3b709d52012-05-08 16:50:35 +0000112
113 Generate intrinsic information.
114
Dmitri Gribenko6a144e42012-11-29 17:41:05 +0000115.. option:: -gen-tgt-intrinsic
Daniel Dunbar3b709d52012-05-08 16:50:35 +0000116
117 Generate target intrinsic information.
118
Dmitri Gribenko6a144e42012-11-29 17:41:05 +0000119.. option:: -gen-enhanced-disassembly-info
Daniel Dunbar3b709d52012-05-08 16:50:35 +0000120
121 Generate enhanced disassembly info.
122
Dmitri Gribenko6a144e42012-11-29 17:41:05 +0000123.. option:: -version
Daniel Dunbar3b709d52012-05-08 16:50:35 +0000124
125 Show the version number of this program.
126
Daniel Dunbar3b709d52012-05-08 16:50:35 +0000127EXIT STATUS
128-----------
129
Dmitri Gribenko6a144e42012-11-29 17:41:05 +0000130If :program:`tblgen` succeeds, it will exit with 0. Otherwise, if an error
Daniel Dunbar3b709d52012-05-08 16:50:35 +0000131occurs, it will exit with a non-zero value.