Day 13 of 30 · Clang frontend

Navigate the Clang source tree

Time
About 150 minutes: 40 reading, 80 lab, 20 testing, 10 notes.
Prerequisites
Day 02: Prepare a reproducible learning environment, Day 12: Connect IR learning to the C++ compiler

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

  • Lex, Parse, AST, Sema, Basic and CodeGen.

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. Locate clang/lib/Lex, Parse, AST, Sema and CodeGen, plus clang/include/clang/Basic and clang/test.
  2. Search for a diagnostic you can trigger.
  3. Follow its definition to a caller.
  4. Keep a source map with paths and one responsibility each.

Done when

A source map and one diagnostic traced from output text into implementation.

Recall question

Which directories would you investigate for a valid program rejected during type checking?

Completion checks

Progress tracking needs JavaScript. The lesson above is complete without it.

Required to complete day 13

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