Thanks for using Compiler Explorer
Sponsors
Jakt
C++
Ada
Analysis
Android Java
Android Kotlin
Assembly
C
C3
Carbon
C++ (Circle)
CIRCT
Clean
CMake
CMakeScript
COBOL
C++ for OpenCL
MLIR
Cppx
Cppx-Blue
Cppx-Gold
Cpp2-cppfront
Crystal
C#
CUDA C++
D
Dart
Elixir
Erlang
Fortran
F#
GLSL
Go
Haskell
HLSL
Hook
Hylo
IL
ispc
Java
Julia
Kotlin
LLVM IR
LLVM MIR
Modula-2
Nim
Objective-C
Objective-C++
OCaml
OpenCL C
Pascal
Pony
Python
Racket
Ruby
Rust
Snowball
Scala
Solidity
Spice
SPIR-V
Swift
LLVM TableGen
Toit
TypeScript Native
V
Vala
Visual Basic
WASM
Zig
Javascript
GIMPLE
Ygen
tablegen source #1
Output
Compile to binary object
Link to binary
Execute the code
Intel asm syntax
Demangle identifiers
Verbose demangling
Filters
Unused labels
Library functions
Directives
Comments
Horizontal whitespace
Debug intrinsics
Compiler
LLVM TableGen (trunk)
LLVM TableGen 17.0.1
LLVM TableGen 18.1.0
LLVM TableGen 19.1.0
Options
Source code
// This example uses the Searchable Tables backend, aka --gen-searchable-tables. // To choose the backend, select it as the "Action" in the "Overrides" menu, // or add "--gen-searchable-tables" to the compiler options. // For more details: // https://llvm.org/docs/TableGen/BackEnds.html#searchabletables-reference include "llvm/TableGen/SearchableTable.td" class Pair<string name, int value> : SearchableTable { let SearchableFields = ["Name", "Value"]; let EnumValueField = "Value"; string Name = name; bits<2> Value = value; } def : Pair<"Example 0", 0b00>; def : Pair<"Example 1", 0b01>; def : Pair<"Example 2", 0b10>; def : Pair<"Example 3", 0b11>;
Become a Patron
Sponsor on GitHub
Donate via PayPal
Source on GitHub
Mailing list
Installed libraries
Wiki
Report an issue
How it works
Contact the author
CE on Mastodon
About the author
Statistics
Changelog
Version tree