Summary
In this chapter, we described the Clang frontend. We explained the distinction between the Clang frontend libraries, the compiler driver, and the actual compiler in the clang -cc1 tool. We also talked about diagnostics and introduced a small libclang program to dump them. Next, we went touring through all steps of the frontend: lexer, parser, semantic analysis, and code generation by showing how Clang implements these stages. Finally, we finished the chapter with an example of how to write a simple compiler driver that activates all frontend stages. If you are interested in reading more about the AST, a good community document is at http://clang.llvm.org/docs/IntroductionToTheClangAST.html. If you are interested in reading more about the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access