mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-24 04:42:41 +00:00
This re-lands #8001 (reverted in #8009 after accidentally merging with earlier unmerged PRs in the stack). Build on the plan-based emission to make function definitions cover a more representative breadth of the language: class-typed local variables, and local variables declared with destructuring. This requires some complexity to initialize and manage the class type variables, but ultimately should make all of our compile time benchmark data more representative by covering a more realistic breadth of the language surface. Claude's rough sampling of Carbon, Clang, and LLVM source suggests class types range from 30% to 80% of the locals, and structured bindings range from 0.2% to 2%. When synthesizing, we target approximately 50% of declarations as class types and 2% as destructurings as we anticipate destructuring to be of growing popularity and so want to ensure we're measuring any overhead there. Assisted-by: Claude Code and Antigravity with Gemini Co-authored-by: Geoff Romer <gromer@google.com>