Assessments
This section contains answers to the questions from all chapters.
Chapter 6, Extending the Preprocessor
- Most of the time tokens are harvested from the provided source code, but in some cases, tokens might be generated dynamically inside the Preprocessor. For example, the __LINE__ built-in macro is expanded to the current line number, and the __DATE__ macro is expanded to the current calendar date. How does Clang put that generated textual content into the SourceManager's source code buffer? How does Clang assign SourceLocation to these tokens?
- Developers can leverage the clang::ScratchBuffer class to insert dynamic Token instances.
- When we were talking about implementing a custom PragmaHandler, we were using Preprocessor::Lex to ...
Get LLVM Techniques, Tips, and Best Practices Clang and Middle-End Libraries now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.