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

Reading budgets cover selected sections, not whole chapters. Link to the book; this site does not reproduce it.

Build Build or investigate

  1. Create three small C++ files using references, overloads and const qualification.
  2. Dump each AST with current-main Clang.
  3. Find FunctionDecl, VarDecl, DeclRefExpr and ImplicitCastExpr where applicable.
  4. 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.

Required to complete day 14

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