-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

LLVM Techniques, Tips, and Best Practices Clang and Middle-End Libraries
By :

In the previous, Working with SourceLocation and SourceManager section, we've learned how source locations, which are an important part of the preprocessor, are represented in Clang. In this section, we will first explain the principle of Clang's preprocessor and lexer, along with their working flow. Then, we'll go into some of the important components in this flow and briefly explain their usage in the code. These will also prepare you for the project in the, Developing custom preprocessor plugins and callbacks section later in this chapter.
The roles and primary actions performed by Clang's preprocessor and lexer, represented by the Preprocessor
and Lexer
classes respectively, are illustrated in the following diagram:
Figure 6.1 – Role of the Clang preprocessor and lexer
We believe most readers here will be familiar with...