- Add constant array support for __builtin_dump_sturct, the style like lldb
struct:
struct S { int x; int y : 4; int : 0; int b[2][2]; float f; struct T { int i; } t; struct { int i; } foo; struct Bar { int x; const char *B; } bar[2]; };
output:
struct S { int x = 100 int y : 4 = 1 int : 0 int[2][2] b = [ [0] = [ [0] = 1 [1] = 2 ] [1] = [ [0] = 3 [1] = 4 ] ] float f = 0.000000 struct T { int i = 2022 } struct S::(unnamed) { int i = 4096 } struct Bar[2] bar = [ [0] = { int x = 1024 const char * B = This is struct Bar[0] } [1] = { int x = 2048 const char * B = This is struct Bar[1] } ] }
- beautify dump format, add indent.
for example:
struct:
struct A { int a; struct B { int b; struct C { struct D { int d; union E { int x; int y; } e; } d; int c; } c; } b; };
Before:
struct A { int a = 0 struct B { int b = 0 struct C { struct D { int d = 0 union E { int x = 0 int y = 0 } } int c = 0 } } }
After:
struct A { int a = 0 struct B { int b = 0 struct C { struct D { int d = 0 union E { int x = 0 int y = 0 } } int c = 0 } } }
- Remove anonymous tag locations, powered by 'PrintingPolicy'
struct:
struct S { int a; struct /* Anonymous*/ { int x; } b; int c; };
Before:
struct S { int a = 0 struct S::(unnamed at ./builtin_dump_struct.c:20:3) { int x = 0 } int c = 0 }
After:
struct S { int a = 0 struct S::(unnamed) { int x = 0 } int c = 0 }
What is this from/for? Is this left over from a previous patch?