Do not emit "field_type" var if not needed on "maint print c-tdesc"
authorSimon Marchi <simon.marchi@ericsson.com>
Thu, 21 Dec 2017 23:19:17 +0000 (18:19 -0500)
committerSimon Marchi <simon.marchi@ericsson.com>
Thu, 21 Dec 2017 23:21:45 +0000 (18:21 -0500)
commita8d2e5856f87a658d69018fe1ccd56482eebdd59
treec0be42e8971a0df710ad9c19ff59a2fb53fba725
parent27e9ff87a627614fda7ddd89ddef745de5e988bb
Do not emit "field_type" var if not needed on "maint print c-tdesc"

While fiddling a bit with -Wunused-variable, Sergio noticed that "maint
print c-tdesc" was always generating code for the "tdesc_type
*field_type" variable, even when it wasn't used.  This is caught by GCC
when using -Wunused-variable, of course.

This patch changes the print_c_tdesc class to only output the field
declaration when we actually need it.

It shouldn't be necessary to do the same with the other variable
declarations (type_with_fields and element_type), because they are
always if they are declared.

The C files in features/ are regenerated, some declarations of
field_type are removed, as expected, while some others move to where
they are used for the first time.

gdb/ChangeLog:

* target-descriptions.c (print_c_tdesc) <visit>: Don't output
field_type declaration, use printf_field_type_assignment
instead.
<printf_field_type_assignment>: New method.
* features/aarch64-core.c, features/aarch64-fpu.c
features/arc-arcompact.c, features/arc-v2.c,
features/arm/arm-with-iwmmxt.c, features/i386/32bit-core.c,
features/i386/32bit-mpx.c, features/i386/32bit-sse.c,
features/i386/64bit-avx512.c, features/i386/64bit-core.c,
features/i386/64bit-mpx.c, features/i386/64bit-sse.c,
features/i386/x32-core.c, features/or1k.c,
features/rs6000/powerpc-7400.c,
features/rs6000/powerpc-altivec32.c,
features/rs6000/powerpc-altivec32l.c,
features/rs6000/powerpc-altivec64.c,
features/rs6000/powerpc-altivec64l.c,
features/rs6000/powerpc-cell32l.c,
features/rs6000/powerpc-cell64l.c,
features/rs6000/powerpc-isa205-altivec32l.c,
features/rs6000/powerpc-isa205-altivec64l.c,
features/rs6000/powerpc-isa205-vsx32l.c,
features/rs6000/powerpc-isa205-vsx64l.c,
features/rs6000/powerpc-vsx32.c,
features/rs6000/powerpc-vsx32l.c,
features/rs6000/powerpc-vsx64.c,
features/rs6000/powerpc-vsx64l.c, features/s390-gs-linux64.c,
features/s390-tevx-linux64.c, features/s390-vx-linux64.c,
features/s390x-gs-linux64.c, features/s390x-tevx-linux64.c,
features/s390x-vx-linux64.c: Re-generate.
37 files changed:
gdb/ChangeLog
gdb/features/aarch64-core.c
gdb/features/aarch64-fpu.c
gdb/features/arc-arcompact.c
gdb/features/arc-v2.c
gdb/features/arm/arm-with-iwmmxt.c
gdb/features/i386/32bit-core.c
gdb/features/i386/32bit-mpx.c
gdb/features/i386/32bit-sse.c
gdb/features/i386/64bit-avx512.c
gdb/features/i386/64bit-core.c
gdb/features/i386/64bit-mpx.c
gdb/features/i386/64bit-sse.c
gdb/features/i386/x32-core.c
gdb/features/or1k.c
gdb/features/rs6000/powerpc-7400.c
gdb/features/rs6000/powerpc-altivec32.c
gdb/features/rs6000/powerpc-altivec32l.c
gdb/features/rs6000/powerpc-altivec64.c
gdb/features/rs6000/powerpc-altivec64l.c
gdb/features/rs6000/powerpc-cell32l.c
gdb/features/rs6000/powerpc-cell64l.c
gdb/features/rs6000/powerpc-isa205-altivec32l.c
gdb/features/rs6000/powerpc-isa205-altivec64l.c
gdb/features/rs6000/powerpc-isa205-vsx32l.c
gdb/features/rs6000/powerpc-isa205-vsx64l.c
gdb/features/rs6000/powerpc-vsx32.c
gdb/features/rs6000/powerpc-vsx32l.c
gdb/features/rs6000/powerpc-vsx64.c
gdb/features/rs6000/powerpc-vsx64l.c
gdb/features/s390-gs-linux64.c
gdb/features/s390-tevx-linux64.c
gdb/features/s390-vx-linux64.c
gdb/features/s390x-gs-linux64.c
gdb/features/s390x-tevx-linux64.c
gdb/features/s390x-vx-linux64.c
gdb/target-descriptions.c
This page took 0.039146 seconds and 4 git commands to generate.