Day 14 of 30 · Clang frontend
Inspect C++ AST nodes and types
- Time
- About 150 minutes: 40 reading, 80 lab, 20 testing, 10 notes.
- Prerequisites
- Day 13: Navigate the Clang source tree
Toolchain: current-main build
Use build/bin/clang++ and build/bin/llvm-lit from your llvm-main checkout, not whichever clang++ is first on PATH. Reproduce upstream behavior on current main and record the commit SHA. Setup guide
Learn
- Declarations, expressions, implicit conversions and QualType.
Read Reading
- R8 · Introduction to the Clang AST
AST nodes and context · 20 min - R9 · Clang internals manual
Types and AST sections · 20 min
Reading budgets cover selected sections, not whole chapters. Link to the book; this site does not reproduce it.
Build Build or investigate
- Create three small C++ files using references, overloads and const qualification.
- Dump each AST with current-main Clang.
- Find
FunctionDecl,VarDecl,DeclRefExprandImplicitCastExprwhere applicable. - Use the checkout’s declarations to understand unfamiliar nodes.
Done when
Three annotated examples and a note explaining one implicit conversion.
Recall question
What information would be lost if you kept only the spelling of an expression?
Completion checks
Progress tracking needs JavaScript. The lesson above is complete without it.
Notes
Saved only in this browser. Keep it short enough to finish in ten minutes; none of the prompts are required. All notes, export and import