752 lines · plain
1tblgen - Description to C++ Code2================================3 4.. program:: tblgen5 6SYNOPSIS7--------8 9:program:`clang-tblgen` [*options*] [*filename*]10 11:program:`lldb-tblgen` [*options*] [*filename*]12 13:program:`llvm-tblgen` [*options*] [*filename*]14 15:program:`mlir-tblgen` [*options*] [*filename*]16 17DESCRIPTION18-----------19 20:program:`*-tblgen` is a family of programs that translates target21description (``.td``) files into C++ code and other output formats. Most22users of LLVM will not need to use this program. It is used only for23writing parts of the compiler, debugger, and LLVM target backends.24 25The details of the input and output of the :program:`*-tblgen` programs is26beyond the scope of this short introduction; please see the :doc:`TableGen27Overview <../TableGen/index>` for an introduction and for references to28additional TableGen documents.29 30The *filename* argument specifies the name of the Target Description (``.td``)31file that TableGen processes.32 33OPTIONS34-------35 36General Options37~~~~~~~~~~~~~~~38 39.. option:: -help40 41 Print a description of the command line options.42 43.. option:: -help-list44 45 Print a description of the command line options in a simple list format.46 47.. option:: -D=macroname48 49 Specify the name of a macro to be defined. The name is defined, but it50 has no particular value.51 52.. option:: -d=filename53 54 Specify the name of the dependency filename.55 56.. option:: -debug57 58 Enable debug output.59 60.. option:: -dump-json61 62 Print a JSON representation of all records, suitable for further63 automated processing.64 65.. option:: -I directory66 67 Specify where to find other target description files for inclusion. The68 ``directory`` value should be a full or partial path to a directory that69 contains target description files.70 71.. option:: -null-backend72 73 Parse the source files and build the records, but do not run any74 backend. This is useful for timing the frontend.75 76.. option:: -o filename77 78 Specify the output file name. If ``filename`` is ``-``, then79 :program:`*-tblgen` sends its output to standard output.80 81.. option:: -print-records82 83 Print all classes and records to standard output (default backend option).84 85.. option:: -print-detailed-records86 87 Print a detailed report of all global variables, classes, and records88 to standard output.89 90.. option:: -stats91 92 Print a report with any statistics collected by the backend.93 94.. option:: -time-phases95 96 Time the parser and backend phases and print a report.97 98.. option:: -version99 100 Show the version number of the program.101 102.. option:: -write-if-changed103 104 Write the output file only if it is new or has changed.105 106 107clang-tblgen Options108~~~~~~~~~~~~~~~~~~~~109 110.. option:: -gen-clang-attr-classes111 112 Generate Clang attribute classes.113 114.. option:: -gen-clang-attr-parser-string-switches115 116 Generate all parser-related attribute string switches.117 118.. option:: -gen-clang-attr-subject-match-rules-parser-string-switches119 120 Generate all parser-related attribute subject match rule string switches.121 122.. option:: -gen-clang-attr-impl123 124 Generate Clang attribute implementations.125 126.. option:: -gen-clang-attr-list"127 128 Generate a Clang attribute list.129 130.. option:: -gen-clang-attr-subject-match-rule-list131 132 Generate a Clang attribute subject match rule list.133 134.. option:: -gen-clang-attr-pch-read135 136 Generate Clang PCH attribute reader.137 138.. option:: -gen-clang-attr-pch-write139 140 Generate Clang PCH attribute writer.141 142.. option:: -gen-clang-attr-has-attribute-impl143 144 Generate a Clang attribute spelling list.145 146.. option:: -gen-clang-attr-spelling-index147 148 Generate a Clang attribute spelling index.149 150.. option:: -gen-clang-attr-ast-visitor151 152 Generate a recursive AST visitor for Clang attributes.153 154.. option:: -gen-clang-attr-template-instantiate155 156 Generate a Clang template instantiate code.157 158.. option:: -gen-clang-attr-parsed-attr-list159 160 Generate a Clang parsed attribute list.161 162.. option:: -gen-clang-attr-parsed-attr-impl163 164 Generate the Clang parsed attribute helpers.165 166.. option:: -gen-clang-attr-parsed-attr-kinds167 168 Generate a Clang parsed attribute kinds.169 170.. option:: -gen-clang-attr-text-node-dump171 172 Generate Clang attribute text node dumper.173 174.. option:: -gen-clang-attr-node-traverse175 176 Generate Clang attribute traverser.177 178.. option:: -gen-clang-diags-defs179 180 Generate Clang diagnostics definitions.181 182.. option:: -clang-component component183 184 Only use warnings from specified component.185 186.. option:: -gen-clang-diag-groups187 188 Generate Clang diagnostic groups.189 190.. option:: -gen-clang-diags-index-name191 192 Generate Clang diagnostic name index.193 194.. option:: -gen-clang-basic-reader195 196 Generate Clang BasicReader classes.197 198.. option:: -gen-clang-basic-writer199 200 Generate Clang BasicWriter classes.201 202.. option:: -gen-clang-comment-nodes203 204 Generate Clang AST comment nodes.205 206.. option:: -gen-clang-decl-nodes207 208 Generate Clang AST declaration nodes.209 210.. option:: -gen-clang-stmt-nodes211 212 Generate Clang AST statement nodes.213 214.. option:: -gen-clang-type-nodes215 216 Generate Clang AST type nodes.217 218.. option:: -gen-clang-type-reader219 220 Generate Clang AbstractTypeReader class.221 222.. option:: -gen-clang-type-writer223 224 Generate Clang AbstractTypeWriter class.225 226.. option:: -gen-clang-opcodes227 228 Generate Clang constexpr interpreter opcodes.229 230.. option:: -gen-clang-sa-checkers231 232 Generate Clang static analyzer checkers.233 234.. option:: -gen-clang-comment-html-tags235 236 Generate efficient matchers for HTML tag names that are used in237 documentation comments.238 239.. option:: -gen-clang-comment-html-tags-properties240 241 Generate efficient matchers for HTML tag properties.242 243.. option:: -gen-clang-comment-html-named-character-references244 245 Generate function to translate named character references to UTF-8 sequences.246 247.. option:: -gen-clang-comment-command-info248 249 Generate command properties for commands that are used in documentation comments.250 251.. option:: -gen-clang-comment-command-list252 253 Generate list of commands that are used in documentation comments.254 255.. option:: -gen-clang-opencl-builtins256 257 Generate OpenCL builtin declaration handlers.258 259.. option:: -gen-arm-neon260 261 Generate ``arm_neon.h`` for Clang.262 263.. option:: -gen-arm-fp16264 265 Generate ``arm_fp16.h`` for Clang.266 267.. option:: -gen-arm-bf16268 269 Generate ``arm_bf16.h`` for Clang.270 271.. option:: -gen-arm-neon-sema272 273 Generate ARM NEON sema support for Clang.274 275.. option:: -gen-arm-neon-test276 277 Generate ARM NEON tests for Clang.278 279.. option:: -gen-arm-immcheck-types280 281 Generate ``arm_immcheck_types.inc`` for Clang.282 283.. option:: -gen-arm-sve-header284 285 Generate ``arm_sve.h`` for Clang.286 287.. option:: -gen-arm-sve-builtins288 289 Generate ``arm_sve_builtins.inc`` for Clang.290 291.. option:: -gen-arm-sve-builtin-codegen292 293 Generate ``arm_sve_builtin_cg_map.inc`` for Clang.294 295.. option:: -gen-arm-sve-typeflags296 297 Generate ``arm_sve_typeflags.inc`` for Clang.298 299.. option:: -gen-arm-sve-sema-rangechecks300 301 Generate ``arm_sve_sema_rangechecks.inc`` for Clang.302 303.. option:: -gen-arm-mve-header304 305 Generate ``arm_mve.h`` for Clang.306 307.. option:: -gen-arm-mve-builtin-def308 309 Generate ARM MVE builtin definitions for Clang.310 311.. option:: -gen-arm-mve-builtin-sema312 313 Generate ARM MVE builtin sema checks for Clang.314 315.. option:: -gen-arm-mve-builtin-codegen316 317 Generate ARM MVE builtin code-generator for Clang.318 319.. option:: -gen-arm-mve-builtin-aliases320 321 Generate list of valid ARM MVE builtin aliases for Clang.322 323.. option:: -gen-arm-cde-header324 325 Generate ``arm_cde.h`` for Clang.326 327.. option:: -gen-arm-cde-builtin-def328 329 Generate ARM CDE builtin definitions for Clang.330 331.. option:: -gen-arm-cde-builtin-sema332 333 Generate ARM CDE builtin sema checks for Clang.334 335.. option:: -gen-arm-cde-builtin-codegen336 337 Generate ARM CDE builtin code-generator for Clang.338 339.. option:: -gen-arm-cde-builtin-aliases340 341 Generate list of valid ARM CDE builtin aliases for Clang.342 343.. option:: -gen-riscv-vector-header344 345 Generate ``riscv_vector.h`` for Clang.346 347.. option:: -gen-riscv-vector-builtins348 349 Generate ``riscv_vector_builtins.inc`` for Clang.350 351.. option:: -gen-riscv-vector-builtin-codegen352 353 Generate ``riscv_vector_builtin_cg.inc`` for Clang.354 355.. option:: -gen-riscv-sifive-vector-builtins356 357 Generate ``riscv_sifive_vector_builtins.inc`` for Clang.358 359.. option:: -gen-riscv-sifive-vector-builtin-codegen360 361 Generate ``riscv_sifive_vector_builtin_cg.inc`` for Clang.362 363.. option:: -gen-attr-docs364 365 Generate attribute documentation.366 367.. option:: -gen-diag-docs368 369 Generate diagnostic documentation.370 371.. option:: -gen-opt-docs372 373 Generate option documentation.374 375.. option:: -gen-clang-data-collectors376 377 Generate data collectors for AST nodes.378 379.. option:: -gen-clang-test-pragma-attribute-supported-attributes380 381 Generate a list of attributes supported by ``#pragma`` Clang attribute for382 testing purposes.383 384 385lldb-tblgen Options386~~~~~~~~~~~~~~~~~~~387 388.. option:: gen-lldb-option-defs389 390 Generate lldb OptionDefinition values.391 392.. option:: gen-lldb-property-defs393 394 Generate lldb PropertyDefinition values.395 396.. option:: gen-lldb-property-enum-defs397 398 Generate lldb PropertyDefinition enum values.399 400 401llvm-tblgen Options402~~~~~~~~~~~~~~~~~~~403 404.. option:: -gen-asm-matcher405 406 Generate assembly instruction matcher.407 408.. option:: -match-prefix=prefix409 410 Make -gen-asm-matcher match only instructions with the given *prefix*.411 412.. option:: -gen-asm-parser413 414 Generate assembly instruction parser.415 416.. option:: -asmparsernum=n417 418 Make -gen-asm-parser emit assembly parser number *n*.419 420.. option:: -gen-asm-writer421 422 Generate assembly writer.423 424.. option:: -asmwriternum=n425 426 Make -gen-asm-writer emit assembly writer number *n*.427 428.. option:: -gen-attrs429 430 Generate attributes.431 432.. option:: -gen-automata433 434 Generate generic automata.435 436.. option:: -gen-callingconv437 438 Generate calling convention descriptions.439 440.. option:: -gen-compress-inst-emitter441 442 Generate RISC-V compressed instructions.443 444.. option:: -gen-ctags445 446 Generate ctags-compatible index.447 448.. option:: -gen-dag-isel449 450 Generate a DAG (directed acyclic graph) instruction selector.451 452.. option:: -instrument-coverage453 454 Make -gen-dag-isel generate tables to help identify the patterns matched.455 456.. option:: -omit-comments457 458 Make -gen-dag-isel omit comments. The default is false.459 460.. option:: -gen-dfa-packetizer461 462 Generate DFA Packetizer for VLIW targets.463 464.. option:: -gen-directive-decl465 466 Generate directive related declaration code (header file).467 468.. option:: -gen-directive-gen469 470 Generate directive related implementation code part.471 472.. option:: -gen-directive-impl473 474 Generate directive related implementation code.475 476.. option:: -gen-disassembler477 478 Generate disassembler.479 480.. option:: -gen-emitter481 482 Generate machine code emitter.483 484.. option:: -gen-exegesis485 486 Generate llvm-exegesis tables.487 488.. option:: -gen-fast-isel489 490 Generate a "fast" instruction selector.491 492.. option:: -gen-global-isel493 494 Generate GlobalISel selector.495 496.. option:: -gisel-coverage-file=filename497 498 Specify the file from which to retrieve coverage information.499 500.. option:: -instrument-gisel-coverage501 502 Make -gen-global-isel generate coverage instrumentation.503 504.. option:: -optimize-match-table505 506 Make -gen-global-isel generate an optimized version of the match table.507 508.. option:: -warn-on-skipped-patterns509 510 Make -gen-global-isel explain why a pattern was skipped for inclusion.511 512.. option:: -gen-global-isel-combiner513 514 Generate GlobalISel combiner.515 516.. option:: -combiners=list517 518 Make -gen-global-isel-combiner emit the specified combiners.519 520.. option:: -gicombiner-debug-cxxpreds521 522 Add debug comments to all C++ predicates emitted by -gen-global-isel-combiner523 524.. option:: -gicombiner-stop-after-parse525 526 Make -gen-global-isel-combiner stop processing after parsing rules and dump state.527 528.. option:: -gen-instr-info529 530 Generate instruction descriptions.531 532.. option:: -gen-instr-docs533 534 Generate instruction documentation.535 536.. option:: -gen-intrinsic-enums537 538 Generate intrinsic enums.539 540.. option:: -intrinsic-prefix=prefix541 542 Make -gen-intrinsic-enums generate intrinsics with this target *prefix*.543 544.. option:: -gen-intrinsic-impl545 546 Generate intrinsic information.547 548.. option:: -gen-opt-parser-defs549 550 Generate options definitions.551 552.. option:: -gen-opt-rst553 554 Generate option RST.555 556.. option:: -gen-pseudo-lowering557 558 Generate pseudo instruction lowering.559 560.. option:: -gen-register-bank561 562 Generate register bank descriptions.563 564.. option:: -gen-register-info565 566 Generate registers and register classes info.567 568.. option:: -register-info-debug569 570 Make -gen-register-info dump register information for debugging.571 572.. option:: -gen-searchable-tables573 574 Generate generic searchable tables. See :doc:`TableGen BackEnds <../TableGen/BackEnds>`575 for a detailed description.576 577.. option:: -gen-subtarget578 579 Generate subtarget enumerations.580 581.. option:: -gen-x86-EVEX2VEX-tables582 583 Generate X86 EVEX to VEX compress tables.584 585.. option:: -gen-x86-fold-tables586 587 Generate X86 fold tables.588 589.. option:: -long-string-literals590 591 When emitting large string tables, prefer string literals over592 comma-separated char literals. This can be a readability and593 compile-time performance win, but upsets some compilers.594 595.. option:: -print-enums596 597 Print enumeration values for a class.598 599.. option:: -class=classname600 601 Make -print-enums print the enumeration list for the specified class.602 603.. option:: -print-sets604 605 Print expanded sets for testing DAG exprs.606 607 608mlir-tblgen Options609~~~~~~~~~~~~~~~~~~~610 611.. option:: -gen-avail-interface-decls612 613 Generate availability interface declarations.614 615.. option:: -gen-avail-interface-defs616 617 Generate op interface definitions.618 619.. option:: -gen-dialect-doc620 621 Generate dialect documentation.622 623.. option:: -dialect624 625 The dialect to generate.626 627.. option:: -gen-directive-decl628 629 Generate declarations for directives (OpenMP, etc.).630 631.. option:: -gen-enum-decls632 633 Generate enum utility declarations.634 635.. option:: -gen-enum-defs636 637 Generate enum utility definitions.638 639.. option:: -gen-enum-from-llvmir-conversions640 641 Generate conversions of EnumAttrs from LLVM IR.642 643.. option:: -gen-enum-to-llvmir-conversions644 645 Generate conversions of EnumAttrs to LLVM IR.646 647.. option:: -gen-llvmir-conversions648 649 Generate LLVM IR conversions.650 651.. option:: -gen-llvmir-intrinsics652 653 Generate LLVM IR intrinsics.654 655.. option:: -llvmir-intrinsics-filter656 657 Only keep the intrinsics with the specified substring in their record name.658 659.. option:: -dialect-opclass-base660 661 The base class for the ops in the dialect we are to emit.662 663.. option:: -gen-op-decls664 665 Generate operation declarations.666 667.. option:: -gen-op-defs668 669 Generate operation definitions.670 671.. option:: -asmformat-error-is-fatal672 673 Emit a fatal error if format parsing fails.674 675.. option:: -op-exclude-regex676 677 Regular expression of name of ops to exclude (no filter if empty).678 679.. option:: -op-include-regex680 681 Regular expression of name of ops to include (no filter if empty).682 683.. option:: -gen-op-doc684 685 Generate operation documentation.686 687.. option:: -gen-pass-decls688 689 Generate operation documentation.690 691.. option:: -name namestring692 693 The name of this group of passes.694 695.. option:: -gen-pass-doc696 697 Generate pass documentation.698 699.. option:: -gen-rewriters700 701 Generate pattern rewriters.702 703.. option:: -gen-spirv-avail-impls704 705 Generate SPIR-V operation utility definitions.706 707.. option:: -gen-spirv-capability-implication708 709 Generate utility function to return implied capabilities for a given capability.710 711.. option:: -gen-spirv-enum-avail-decls712 713 Generate SPIR-V enum availability declarations.714 715.. option:: -gen-spirv-enum-avail-defs716 717 Generate SPIR-V enum availability definitions.718 719.. option:: -gen-spirv-op-utils720 721 Generate SPIR-V operation utility definitions.722 723.. option:: -gen-spirv-serialization724 725 Generate SPIR-V (de)serialization utilities and functions.726 727.. option:: -gen-struct-attr-decls728 729 Generate struct utility declarations.730 731.. option:: -gen-struct-attr-defs732 733 Generate struct utility definitions.734 735.. option:: -gen-typedef-decls736 737 Generate TypeDef declarations.738 739.. option:: -gen-typedef-defs740 741 Generate TypeDef definitions.742 743.. option:: -typedefs-dialect name744 745 Generate types for this dialect.746 747EXIT STATUS748-----------749 750If :program:`*-tblgen` succeeds, it will exit with 0. Otherwise, if an error751occurs, it will exit with a non-zero value.752