blob: 1858ee447d0756ca7300f0cb22212fc9e62eaacd [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 Gribenko6a144e42012-11-29 17:41:05 +000026.. option:: -help
Daniel Dunbar3b709d52012-05-08 16:50:35 +000027
28 Print a summary of command line options.
29
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000030.. option:: -o filename
Daniel Dunbar3b709d52012-05-08 16:50:35 +000031
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000032 Specify the output file name. If ``filename`` is ``-``, then
33 :program:`tblgen` sends its output to standard output.
Daniel Dunbar3b709d52012-05-08 16:50:35 +000034
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000035.. option:: -I directory
Daniel Dunbar3b709d52012-05-08 16:50:35 +000036
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000037 Specify where to find other target description files for inclusion. The
38 ``directory`` value should be a full or partial path to a directory that
39 contains target description files.
Daniel Dunbar3b709d52012-05-08 16:50:35 +000040
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000041.. option:: -asmparsernum N
Daniel Dunbar3b709d52012-05-08 16:50:35 +000042
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000043 Make -gen-asm-parser emit assembly writer number ``N``.
Daniel Dunbar3b709d52012-05-08 16:50:35 +000044
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000045.. option:: -asmwriternum N
Daniel Dunbar3b709d52012-05-08 16:50:35 +000046
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000047 Make -gen-asm-writer emit assembly writer number ``N``.
Daniel Dunbar3b709d52012-05-08 16:50:35 +000048
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000049.. option:: -class className
Daniel Dunbar3b709d52012-05-08 16:50:35 +000050
51 Print the enumeration list for this class.
52
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000053.. option:: -print-records
Daniel Dunbar3b709d52012-05-08 16:50:35 +000054
55 Print all records to standard output (default).
56
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000057.. option:: -print-enums
Daniel Dunbar3b709d52012-05-08 16:50:35 +000058
59 Print enumeration values for a class
60
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000061.. option:: -print-sets
Daniel Dunbar3b709d52012-05-08 16:50:35 +000062
63 Print expanded sets for testing DAG exprs.
64
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000065.. option:: -gen-emitter
Daniel Dunbar3b709d52012-05-08 16:50:35 +000066
67 Generate machine code emitter.
68
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000069.. option:: -gen-register-info
Daniel Dunbar3b709d52012-05-08 16:50:35 +000070
71 Generate registers and register classes info.
72
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000073.. option:: -gen-instr-info
Daniel Dunbar3b709d52012-05-08 16:50:35 +000074
75 Generate instruction descriptions.
76
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000077.. option:: -gen-asm-writer
Daniel Dunbar3b709d52012-05-08 16:50:35 +000078
79 Generate the assembly writer.
80
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000081.. option:: -gen-disassembler
Daniel Dunbar3b709d52012-05-08 16:50:35 +000082
83 Generate disassembler.
84
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000085.. option:: -gen-pseudo-lowering
Daniel Dunbar3b709d52012-05-08 16:50:35 +000086
87 Generate pseudo instruction lowering.
88
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000089.. option:: -gen-dag-isel
Daniel Dunbar3b709d52012-05-08 16:50:35 +000090
91 Generate a DAG (Directed Acycle Graph) instruction selector.
92
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000093.. option:: -gen-asm-matcher
Daniel Dunbar3b709d52012-05-08 16:50:35 +000094
95 Generate assembly instruction matcher.
96
Dmitri Gribenko6a144e42012-11-29 17:41:05 +000097.. option:: -gen-dfa-packetizer
Daniel Dunbar3b709d52012-05-08 16:50:35 +000098
99 Generate DFA Packetizer for VLIW targets.
100
Dmitri Gribenko6a144e42012-11-29 17:41:05 +0000101.. option:: -gen-fast-isel
Daniel Dunbar3b709d52012-05-08 16:50:35 +0000102
103 Generate a "fast" instruction selector.
104
Dmitri Gribenko6a144e42012-11-29 17:41:05 +0000105.. option:: -gen-subtarget
Daniel Dunbar3b709d52012-05-08 16:50:35 +0000106
107 Generate subtarget enumerations.
108
Dmitri Gribenko6a144e42012-11-29 17:41:05 +0000109.. option:: -gen-intrinsic
Daniel Dunbar3b709d52012-05-08 16:50:35 +0000110
111 Generate intrinsic information.
112
Dmitri Gribenko6a144e42012-11-29 17:41:05 +0000113.. option:: -gen-tgt-intrinsic
Daniel Dunbar3b709d52012-05-08 16:50:35 +0000114
115 Generate target intrinsic information.
116
Dmitri Gribenko6a144e42012-11-29 17:41:05 +0000117.. option:: -gen-enhanced-disassembly-info
Daniel Dunbar3b709d52012-05-08 16:50:35 +0000118
119 Generate enhanced disassembly info.
120
Dmitri Gribenko6a144e42012-11-29 17:41:05 +0000121.. option:: -version
Daniel Dunbar3b709d52012-05-08 16:50:35 +0000122
123 Show the version number of this program.
124
Daniel Dunbar3b709d52012-05-08 16:50:35 +0000125EXIT STATUS
126-----------
127
Dmitri Gribenko6a144e42012-11-29 17:41:05 +0000128If :program:`tblgen` succeeds, it will exit with 0. Otherwise, if an error
Daniel Dunbar3b709d52012-05-08 16:50:35 +0000129occurs, it will exit with a non-zero value.