Day 12 of 30 · LLVM IR

Connect IR learning to the C++ compiler

Checkpoint B
Time
About 150 minutes: 40 reading, 80 lab, 20 testing, 10 notes.
Prerequisites
Day 10: Compile and run a tiny program

Toolchain: LLVM 17 and current main

Today touches both toolchains. Keep separate build directories and explicit executable paths: LLVM 17 for book exercises, build/bin/clang++ from current main for Clang work. Setup guide

Learn

  • C++ frontend responsibilities versus target-independent optimization.

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. Dump the Clang AST for a struct, function call and overloaded function.
  2. Compare AST and IR for one example.
  3. Freeze the toy project with a README and known limitations; move your main attention to Clang.

Done when

Checkpoint B: explain source → AST → IR → executable and identify which stage a C++ type error belongs to.

Recall question

Why is writing an LLVM IR optimization pass not the same task as changing C++ overload resolution?

Completion checks

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

Required to complete day 12

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