The TableGen Language
Large parts of backends in LLVM are written in the TableGen language, a special language used to generate fragments of C++ source code to avoid implementing code similar for each backend and to shorten the amount of source code. Having knowledge of TableGen is therefore important.
In this chapter, you will learn the following:
- In Understanding the TableGen language, you will learn about the main idea behind TableGen
- In Experimenting with the TableGen language, you will define your own TableGen classes and records, and learn the syntax of the TableGen language
- In Generating C++ code from a TableGen file, you will develop your own TableGen backend
- Drawbacks of TableGen
By the end of the chapter, you will be able to use existing TableGen classes to define your own records. You will also acquire knowledge of how to create TableGen classes and records from scratch, and how to develop a TableGen backend to emit source code.