C++ Insights: Peek behind the curtains of your C++ compiler
summary
C++ Insights is a clang AST-based, open‑source tool that performs source‑to‑source transforms so the compiler’s hidden work appears as valid C++ code. It makes default parameters visible (showing three separate std::string allocations in an example), exposes padding and cache effects (a reorder shrinks a struct to 64 bytes and drops runtime from ~1.9 ms), and provides object lifetime visualization including coroutine frame rewrites and where temporaries dangle. It uses clang front end, has hand‑rolled transforms for coroutines, and runs locally via Docker.
AI-written summary · about
chapters (15)
- 0:00Introduction
- 1:20C++ Insights overview
- 3:58Technical architecture
- 11:39Handling templates
- 14:35Abstract Syntax Tree
- 16:57Transformation types
- 20:32Default parameters
- 23:58Padding and alignment
- 29:16Object lifetime
- 36:02Advanced lifetime analysis
- 45:35C++ 20 aggregate initialization
- 49:55Reference parameters
- 50:52Coroutines
- 53:21Explicit object parameters
- 56:56Conclusion and Q&A
related talks
58mC++ Insights: See your source code with the eyes of a compiler
01h 08mReflections: Compile-time Introspection of Source Code
01h 16m“What Has My Compiler Done for Me Lately? Unbolting the Compiler's Lid”
34mWhat happens to your code when you don't look?
01h 25mPeeking Into Your Compiler
51mCompile-time tools supporting generic programming in C++
50mC++ Costless Abstractions: the compiler view
46mBuilding a C++ Reflection System in One Weekend Using Clang and LLVM
