Thanks for @rsmith to point this. I'm sorry for introducing this bug.
See @rsmith 's comment in https://reviews.llvm.org/D122248
Eg:(By @rsmith ) https://godbolt.org/z/o7vcbWaEf
I have added a test case
struct:
struct U19A { int a; }; struct U19B { struct U19A a; }; struct U19B a = { .a.a = 2022 };
Dump result:
struct U19B { struct U19A a = { int a = 2022 } }
Instead of passing a flag that suppresses the first section of this function, it would be clearer to split this up into two parts:
Then when printing the overall value, you can call (1) then (2), and when printing each field, you can call (1), then print the field name, then call (2) for a struct value (and do whatever else makes sense for other kinds of values).