[clang] Implement -ftype-print-limit=N (PR #239419)

Eli Friedman via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 5 15:46:12 PST 2026


https://github.com/efriedma-quic commented:

I think the question of what we should do in LLVM IR is separate from the question of what we want diagnostics to look like.

If types are expensive to print for LLVM IR, we should cut them down aggressively; the user will never see those types, unless they're digging into LLVM IR by hand.  We can disambiguate with numbered suffixes like .1/.2/etc.

For printing types for users to read, I think we want some sort of depth-based heuristic; if you have `X<Y<1,2,3,4,5,6,[...]>, Z<int>>`, the `Z<int>` is more likely to be relevant than printing more arguments to Y.

https://github.com/llvm/llvm-project/pull/239419


More information about the cfe-commits mailing list