Day 01 of 30 · Compiler foundations

Understand what a compiler does

Time
About 150 minutes: 40 reading, 80 lab, 20 testing, 10 notes.
Prerequisites
None. Start here.

Toolchain: LLVM 17

Use your LLVM 17 clang++, llvm-as and opt for book exercises, by explicit path. Use the matching archived documentation. Do not mix headers, libraries or plugins with your current-main build. Setup guide

Learn

  • Source code, frontend, intermediate representation, optimizer, backend, assembler and linker.

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. Use the pipeline commands in the setup section on a five-line C++ function.
  2. Save preprocessed source, LLVM IR, assembly and an object file.
  3. Write one sentence explaining each output.

Done when

A pipeline note and four output files; distinguish compiling from linking.

Recall question

Why can the same frontend support more than one processor?

Optional

  • Inspect the driver commands with clang++ -###.

Optional work never counts toward completion.

Completion checks

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

Required to complete day 01
Optional (not counted)

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