Reference

tblgen(1)

Description to C++ Code

NAME

tblgen - Description to C++ Code

SYNOPSIS

clang-tblgen [options] [filename]

lldb-tblgen [options] [filename]

llvm-tblgen [options] [filename]

mlir-tblgen [options] [filename]

DESCRIPTION

*-tblgen is a family of programs that translates target description (.td) files into C++ code and other output formats. Most users of LLVM will not need to use this program. It is used only for writing parts of the compiler, debugger, and LLVM target backends.

The details of the input and output of the *-tblgen programs is beyond the scope of this short introduction; please see the TableGen Overview <> for an introduction and for references to additional TableGen documents.

The filename argument specifies the name of the Target Description (.td) file that TableGen processes.

OPTIONS

General Options

-help

Print a description of the command line options.

-help-list

Print a description of the command line options in a simple list format.

-D=macroname

Specify the name of a macro to be defined. The name is defined, but it has no particular value.

-d=filename

Specify the name of the dependency filename.

-debug

Enable debug output.

-dump-json

Print a JSON representation of all records, suitable for further automated processing.

-I directory

Specify where to find other target description files for inclusion. The directory value should be a full or partial path to a directory that contains target description files.

-null-backend

Parse the source files and build the records, but do not run any backend. This is useful for timing the frontend.

-o filename

Specify the output file name. If filename is -, then *-tblgen sends its output to standard output.

-print-records

Print all classes and records to standard output (default backend option).

-print-detailed-records

Print a detailed report of all global variables, classes, and records to standard output.

-stats

Print a report with any statistics collected by the backend.

-time-phases

Time the parser and backend phases and print a report.

-version

Show the version number of the program.

-write-if-changed

Write the output file only if it is new or has changed.

clang-tblgen Options

-gen-clang-attr-classes

Generate Clang attribute classes.

-gen-clang-attr-parser-string-switches

Generate all parser-related attribute string switches.

-gen-clang-attr-subject-match-rules-parser-string-switches

Generate all parser-related attribute subject match rule string switches.

-gen-clang-attr-impl

Generate Clang attribute implementations.

-gen-clang-attr-list"

Generate a Clang attribute list.

-gen-clang-attr-subject-match-rule-list

Generate a Clang attribute subject match rule list.

-gen-clang-attr-pch-read

Generate Clang PCH attribute reader.

-gen-clang-attr-pch-write

Generate Clang PCH attribute writer.

-gen-clang-attr-has-attribute-impl

Generate a Clang attribute spelling list.

-gen-clang-attr-spelling-index

Generate a Clang attribute spelling index.

-gen-clang-attr-ast-visitor

Generate a recursive AST visitor for Clang attributes.

-gen-clang-attr-template-instantiate

Generate a Clang template instantiate code.

-gen-clang-attr-parsed-attr-list

Generate a Clang parsed attribute list.

-gen-clang-attr-parsed-attr-impl

Generate the Clang parsed attribute helpers.

-gen-clang-attr-parsed-attr-kinds

Generate a Clang parsed attribute kinds.

-gen-clang-attr-text-node-dump

Generate Clang attribute text node dumper.

-gen-clang-attr-node-traverse

Generate Clang attribute traverser.

-gen-clang-diags-defs

Generate Clang diagnostics definitions.

-clang-component component

Only use warnings from specified component.

-gen-clang-diag-groups

Generate Clang diagnostic groups.

-gen-clang-diags-index-name

Generate Clang diagnostic name index.

-gen-clang-basic-reader

Generate Clang BasicReader classes.

-gen-clang-basic-writer

Generate Clang BasicWriter classes.

-gen-clang-comment-nodes

Generate Clang AST comment nodes.

-gen-clang-decl-nodes

Generate Clang AST declaration nodes.

-gen-clang-stmt-nodes

Generate Clang AST statement nodes.

-gen-clang-type-nodes

Generate Clang AST type nodes.

-gen-clang-type-reader

Generate Clang AbstractTypeReader class.

-gen-clang-type-writer

Generate Clang AbstractTypeWriter class.

-gen-clang-opcodes

Generate Clang constexpr interpreter opcodes.

-gen-clang-sa-checkers

Generate Clang static analyzer checkers.

-gen-clang-comment-html-tags

Generate efficient matchers for HTML tag names that are used in documentation comments.

-gen-clang-comment-html-tags-properties

Generate efficient matchers for HTML tag properties.

-gen-clang-comment-html-named-character-references

Generate function to translate named character references to UTF-8 sequences.

-gen-clang-comment-command-info

Generate command properties for commands that are used in documentation comments.

-gen-clang-comment-command-list

Generate list of commands that are used in documentation comments.

-gen-clang-opencl-builtins

Generate OpenCL builtin declaration handlers.

-gen-arm-neon

Generate arm_neon.h for Clang.

-gen-arm-fp16

Generate arm_fp16.h for Clang.

-gen-arm-bf16

Generate arm_bf16.h for Clang.

-gen-arm-neon-sema

Generate ARM NEON sema support for Clang.

-gen-arm-neon-test

Generate ARM NEON tests for Clang.

-gen-arm-immcheck-types

Generate arm_immcheck_types.inc for Clang.

-gen-arm-sve-header

Generate arm_sve.h for Clang.

-gen-arm-sve-builtins

Generate arm_sve_builtins.inc for Clang.

-gen-arm-sve-builtin-codegen

Generate arm_sve_builtin_cg_map.inc for Clang.

-gen-arm-sve-typeflags

Generate arm_sve_typeflags.inc for Clang.

-gen-arm-sve-sema-rangechecks

Generate arm_sve_sema_rangechecks.inc for Clang.

-gen-arm-mve-header

Generate arm_mve.h for Clang.

-gen-arm-mve-builtin-def

Generate ARM MVE builtin definitions for Clang.

-gen-arm-mve-builtin-sema

Generate ARM MVE builtin sema checks for Clang.

-gen-arm-mve-builtin-codegen

Generate ARM MVE builtin code-generator for Clang.

-gen-arm-mve-builtin-aliases

Generate list of valid ARM MVE builtin aliases for Clang.

-gen-arm-cde-header

Generate arm_cde.h for Clang.

-gen-arm-cde-builtin-def

Generate ARM CDE builtin definitions for Clang.

-gen-arm-cde-builtin-sema

Generate ARM CDE builtin sema checks for Clang.

-gen-arm-cde-builtin-codegen

Generate ARM CDE builtin code-generator for Clang.

-gen-arm-cde-builtin-aliases

Generate list of valid ARM CDE builtin aliases for Clang.

-gen-riscv-vector-header

Generate riscv_vector.h for Clang.

-gen-riscv-vector-builtins

Generate riscv_vector_builtins.inc for Clang.

-gen-riscv-vector-builtin-codegen

Generate riscv_vector_builtin_cg.inc for Clang.

-gen-riscv-sifive-vector-builtins

Generate riscv_sifive_vector_builtins.inc for Clang.

-gen-riscv-sifive-vector-builtin-codegen

Generate riscv_sifive_vector_builtin_cg.inc for Clang.

-gen-attr-docs

Generate attribute documentation.

-gen-diag-docs

Generate diagnostic documentation.

-gen-opt-docs

Generate option documentation.

-gen-clang-data-collectors

Generate data collectors for AST nodes.

-gen-clang-test-pragma-attribute-supported-attributes

Generate a list of attributes supported by #pragma Clang attribute for testing purposes.

lldb-tblgen Options

gen-lldb-option-defs

Generate lldb OptionDefinition values.

gen-lldb-property-defs

Generate lldb PropertyDefinition values.

gen-lldb-property-enum-defs

Generate lldb PropertyDefinition enum values.

llvm-tblgen Options

-gen-asm-matcher

Generate assembly instruction matcher.

-match-prefix=prefix

Make -gen-asm-matcher match only instructions with the given prefix.

-gen-asm-parser

Generate assembly instruction parser.

-asmparsernum=n

Make -gen-asm-parser emit assembly parser number n.

-gen-asm-writer

Generate assembly writer.

-asmwriternum=n

Make -gen-asm-writer emit assembly writer number n.

-gen-attrs

Generate attributes.

-gen-automata

Generate generic automata.

-gen-callingconv

Generate calling convention descriptions.

-gen-compress-inst-emitter

Generate RISC-V compressed instructions.

-gen-ctags

Generate ctags-compatible index.

-gen-dag-isel

Generate a DAG (directed acyclic graph) instruction selector.

-instrument-coverage

Make -gen-dag-isel generate tables to help identify the patterns matched.

-omit-comments

Make -gen-dag-isel omit comments. The default is false.

-gen-dfa-packetizer

Generate DFA Packetizer for VLIW targets.

-gen-directive-decl

Generate directive related declaration code (header file).

-gen-directive-gen

Generate directive related implementation code part.

-gen-directive-impl

Generate directive related implementation code.

-gen-disassembler

Generate disassembler.

-gen-emitter

Generate machine code emitter.

-gen-exegesis

Generate llvm-exegesis tables.

-gen-fast-isel

Generate a "fast" instruction selector.

-gen-global-isel

Generate GlobalISel selector.

-gisel-coverage-file=filename

Specify the file from which to retrieve coverage information.

-instrument-gisel-coverage

Make -gen-global-isel generate coverage instrumentation.

-optimize-match-table

Make -gen-global-isel generate an optimized version of the match table.

-warn-on-skipped-patterns

Make -gen-global-isel explain why a pattern was skipped for inclusion.

-gen-global-isel-combiner

Generate GlobalISel combiner.

-combiners=list

Make -gen-global-isel-combiner emit the specified combiners.

-gicombiner-debug-cxxpreds

Add debug comments to all C++ predicates emitted by -gen-global-isel-combiner

-gicombiner-stop-after-parse

Make -gen-global-isel-combiner stop processing after parsing rules and dump state.

-gen-instr-info

Generate instruction descriptions.

-gen-instr-docs

Generate instruction documentation.

-gen-intrinsic-enums

Generate intrinsic enums.

-intrinsic-prefix=prefix

Make -gen-intrinsic-enums generate intrinsics with this target prefix.

-gen-intrinsic-impl

Generate intrinsic information.

-gen-opt-parser-defs

Generate options definitions.

-gen-opt-rst

Generate option RST.

-gen-pseudo-lowering

Generate pseudo instruction lowering.

-gen-register-bank

Generate register bank descriptions.

-gen-register-info

Generate registers and register classes info.

-register-info-debug

Make -gen-register-info dump register information for debugging.

-gen-searchable-tables

Generate generic searchable tables. See TableGen BackEnds <> for a detailed description.

-gen-subtarget

Generate subtarget enumerations.

-gen-x86-EVEX2VEX-tables

Generate X86 EVEX to VEX compress tables.

-gen-x86-fold-tables

Generate X86 fold tables.

-long-string-literals

When emitting large string tables, prefer string literals over comma-separated char literals. This can be a readability and compile-time performance win, but upsets some compilers.

-print-enums

Print enumeration values for a class.

-class=classname

Make -print-enums print the enumeration list for the specified class.

-print-sets

Print expanded sets for testing DAG exprs.

mlir-tblgen Options

-gen-avail-interface-decls

Generate availability interface declarations.

-gen-avail-interface-defs

Generate op interface definitions.

-gen-dialect-doc

Generate dialect documentation.

-dialect

The dialect to generate.

-gen-directive-decl

Generate declarations for directives (OpenMP, etc.).

-gen-enum-decls

Generate enum utility declarations.

-gen-enum-defs

Generate enum utility definitions.

-gen-enum-from-llvmir-conversions

Generate conversions of EnumAttrs from LLVM IR.

-gen-enum-to-llvmir-conversions

Generate conversions of EnumAttrs to LLVM IR.

-gen-llvmir-conversions

Generate LLVM IR conversions.

-gen-llvmir-intrinsics

Generate LLVM IR intrinsics.

-llvmir-intrinsics-filter

Only keep the intrinsics with the specified substring in their record name.

-dialect-opclass-base

The base class for the ops in the dialect we are to emit.

-gen-op-decls

Generate operation declarations.

-gen-op-defs

Generate operation definitions.

-asmformat-error-is-fatal

Emit a fatal error if format parsing fails.

-op-exclude-regex

Regular expression of name of ops to exclude (no filter if empty).

-op-include-regex

Regular expression of name of ops to include (no filter if empty).

-gen-op-doc

Generate operation documentation.

-gen-pass-decls

Generate operation documentation.

-name namestring

The name of this group of passes.

-gen-pass-doc

Generate pass documentation.

-gen-rewriters

Generate pattern rewriters.

-gen-spirv-avail-impls

Generate SPIR-V operation utility definitions.

-gen-spirv-capability-implication

Generate utility function to return implied capabilities for a given capability.

-gen-spirv-enum-avail-decls

Generate SPIR-V enum availability declarations.

-gen-spirv-enum-avail-defs

Generate SPIR-V enum availability definitions.

-gen-spirv-op-utils

Generate SPIR-V operation utility definitions.

-gen-spirv-serialization

Generate SPIR-V (de)serialization utilities and functions.

-gen-struct-attr-decls

Generate struct utility declarations.

-gen-struct-attr-defs

Generate struct utility definitions.

-gen-typedef-decls

Generate TypeDef declarations.

-gen-typedef-defs

Generate TypeDef definitions.

-typedefs-dialect name

Generate types for this dialect.

EXIT STATUS

If *-tblgen succeeds, it will exit with 0. Otherwise, if an error occurs, it will exit with a non-zero value.

Author

Maintained by the LLVM Team (https://llvm.org/).

Copyright

2003-2026, LLVM Project

History

-D since Arch Linux 2026-11-01; -asmformat-error-is-fatal since Arch Linux 2026-11-01; -asmparsernum since Debian 8 (Jessie); -clang-component since Arch Linux 2026-11-01; -class since Debian 8 (Jessie); -combiners since Arch Linux 2026-11-01; -d since Arch Linux 2026-11-01; -debug since Arch Linux 2026-11-01; -dialect since Arch Linux 2026-11-01; -dialect-opclass-base since Arch Linux 2026-11-01; -dump-json since Debian 10 (Buster); -gen-arm-bf16 since Arch Linux 2026-11-01; -gen-arm-cde-builtin-aliases since Arch Linux 2026-11-01; -gen-arm-cde-builtin-codegen since Arch Linux 2026-11-01; -gen-arm-cde-builtin-def since Arch Linux 2026-11-01; -gen-arm-cde-builtin-sema since Arch Linux 2026-11-01; -gen-arm-cde-header since Arch Linux 2026-11-01; -gen-arm-fp16 since Arch Linux 2026-11-01; -gen-arm-immcheck-types since Arch Linux 2026-11-01; -gen-arm-mve-builtin-aliases since Arch Linux 2026-11-01; -gen-arm-mve-builtin-codegen since Arch Linux 2026-11-01; -gen-arm-mve-builtin-def since Arch Linux 2026-11-01; -gen-arm-mve-builtin-sema since Arch Linux 2026-11-01; -gen-arm-mve-header since Arch Linux 2026-11-01; -gen-arm-neon since Arch Linux 2026-11-01; -gen-arm-neon-sema since Arch Linux 2026-11-01; -gen-arm-neon-test since Arch Linux 2026-11-01; -gen-arm-sve-builtin-codegen since Arch Linux 2026-11-01; -gen-arm-sve-builtins since Arch Linux 2026-11-01; -gen-arm-sve-header since Arch Linux 2026-11-01; -gen-arm-sve-sema-rangechecks since Arch Linux 2026-11-01; -gen-arm-sve-typeflags since Arch Linux 2026-11-01; -gen-asm-matcher since Debian 8 (Jessie); -gen-asm-parser since Arch Linux 2026-11-01; -gen-attr-docs since Arch Linux 2026-11-01; -gen-attrs since Arch Linux 2026-11-01; -gen-automata since Arch Linux 2026-11-01; -gen-avail-interface-decls since Arch Linux 2026-11-01; -gen-avail-interface-defs since Arch Linux 2026-11-01; -gen-callingconv since Arch Linux 2026-11-01; -gen-clang-attr-ast-visitor since Arch Linux 2026-11-01; -gen-clang-attr-classes since Arch Linux 2026-11-01; -gen-clang-attr-has-attribute-impl since Arch Linux 2026-11-01; -gen-clang-attr-impl since Arch Linux 2026-11-01; -gen-clang-attr-node-traverse since Arch Linux 2026-11-01; -gen-clang-attr-parsed-attr-impl since Arch Linux 2026-11-01; -gen-clang-attr-parsed-attr-kinds since Arch Linux 2026-11-01; -gen-clang-attr-parsed-attr-list since Arch Linux 2026-11-01; -gen-clang-attr-parser-string-switches since Arch Linux 2026-11-01; -gen-clang-attr-pch-read since Arch Linux 2026-11-01; -gen-clang-attr-pch-write since Arch Linux 2026-11-01; -gen-clang-attr-spelling-index since Arch Linux 2026-11-01; -gen-clang-attr-subject-match-rule-list since Arch Linux 2026-11-01; -gen-clang-attr-subject-match-rules-parser-string-switches since Arch Linux 2026-11-01; -gen-clang-attr-template-instantiate since Arch Linux 2026-11-01; -gen-clang-attr-text-node-dump since Arch Linux 2026-11-01; -gen-clang-basic-reader since Arch Linux 2026-11-01; -gen-clang-basic-writer since Arch Linux 2026-11-01; -gen-clang-comment-command-info since Arch Linux 2026-11-01; -gen-clang-comment-command-list since Arch Linux 2026-11-01; -gen-clang-comment-html-named-character-references since Arch Linux 2026-11-01; -gen-clang-comment-html-tags since Arch Linux 2026-11-01; -gen-clang-comment-html-tags-properties since Arch Linux 2026-11-01; -gen-clang-comment-nodes since Arch Linux 2026-11-01; -gen-clang-data-collectors since Arch Linux 2026-11-01; -gen-clang-decl-nodes since Arch Linux 2026-11-01; -gen-clang-diag-groups since Arch Linux 2026-11-01; -gen-clang-diags-defs since Arch Linux 2026-11-01; -gen-clang-diags-index-name since Arch Linux 2026-11-01; -gen-clang-opcodes since Arch Linux 2026-11-01; -gen-clang-opencl-builtins since Arch Linux 2026-11-01; -gen-clang-sa-checkers since Arch Linux 2026-11-01; -gen-clang-stmt-nodes since Arch Linux 2026-11-01; -gen-clang-test-pragma-attribute-supported-attributes since Arch Linux 2026-11-01; -gen-clang-type-nodes since Arch Linux 2026-11-01; -gen-clang-type-reader since Arch Linux 2026-11-01; -gen-clang-type-writer since Arch Linux 2026-11-01; -gen-compress-inst-emitter since Arch Linux 2026-11-01; -gen-ctags since Arch Linux 2026-11-01; -gen-dfa-packetizer since Debian 8 (Jessie); -gen-diag-docs since Arch Linux 2026-11-01; -gen-dialect-doc since Arch Linux 2026-11-01; -gen-directive-decl since Arch Linux 2026-11-01; -gen-directive-gen since Arch Linux 2026-11-01; -gen-directive-impl since Arch Linux 2026-11-01; -gen-disassembler since Debian 8 (Jessie); -gen-enum-decls since Arch Linux 2026-11-01; -gen-enum-defs since Arch Linux 2026-11-01; -gen-enum-from-llvmir-conversions since Arch Linux 2026-11-01; -gen-enum-to-llvmir-conversions since Arch Linux 2026-11-01; -gen-exegesis since Arch Linux 2026-11-01; -gen-fast-isel since Debian 8 (Jessie); -gen-global-isel since Arch Linux 2026-11-01; -gen-global-isel-combiner since Arch Linux 2026-11-01; -gen-instr-docs since Arch Linux 2026-11-01; -gen-instr-info since Debian 8 (Jessie); -gen-intrinsic-enums since Debian 10 (Buster); -gen-intrinsic-impl since Debian 10 (Buster); -gen-llvmir-conversions since Arch Linux 2026-11-01; -gen-llvmir-intrinsics since Arch Linux 2026-11-01; -gen-op-decls since Arch Linux 2026-11-01; -gen-op-defs since Arch Linux 2026-11-01; -gen-op-doc since Arch Linux 2026-11-01; -gen-opt-docs since Arch Linux 2026-11-01; -gen-opt-parser-defs since Arch Linux 2026-11-01; -gen-opt-rst since Arch Linux 2026-11-01; -gen-pass-decls since Arch Linux 2026-11-01; -gen-pass-doc since Arch Linux 2026-11-01; -gen-pseudo-lowering since Debian 8 (Jessie); -gen-register-bank since Arch Linux 2026-11-01; -gen-register-info since Debian 8 (Jessie); -gen-rewriters since Arch Linux 2026-11-01; -gen-riscv-sifive-vector-builtin-codegen since Arch Linux 2026-11-01; -gen-riscv-sifive-vector-builtins since Arch Linux 2026-11-01; -gen-riscv-vector-builtin-codegen since Arch Linux 2026-11-01; -gen-riscv-vector-builtins since Arch Linux 2026-11-01; -gen-riscv-vector-header since Arch Linux 2026-11-01; -gen-searchable-tables since Arch Linux 2026-11-01; -gen-spirv-avail-impls since Arch Linux 2026-11-01; -gen-spirv-capability-implication since Arch Linux 2026-11-01; -gen-spirv-enum-avail-decls since Arch Linux 2026-11-01; -gen-spirv-enum-avail-defs since Arch Linux 2026-11-01; -gen-spirv-op-utils since Arch Linux 2026-11-01; -gen-spirv-serialization since Arch Linux 2026-11-01; -gen-struct-attr-decls since Arch Linux 2026-11-01; -gen-struct-attr-defs since Arch Linux 2026-11-01; -gen-typedef-decls since Arch Linux 2026-11-01; -gen-typedef-defs since Arch Linux 2026-11-01; -gen-x86-EVEX2VEX-tables since Arch Linux 2026-11-01; -gen-x86-fold-tables since Arch Linux 2026-11-01; -gicombiner-debug-cxxpreds since Arch Linux 2026-11-01; -gicombiner-stop-after-parse since Arch Linux 2026-11-01; -gisel-coverage-file since Arch Linux 2026-11-01; -help since Debian 7 (Wheezy); -help-list since Arch Linux 2026-11-01; -instrument-coverage since Arch Linux 2026-11-01; -instrument-gisel-coverage since Arch Linux 2026-11-01; -intrinsic-prefix since Arch Linux 2026-11-01; -llvmir-intrinsics-filter since Arch Linux 2026-11-01; -long-string-literals since Arch Linux 2026-11-01; -match-prefix since Arch Linux 2026-11-01; -name since Arch Linux 2026-11-01; -null-backend since Arch Linux 2026-11-01; -omit-comments since Arch Linux 2026-11-01; -op-exclude-regex since Arch Linux 2026-11-01; -op-include-regex since Arch Linux 2026-11-01; -optimize-match-table since Arch Linux 2026-11-01; -print-detailed-records since Arch Linux 2026-11-01; -print-sets since Debian 8 (Jessie); -register-info-debug since Arch Linux 2026-11-01; -stats since Arch Linux 2026-11-01; -time-phases since Arch Linux 2026-11-01; -typedefs-dialect since Arch Linux 2026-11-01; -warn-on-skipped-patterns since Arch Linux 2026-11-01; -write-if-changed since Arch Linux 2026-11-01.

--help until Debian 6.0 (Squeeze); -gen-enhanced-disassembly-info until Debian 10 (Buster); -gen-instr-desc until Debian 7 (Wheezy); -gen-instr-enums until Debian 7 (Wheezy); -gen-intrinsic until Debian 9 (Stretch); -gen-register-desc until Debian 7 (Wheezy); -gen-register-desc-header until Debian 7 (Wheezy); -gen-register-enums until Debian 7 (Wheezy); -gen-tgt-intrinsic until Debian 10 (Buster).