mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 22:02:23 +01:00
Because this is an `__attribute__((used))` method in a templated base class it forces a _huge_ amount of template instantiation in every translation unit. Often this was just printing the members of the type, which is still useful in some cases (such as test output), but adds no value in the debugger. A more successful pattern for dumping has been namespace level functions, and particularly static ones that more transparently don't expand the non-debugger API surface. Add the few missing functions there that cover `Printable` types with more interesting contents. For several of these, it just gives us a "dump the whole thing" function as a compliment to "dump this entity in the thing". These probably aren't especially high value, but moving them here they become cheap, so I've left them in. For a couple, this expands the rich dumping support of SemIR constructs, which should be substantially more useful than the previous `Dump` behavior. This reduces `check` cumulative object file size by another 14%. Assisted-by: Antigravity with Gemini