binutils-gdb/gdb/features
Simon Marchi a8d2e5856f 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.
2017-12-21 18:21:45 -05:00
..
arm Do not emit "field_type" var if not needed on "maint print c-tdesc" 2017-12-21 18:21:45 -05:00
i386 Do not emit "field_type" var if not needed on "maint print c-tdesc" 2017-12-21 18:21:45 -05:00
rs6000 Do not emit "field_type" var if not needed on "maint print c-tdesc" 2017-12-21 18:21:45 -05:00
sparc
aarch64-core.c Do not emit "field_type" var if not needed on "maint print c-tdesc" 2017-12-21 18:21:45 -05:00
aarch64-core.xml
aarch64-fpu.c Do not emit "field_type" var if not needed on "maint print c-tdesc" 2017-12-21 18:21:45 -05:00
aarch64-fpu.xml
aarch64.xml
arc-arcompact.c Do not emit "field_type" var if not needed on "maint print c-tdesc" 2017-12-21 18:21:45 -05:00
arc-arcompact.xml
arc-v2.c Do not emit "field_type" var if not needed on "maint print c-tdesc" 2017-12-21 18:21:45 -05:00
arc-v2.xml
btrace-conf.dtd
btrace.dtd
feature_to_c.sh
gdb-target.dtd
gdbserver-regs.xsl
library-list-aix.dtd
library-list-svr4.dtd
library-list.dtd
m68k-core.xml
Makefile gdb: Add OpenRISC or1k and or1knd target support 2017-12-12 23:36:00 +09:00
microblaze-core.xml
microblaze-stack-protect.xml
microblaze-with-stack-protect.c
microblaze-with-stack-protect.xml
microblaze.c
microblaze.xml
mips64-cp0.xml
mips64-cpu.xml
mips64-dsp-linux.c
mips64-dsp-linux.xml
mips64-dsp.xml
mips64-fpu.xml
mips64-linux.c
mips64-linux.xml
mips-cp0.xml
mips-cpu.xml
mips-dsp-linux.c
mips-dsp-linux.xml
mips-dsp.xml
mips-fpu.xml
mips-linux.c
mips-linux.xml
nds32-core.xml
nds32-fpu.xml
nds32-system.xml
nds32.c
nds32.xml
nios2-cpu.xml
nios2-linux.xml
nios2.c
nios2.xml
number-regs.xsl
or1k-core.xml gdb: Add OpenRISC or1k and or1knd target support 2017-12-12 23:36:00 +09:00
or1k.c Do not emit "field_type" var if not needed on "maint print c-tdesc" 2017-12-21 18:21:45 -05:00
or1k.xml gdb: Add OpenRISC or1k and or1knd target support 2017-12-12 23:36:00 +09:00
osdata.dtd
s390-acr.xml
s390-core32.xml
s390-core64.xml
s390-fpr.xml
s390-gs-linux64.c Do not emit "field_type" var if not needed on "maint print c-tdesc" 2017-12-21 18:21:45 -05:00
s390-gs-linux64.xml S390: Add guarded-storage register definitions and tdescs 2017-09-25 16:02:23 +02:00
s390-gs.xml S390: Add guarded-storage register definitions and tdescs 2017-09-25 16:02:23 +02:00
s390-gsbc.xml S390: Add guarded-storage register definitions and tdescs 2017-09-25 16:02:23 +02:00
s390-linux32.c
s390-linux32.xml
s390-linux32v1.c
s390-linux32v1.xml
s390-linux32v2.c
s390-linux32v2.xml
s390-linux64.c
s390-linux64.xml
s390-linux64v1.c
s390-linux64v1.xml
s390-linux64v2.c
s390-linux64v2.xml
s390-tdb.xml
s390-te-linux64.c
s390-te-linux64.xml
s390-tevx-linux64.c Do not emit "field_type" var if not needed on "maint print c-tdesc" 2017-12-21 18:21:45 -05:00
s390-tevx-linux64.xml
s390-vx-linux64.c Do not emit "field_type" var if not needed on "maint print c-tdesc" 2017-12-21 18:21:45 -05:00
s390-vx-linux64.xml
s390-vx.xml
s390x-core64.xml
s390x-gs-linux64.c Do not emit "field_type" var if not needed on "maint print c-tdesc" 2017-12-21 18:21:45 -05:00
s390x-gs-linux64.xml S390: Add guarded-storage register definitions and tdescs 2017-09-25 16:02:23 +02:00
s390x-linux64.c
s390x-linux64.xml
s390x-linux64v1.c
s390x-linux64v1.xml
s390x-linux64v2.c
s390x-linux64v2.xml
s390x-te-linux64.c
s390x-te-linux64.xml
s390x-tevx-linux64.c Do not emit "field_type" var if not needed on "maint print c-tdesc" 2017-12-21 18:21:45 -05:00
s390x-tevx-linux64.xml
s390x-vx-linux64.c Do not emit "field_type" var if not needed on "maint print c-tdesc" 2017-12-21 18:21:45 -05:00
s390x-vx-linux64.xml
sort-regs.xsl
threads.dtd
tic6x-c6xp.c Change tic6x target descriptions 2017-11-24 09:29:43 +00:00
tic6x-c6xp.xml
tic6x-c62x-linux.xml
tic6x-c64x-linux.xml
tic6x-c64xp-linux.xml
tic6x-core.c Change tic6x target descriptions 2017-11-24 09:29:43 +00:00
tic6x-core.xml
tic6x-gp.c Change tic6x target descriptions 2017-11-24 09:29:43 +00:00
tic6x-gp.xml
traceframe-info.dtd
xinclude.dtd