blob: 3105e0c8076710abdcdbaa2ca800150b8c837e9b [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
Sean Silvab9a65fd2014-04-07 22:46:40 +000018introduction; please see the :doc:`introduction to TableGen
19<../TableGen/index>`.
Daniel Dunbar3b709d52012-05-08 16:50:35 +000020
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000021The *filename* argument specifies the name of a Target Description (``.td``)
22file to read as input.
Daniel Dunbar3b709d52012-05-08 16:50:35 +000023
24OPTIONS
25-------
26
Dmitri Gribenko595dd5a2013-04-27 16:34:24 +000027.. program:: tblgen
28
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000029.. option:: -help
Daniel Dunbar3b709d52012-05-08 16:50:35 +000030
31 Print a summary of command line options.
32
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000033.. option:: -o filename
Daniel Dunbar3b709d52012-05-08 16:50:35 +000034
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000035 Specify the output file name. If ``filename`` is ``-``, then
36 :program:`tblgen` sends its output to standard output.
Daniel Dunbar3b709d52012-05-08 16:50:35 +000037
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000038.. option:: -I directory
Daniel Dunbar3b709d52012-05-08 16:50:35 +000039
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000040 Specify where to find other target description files for inclusion. The
41 ``directory`` value should be a full or partial path to a directory that
42 contains target description files.
Daniel Dunbar3b709d52012-05-08 16:50:35 +000043
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000044.. option:: -asmparsernum N
Daniel Dunbar3b709d52012-05-08 16:50:35 +000045
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000046 Make -gen-asm-parser emit assembly writer number ``N``.
Daniel Dunbar3b709d52012-05-08 16:50:35 +000047
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000048.. option:: -asmwriternum N
Daniel Dunbar3b709d52012-05-08 16:50:35 +000049
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000050 Make -gen-asm-writer emit assembly writer number ``N``.
Daniel Dunbar3b709d52012-05-08 16:50:35 +000051
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000052.. option:: -class className
Daniel Dunbar3b709d52012-05-08 16:50:35 +000053
54 Print the enumeration list for this class.
55
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000056.. option:: -print-records
Daniel Dunbar3b709d52012-05-08 16:50:35 +000057
58 Print all records to standard output (default).
59
Simon Tatham9cfd4e52018-07-11 08:40:19 +000060.. option:: -dump-json
61
62 Print a JSON representation of all records, suitable for further
63 automated processing.
64
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000065.. option:: -print-enums
Daniel Dunbar3b709d52012-05-08 16:50:35 +000066
Dmitri Gribenko595dd5a2013-04-27 16:34:24 +000067 Print enumeration values for a class.
Daniel Dunbar3b709d52012-05-08 16:50:35 +000068
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000069.. option:: -print-sets
Daniel Dunbar3b709d52012-05-08 16:50:35 +000070
71 Print expanded sets for testing DAG exprs.
72
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000073.. option:: -gen-emitter
Daniel Dunbar3b709d52012-05-08 16:50:35 +000074
75 Generate machine code emitter.
76
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000077.. option:: -gen-register-info
Daniel Dunbar3b709d52012-05-08 16:50:35 +000078
79 Generate registers and register classes info.
80
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000081.. option:: -gen-instr-info
Daniel Dunbar3b709d52012-05-08 16:50:35 +000082
83 Generate instruction descriptions.
84
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000085.. option:: -gen-asm-writer
Daniel Dunbar3b709d52012-05-08 16:50:35 +000086
87 Generate the assembly writer.
88
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000089.. option:: -gen-disassembler
Daniel Dunbar3b709d52012-05-08 16:50:35 +000090
91 Generate disassembler.
92
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000093.. option:: -gen-pseudo-lowering
Daniel Dunbar3b709d52012-05-08 16:50:35 +000094
95 Generate pseudo instruction lowering.
96
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000097.. option:: -gen-dag-isel
Daniel Dunbar3b709d52012-05-08 16:50:35 +000098
99 Generate a DAG (Directed Acycle Graph) instruction selector.
100
Dmitri Gribenko6a144e42012-11-29 17:41:05 +0000101.. option:: -gen-asm-matcher
Daniel Dunbar3b709d52012-05-08 16:50:35 +0000102
103 Generate assembly instruction matcher.
104
Dmitri Gribenko6a144e42012-11-29 17:41:05 +0000105.. option:: -gen-dfa-packetizer
Daniel Dunbar3b709d52012-05-08 16:50:35 +0000106
107 Generate DFA Packetizer for VLIW targets.
108
Dmitri Gribenko6a144e42012-11-29 17:41:05 +0000109.. option:: -gen-fast-isel
Daniel Dunbar3b709d52012-05-08 16:50:35 +0000110
111 Generate a "fast" instruction selector.
112
Dmitri Gribenko6a144e42012-11-29 17:41:05 +0000113.. option:: -gen-subtarget
Daniel Dunbar3b709d52012-05-08 16:50:35 +0000114
115 Generate subtarget enumerations.
116
Fangrui Song5223dab2018-06-25 19:40:08 +0000117.. option:: -gen-intrinsic-enums
Daniel Dunbar3b709d52012-05-08 16:50:35 +0000118
Fangrui Song5223dab2018-06-25 19:40:08 +0000119 Generate intrinsic enums.
120
121.. option:: -gen-intrinsic-impl
122
123 Generate intrinsic implementation.
Daniel Dunbar3b709d52012-05-08 16:50:35 +0000124
Dmitri Gribenko6a144e42012-11-29 17:41:05 +0000125.. option:: -gen-tgt-intrinsic
Daniel Dunbar3b709d52012-05-08 16:50:35 +0000126
127 Generate target intrinsic information.
128
Dmitri Gribenko6a144e42012-11-29 17:41:05 +0000129.. option:: -gen-enhanced-disassembly-info
Daniel Dunbar3b709d52012-05-08 16:50:35 +0000130
131 Generate enhanced disassembly info.
132
Clement Courbetf4fb61b2018-10-25 07:44:01 +0000133.. option:: -gen-exegesis
134
135 Generate llvm-exegesis tables.
136
Dmitri Gribenko6a144e42012-11-29 17:41:05 +0000137.. option:: -version
Daniel Dunbar3b709d52012-05-08 16:50:35 +0000138
139 Show the version number of this program.
140
Daniel Dunbar3b709d52012-05-08 16:50:35 +0000141EXIT STATUS
142-----------
143
Dmitri Gribenko6a144e42012-11-29 17:41:05 +0000144If :program:`tblgen` succeeds, it will exit with 0. Otherwise, if an error
Daniel Dunbar3b709d52012-05-08 16:50:35 +0000145occurs, it will exit with a non-zero value.