Adding C++ modules-ts to the GNU Compiler
summary
Implements the Modules TS inside GCC by producing a serialized front‑end AST as a Binary Module Interface (BMI) cache rather than reparsing headers, adds a new module linkage class (module‑local vs external) mapped into mangled ELF symbols, and changes name lookup using per‑module bitmaps and inline‑namespace tricks. Free functions and many class features work; templates, full class members, enums and build‑system BMI discovery are unfinished. Not planned for GCC 8; BMI format is compiler‑version sensitive.
AI-written summary · about
chapters (18)
- 0:00C++ Modules
- 4:04Modules TS Goals
- 5:36Semantics & Syntax
- 6:52Module Interface
- 9:02Module Implementation
- 15:17Source Files and Build Artifacts
- 18:35GCC Development
- 21:36Lookup
- 22:12Initial Thought
- 25:49Module Representation
- 27:41Binary Representation
- 30:14Streaming
- 32:32Application Binary Interface
- 33:27What Should Work?
- 40:02Binary Module Files • Module Foo's binary module is needed for
- 42:37What Works? (mid 2017)
- 43:52To Do
- 54:54Imports and Exports • Modules can import other modules
related talks
59mC++ Modules
01h 01mPractical C++ Modules
01h 10m“C++ Modules: The State of The Union"
58mKnockin' on Header's Door: An Overview of C++ Modules
59m“There and Back Again: An Incremental C++ Modules Design"
49mConverting to C++20 Modules
32mVisibility, Reachability, Linkage – The Three Secret Spices of C++ Modules
01h 11mA Practical Introduction to C++20's Modules
