misc: Enforce .[ch].inc extension for re-included .c/.h files
v2 cover misc: Enforce .[ch].inc extension for re-included .c/.h files
Since v1:
- addressed Richard's easy review comments
Richard, this is what I had before looking at removing exec/helper*. Posting in case it is useful enough before getting there.
--
Follow the convention to use the .inc extension for .c/.h files re-included, as docummented in Coding Style since commit 6a0057aa22:
If you do use template header files they should be named with the ``.c.inc`` or ``.h.inc`` suffix to make it clear they are being included for expansion.
Most of the codebase already uses this extension:
$ git ls-files | fgrep .inc | wc -l
155Rename some files left over.
Philippe Mathieu-Daudé (5):
hw/remote/proxy: Remove dubious 'event_notifier-posix.c' include tests/tcg/aarch64: Rename bti-crt.inc.c -> bti-crt.c.inc target/arm: Rename helper template headers as '.h.inc' target/i386: Rename helper template headers as '.h.inc'
target: Bulk rename 'helper.h' -> 'helper.h.inc' for all targets
include/exec/helper-gen.h | 2 +-
include/exec/helper-proto.h | 2 +-
target/alpha/{helper.h => tcg/helper.h.inc} | 0
target/arm/tcg/{helper-a64.h => helper-a64.h.inc} | 0
target/arm/tcg/{helper-mve.h => helper-mve.h.inc} | 0
target/arm/tcg/{helper-sme.h => helper-sme.h.inc} | 0
target/arm/tcg/{helper-sve.h => helper-sve.h.inc} | 0
target/arm/{helper.h => tcg/helper.h.inc} | 8 ++++----
target/avr/{helper.h => tcg/helper.h.inc} | 0
target/cris/{helper.h => tcg/helper.h.inc} | 0
target/hexagon/{helper.h => tcg/helper.h.inc} | 0
target/hppa/{helper.h => tcg/helper.h.inc} | 0
.../{cc_helper_template.h => cc_helper_template.h.inc} | 0
target/i386/{helper.h => tcg/helper.h.inc} | 6 +++---
.../i386/{ops_sse_header.h => tcg/ops_sse_header.h.inc} | 0
.../shift_helper_template.h.inc} | 0
target/loongarch/{helper.h => tcg/helper.h.inc} | 0
target/m68k/{helper.h => tcg/helper.h.inc} | 0
target/microblaze/{helper.h => tcg/helper.h.inc} | 0
target/mips/{helper.h => tcg/helper.h.inc} | 0
target/nios2/{helper.h => tcg/helper.h.inc} | 0
target/openrisc/{helper.h => tcg/helper.h.inc} | 0
target/ppc/{helper.h => tcg/helper.h.inc} | 0
target/riscv/{helper.h => tcg/helper.h.inc} | 0
target/rx/{helper.h => tcg/helper.h.inc} | 0
target/s390x/{helper.h => tcg/helper.h.inc} | 0
target/sh4/{helper.h => tcg/helper.h.inc} | 0
target/sparc/{helper.h => tcg/helper.h.inc} | 0
target/tricore/{helper.h => tcg/helper.h.inc} | 0
target/xtensa/{helper.h => tcg/helper.h.inc} | 0
hw/remote/proxy.c | 1 -
target/alpha/translate.c | 2 +-
target/arm/tcg/translate.c | 2 +-
target/avr/translate.c | 2 +-
target/cris/translate.c | 2 +-
target/hexagon/translate.c | 2 +-
target/hppa/translate.c | 2 +-
target/i386/tcg/cc_helper.c | 8 ++++----
target/i386/tcg/int_helper.c | 8 ++++----
target/i386/tcg/translate.c | 2 +-
target/loongarch/translate.c | 2 +-
target/m68k/translate.c | 2 +-
target/microblaze/translate.c | 2 +-
target/mips/tcg/translate.c | 2 +-
target/nios2/translate.c | 2 +-
target/openrisc/translate.c | 2 +-
target/ppc/translate.c | 2 +-
target/riscv/translate.c | 2 +-
target/rx/translate.c | 2 +-
target/s390x/tcg/translate.c | 2 +-
target/sh4/translate.c | 2 +-
target/sparc/translate.c | 2 +-
target/tricore/translate.c | 2 +-
target/xtensa/translate.c | 2 +-
tests/tcg/aarch64/bti-1.c | 2 +-
tests/tcg/aarch64/bti-3.c | 2 +-
tests/tcg/aarch64/{bti-crt.inc.c => bti-crt.c.inc} | 0
57 files changed, 40 insertions(+), 41 deletions(-)
rename target/alpha/{helper.h => tcg/helper.h.inc} (100%)
rename target/arm/tcg/{helper-a64.h => helper-a64.h.inc} (100%)
rename target/arm/tcg/{helper-mve.h => helper-mve.h.inc} (100%)
rename target/arm/tcg/{helper-sme.h => helper-sme.h.inc} (100%)
rename target/arm/tcg/{helper-sve.h => helper-sve.h.inc} (100%)
rename target/arm/{helper.h => tcg/helper.h.inc} (99%)
rename target/avr/{helper.h => tcg/helper.h.inc} (100%)
rename target/cris/{helper.h => tcg/helper.h.inc} (100%)
rename target/hexagon/{helper.h => tcg/helper.h.inc} (100%)
rename target/hppa/{helper.h => tcg/helper.h.inc} (100%)
rename target/i386/tcg/{cc_helper_template.h => cc_helper_template.h.inc} (100%)
rename target/i386/{helper.h => tcg/helper.h.inc} (98%)
rename target/i386/{ops_sse_header.h => tcg/ops_sse_header.h.inc} (100%)
rename target/i386/{shift_helper_template.h => tcg/shift_helper_template.h.inc} (100%)
rename target/loongarch/{helper.h => tcg/helper.h.inc} (100%)
rename target/m68k/{helper.h => tcg/helper.h.inc} (100%)
rename target/microblaze/{helper.h => tcg/helper.h.inc} (100%)
rename target/mips/{helper.h => tcg/helper.h.inc} (100%)
rename target/nios2/{helper.h => tcg/helper.h.inc} (100%)
rename target/openrisc/{helper.h => tcg/helper.h.inc} (100%)
rename target/ppc/{helper.h => tcg/helper.h.inc} (100%)
rename target/riscv/{helper.h => tcg/helper.h.inc} (100%)
rename target/rx/{helper.h => tcg/helper.h.inc} (100%)
rename target/s390x/{helper.h => tcg/helper.h.inc} (100%)
rename target/sh4/{helper.h => tcg/helper.h.inc} (100%)
rename target/sparc/{helper.h => tcg/helper.h.inc} (100%)
rename target/tricore/{helper.h => tcg/helper.h.inc} (100%)
rename target/xtensa/{helper.h => tcg/helper.h.inc} (100%)
rename tests/tcg/aarch64/{bti-crt.inc.c => bti-crt.c.inc} (100%)Signature · 1 line
2.38.1
PATCH v2 1/5 hw/remote/proxy: Remove dubious 'event_notifier-posix.c' include
event_notifier-posix.c is registered in meson's util_ss[] source set, which is built as libqemuutil.a.p library. Both tools and system emulation binaries are linked with qemuutil, so there is no point in including this source file.
Introduced in commit bd36adb8df ("multi-process: create IOHUB object to handle irq").
---
Note, --enable-multiprocess doesn't seem to be covered in CI.
--- hw/remote/proxy.c | 1 - 1 file changed, 1 deletion(-)
hw/remote/proxy.c +0 -1
@@ -22,7 +22,6 @@#include "qom/object.h" #include "qemu/event_notifier.h" #include "sysemu/kvm.h" -#include "util/event_notifier-posix.c" static void probe_pci_info (PCIDevice *dev,Error **errp);static void proxy_device_reset (DeviceState *dev);
Signature · 1 line
2.38.1
Re: [PATCH v2 1/5] hw/remote/proxy: Remove dubious 'event_notifier-posix.c' include
Quoted 20 lines · Philippe Mathieu-Daudé
event_notifier-posix.cis registered in meson's util_ss[] source set, which is built as libqemuutil.a.p library. Both tools and system emulation binaries are linked with qemuutil, so there is no point in including this source file.Introduced in commit
bd36adb8df("multi-process: create IOHUB object to handle irq").Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
Note, --enable-multiprocess doesn't seem to be covered in CI.--- hw/remote/proxy.c | 1 - 1 file changed, 1 deletion(-)hw/remote/proxy.c +0
-0
hw/remote/proxy.c line 25
Quoted 4 lines
hw/remote/proxy.c +0
-1@@ -22,7 +22,6 @@#include "qom/object.h" #include "qemu/event_notifier.h" #include "sysemu/kvm.h" -#include "util/event_notifier-posix.c"
Err wrong branch base, please discard this patch which is already in Paolo's queue.
PATCH v2 2/5 tests/tcg/aarch64: Rename bti-crt.inc.c -> bti-crt.c.inc
In reply to Philippe Mathieu-DaudéSince commit 139c1837db ("meson: rename included C source files to .c.inc"), QEMU standard procedure for included C files is to use *.c.inc.
Besides, since commit 6a0057aa22 ("docs/devel: make a statement about includes") this is documented as the Coding Style:
If you do use template header files they should be named with the ``.c.inc`` or ``.h.inc`` suffix to make it clear they are being included for expansion.
Therefore rename 'bti-crt.inc.c' as 'bti-crt.c.inc'.
---
tests/tcg/aarch64/bti-1.c | 2 +-
tests/tcg/aarch64/bti-3.c | 2 +-
tests/tcg/aarch64/{bti-crt.inc.c => bti-crt.c.inc} | 0
3 files changed, 2 insertions(+), 2 deletions(-)
rename tests/tcg/aarch64/{bti-crt.inc.c => bti-crt.c.inc} (100%)tests/tcg/aarch64/bti-1.c +1 -1
@@ -2,7 +2,7 @@* Branch target identification, basic notskip cases. */ -#include "bti-crt.inc.c" +#include "bti-crt.c.inc" static void skip2_sigill (int sig,siginfo_t *info,ucontext_t *uc) {
tests/tcg/aarch64/bti-3.c +1 -1
@@ -2,7 +2,7 @@* BTI vs PACIASP */ -#include "bti-crt.inc.c" +#include "bti-crt.c.inc" static void skip2_sigill (int sig,siginfo_t *info,ucontext_t *uc) {
tests/tcg/aarch64/bti-crt.c.inc renamed from tests/tcg/aarch64/bti-crt.inc.c +0 -0
Signature · 1 line
2.38.1
PATCH v2 3/5 target/arm: Rename helper template headers as '.h.inc'
In reply to Philippe Mathieu-DaudéSince commit 139c1837db ("meson: rename included C source files to .c.inc"), QEMU standard procedure for included C files is to use *.c.inc.
Besides, since commit 6a0057aa22 ("docs/devel: make a statement about includes") this is documented as the Coding Style:
If you do use template header files they should be named with the ``.c.inc`` or ``.h.inc`` suffix to make it clear they are being included for expansion.
Therefore rename the included templates as '.h.inc'.
---
target/arm/helper.h | 8 ++++----
target/arm/tcg/{helper-a64.h => helper-a64.h.inc} | 0
target/arm/tcg/{helper-mve.h => helper-mve.h.inc} | 0
target/arm/tcg/{helper-sme.h => helper-sme.h.inc} | 0
target/arm/tcg/{helper-sve.h => helper-sve.h.inc} | 0
5 files changed, 4 insertions(+), 4 deletions(-)
rename target/arm/tcg/{helper-a64.h => helper-a64.h.inc} (100%)
rename target/arm/tcg/{helper-mve.h => helper-mve.h.inc} (100%)
rename target/arm/tcg/{helper-sme.h => helper-sme.h.inc} (100%)
rename target/arm/tcg/{helper-sve.h => helper-sve.h.inc} (100%)target/arm/helper.h +4 -4
@@ -1039,9 +1039,9 @@ DEF_HELPER_FLAGS_5(gvec_uclamp_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) #ifdef TARGET_AARCH64 -#include "tcg/helper-a64.h" -#include "tcg/helper-sve.h" -#include "tcg/helper-sme.h" +#include "tcg/helper-a64.h.inc" +#include "tcg/helper-sve.h.inc" +#include "tcg/helper-sme.h.inc" #endif -#include "tcg/helper-mve.h" +#include "tcg/helper-mve.h.inc"
target/arm/tcg/helper-a64.h.inc renamed from target/arm/tcg/helper-a64.h +0 -0
target/arm/tcg/helper-mve.h.inc renamed from target/arm/tcg/helper-mve.h +0 -0
target/arm/tcg/helper-sme.h.inc renamed from target/arm/tcg/helper-sme.h +0 -0
target/arm/tcg/helper-sve.h.inc renamed from target/arm/tcg/helper-sve.h +0 -0
Signature · 1 line
2.38.1
PATCH v2 4/5 target/i386: Rename helper template headers as '.h.inc'
In reply to Philippe Mathieu-DaudéSince commit 139c1837db ("meson: rename included C source files to .c.inc"), QEMU standard procedure for included C files is to use *.c.inc.
Besides, since commit 6a0057aa22 ("docs/devel: make a statement about includes") this is documented as the Coding Style:
If you do use template header files they should be named with the ``.c.inc`` or ``.h.inc`` suffix to make it clear they are being included for expansion.
Therefore move the included templates in the tcg/ directory and rename as '.h.inc'.
---
target/i386/helper.h | 6 +++---
.../{cc_helper_template.h => cc_helper_template.h.inc} | 0
.../i386/{ops_sse_header.h => tcg/ops_sse_header.h.inc} | 0
.../shift_helper_template.h.inc} | 0
target/i386/tcg/cc_helper.c | 8 ++++----
target/i386/tcg/int_helper.c | 8 ++++----
6 files changed, 11 insertions(+), 11 deletions(-)
rename target/i386/tcg/{cc_helper_template.h => cc_helper_template.h.inc} (100%)
rename target/i386/{ops_sse_header.h => tcg/ops_sse_header.h.inc} (100%)
rename target/i386/{shift_helper_template.h => tcg/shift_helper_template.h.inc} (100%)target/i386/helper.h +3 -3
@@ -203,11 +203,11 @@ DEF_HELPER_1(enter_mmx, void, env) DEF_HELPER_1(emms, void, env)#define SHIFT 0 -#include "ops_sse_header.h" +#include "tcg/ops_sse_header.h.inc" #define SHIFT 1 -#include "ops_sse_header.h" +#include "tcg/ops_sse_header.h.inc" #define SHIFT 2 -#include "ops_sse_header.h" +#include "tcg/ops_sse_header.h.inc" DEF_HELPER_3(rclb, tl, env, tl, tl)DEF_HELPER_3 (rclw, tl, env, tl, tl)
target/i386/tcg/cc_helper_template.h.inc renamed from target/i386/tcg/cc_helper_template.h +0 -0
target/i386/tcg/ops_sse_header.h.inc renamed from target/i386/ops_sse_header.h +0 -0
target/i386/tcg/shift_helper_template.h.inc renamed from target/i386/shift_helper_template.h +0 -0
target/i386/tcg/cc_helper.c +4 -4
@@ -58,21 +58,21 @@ const uint8_t parity_table[256] = { };#define SHIFT 0 -#include "cc_helper_template.h" +#include "cc_helper_template.h.inc" #undef SHIFT#define SHIFT 1 -#include "cc_helper_template.h" +#include "cc_helper_template.h.inc" #undef SHIFT#define SHIFT 2 -#include "cc_helper_template.h" +#include "cc_helper_template.h.inc" #undef SHIFT#ifdef TARGET_X86_64 #define SHIFT 3 -#include "cc_helper_template.h" +#include "cc_helper_template.h.inc" #undef SHIFT#endif
target/i386/tcg/int_helper.c +4 -4
@@ -448,20 +448,20 @@ target_ulong helper_pext(target_ulong src, target_ulong mask) }#define SHIFT 0 -#include "shift_helper_template.h" +#include "shift_helper_template.h.inc" #undef SHIFT#define SHIFT 1 -#include "shift_helper_template.h" +#include "shift_helper_template.h.inc" #undef SHIFT#define SHIFT 2 -#include "shift_helper_template.h" +#include "shift_helper_template.h.inc" #undef SHIFT#ifdef TARGET_X86_64 #define SHIFT 3 -#include "shift_helper_template.h" +#include "shift_helper_template.h.inc" #undef SHIFT#endif
Signature · 1 line
2.38.1
PATCH v2 5/5 target: Bulk rename 'helper.h' -> 'helper.h.inc' for all targets
In reply to Philippe Mathieu-DaudéSince commit 139c1837db ("meson: rename included C source files to .c.inc"), QEMU standard procedure for included C files is to use *.c.inc.
Besides, since commit 6a0057aa22 ("docs/devel: make a statement about includes") this is documented as the Coding Style:
If you do use template header files they should be named with the ``.c.inc`` or ``.h.inc`` suffix to make it clear they are being included for expansion.
Therefore rename the included 'helper.h' as 'helper.h.inc' for all targets (updating the documentation).
Unfortunately since the HELPER_H path definition is used by all targets, we have to do all changes in a single bulk commit.
Mechanical change doing:
$ for t_a in target/*; do \
if test -f ${t_a}/helper.h; then \
mkdir -p ${t_a}/tcg; \
git mv ${t_a}/helper.h ${t_a}/tcg/helper.h.inc; \
fi; \
done
$ sed -i \
-e 's#define HELPER_H "helper.h"#define HELPER_H "tcg/helper.h.inc"#' \
$(git grep -l 'define HELPER_H')then manually updating files in include/exec/ and docs/.
---
include/exec/helper-gen.h | 2 +-
include/exec/helper-proto.h | 2 +-
target/alpha/{helper.h => tcg/helper.h.inc} | 0
target/arm/{helper.h => tcg/helper.h.inc} | 0
target/avr/{helper.h => tcg/helper.h.inc} | 0
target/cris/{helper.h => tcg/helper.h.inc} | 0
target/hexagon/{helper.h => tcg/helper.h.inc} | 0
target/hppa/{helper.h => tcg/helper.h.inc} | 0
target/i386/{helper.h => tcg/helper.h.inc} | 0
target/loongarch/{helper.h => tcg/helper.h.inc} | 0
target/m68k/{helper.h => tcg/helper.h.inc} | 0
target/microblaze/{helper.h => tcg/helper.h.inc} | 0
target/mips/{helper.h => tcg/helper.h.inc} | 0
target/nios2/{helper.h => tcg/helper.h.inc} | 0
target/openrisc/{helper.h => tcg/helper.h.inc} | 0
target/ppc/{helper.h => tcg/helper.h.inc} | 0
target/riscv/{helper.h => tcg/helper.h.inc} | 0
target/rx/{helper.h => tcg/helper.h.inc} | 0
target/s390x/{helper.h => tcg/helper.h.inc} | 0
target/sh4/{helper.h => tcg/helper.h.inc} | 0
target/sparc/{helper.h => tcg/helper.h.inc} | 0
target/tricore/{helper.h => tcg/helper.h.inc} | 0
target/xtensa/{helper.h => tcg/helper.h.inc} | 0
target/alpha/translate.c | 2 +-
target/arm/tcg/translate.c | 2 +-
target/avr/translate.c | 2 +-
target/cris/translate.c | 2 +-
target/hexagon/translate.c | 2 +-
target/hppa/translate.c | 2 +-
target/i386/tcg/translate.c | 2 +-
target/loongarch/translate.c | 2 +-
target/m68k/translate.c | 2 +-
target/microblaze/translate.c | 2 +-
target/mips/tcg/translate.c | 2 +-
target/nios2/translate.c | 2 +-
target/openrisc/translate.c | 2 +-
target/ppc/translate.c | 2 +-
target/riscv/translate.c | 2 +-
target/rx/translate.c | 2 +-
target/s390x/tcg/translate.c | 2 +-
target/sh4/translate.c | 2 +-
target/sparc/translate.c | 2 +-
target/tricore/translate.c | 2 +-
target/xtensa/translate.c | 2 +-
44 files changed, 23 insertions(+), 23 deletions(-)
rename target/alpha/{helper.h => tcg/helper.h.inc} (100%)
rename target/arm/{helper.h => tcg/helper.h.inc} (100%)
rename target/avr/{helper.h => tcg/helper.h.inc} (100%)
rename target/cris/{helper.h => tcg/helper.h.inc} (100%)
rename target/hexagon/{helper.h => tcg/helper.h.inc} (100%)
rename target/hppa/{helper.h => tcg/helper.h.inc} (100%)
rename target/i386/{helper.h => tcg/helper.h.inc} (100%)
rename target/loongarch/{helper.h => tcg/helper.h.inc} (100%)
rename target/m68k/{helper.h => tcg/helper.h.inc} (100%)
rename target/microblaze/{helper.h => tcg/helper.h.inc} (100%)
rename target/mips/{helper.h => tcg/helper.h.inc} (100%)
rename target/nios2/{helper.h => tcg/helper.h.inc} (100%)
rename target/openrisc/{helper.h => tcg/helper.h.inc} (100%)
rename target/ppc/{helper.h => tcg/helper.h.inc} (100%)
rename target/riscv/{helper.h => tcg/helper.h.inc} (100%)
rename target/rx/{helper.h => tcg/helper.h.inc} (100%)
rename target/s390x/{helper.h => tcg/helper.h.inc} (100%)
rename target/sh4/{helper.h => tcg/helper.h.inc} (100%)
rename target/sparc/{helper.h => tcg/helper.h.inc} (100%)
rename target/tricore/{helper.h => tcg/helper.h.inc} (100%)
rename target/xtensa/{helper.h => tcg/helper.h.inc} (100%)include/exec/helper-gen.h +1 -1
@@ -9,7 +9,7 @@#include "exec/helper-gen-common.h" -#define HELPER_H "helper.h" +#define HELPER_H "tcg/helper.h.inc"#include "exec/helper-gen.h.inc" #undef HELPER_H
include/exec/helper-proto.h +1 -1
@@ -9,7 +9,7 @@#include "exec/helper-proto-common.h" -#define HELPER_H "helper.h" +#define HELPER_H "tcg/helper.h.inc"#include "exec/helper-proto.h.inc" #undef HELPER_H
target/alpha/tcg/helper.h.inc renamed from target/alpha/helper.h +0 -0
target/arm/tcg/helper.h.inc renamed from target/arm/helper.h +0 -0
target/avr/tcg/helper.h.inc renamed from target/avr/helper.h +0 -0
target/cris/tcg/helper.h.inc renamed from target/cris/helper.h +0 -0
target/hexagon/tcg/helper.h.inc renamed from target/hexagon/helper.h +0 -0
target/hppa/tcg/helper.h.inc renamed from target/hppa/helper.h +0 -0
target/i386/tcg/helper.h.inc renamed from target/i386/helper.h +0 -0
target/loongarch/tcg/helper.h.inc renamed from target/loongarch/helper.h +0 -0
target/m68k/tcg/helper.h.inc renamed from target/m68k/helper.h +0 -0
target/microblaze/tcg/helper.h.inc renamed from target/microblaze/helper.h +0 -0
target/mips/tcg/helper.h.inc renamed from target/mips/helper.h +0 -0
target/nios2/tcg/helper.h.inc renamed from target/nios2/helper.h +0 -0
target/openrisc/tcg/helper.h.inc renamed from target/openrisc/helper.h +0 -0
target/ppc/tcg/helper.h.inc renamed from target/ppc/helper.h +0 -0
target/riscv/tcg/helper.h.inc renamed from target/riscv/helper.h +0 -0
target/rx/tcg/helper.h.inc renamed from target/rx/helper.h +0 -0
target/s390x/tcg/helper.h.inc renamed from target/s390x/helper.h +0 -0
target/sh4/tcg/helper.h.inc renamed from target/sh4/helper.h +0 -0
target/sparc/tcg/helper.h.inc renamed from target/sparc/helper.h +0 -0
target/tricore/tcg/helper.h.inc renamed from target/tricore/helper.h +0 -0
target/xtensa/tcg/helper.h.inc renamed from target/xtensa/helper.h +0 -0
target/alpha/translate.c +1 -1
@@ -30,7 +30,7 @@#include "exec/translator.h" #include "exec/log.h" -#define HELPER_H "helper.h" +#define HELPER_H "tcg/helper.h.inc"#include "exec/helper-info.c.inc" #undef HELPER_H
target/arm/tcg/translate.c +1 -1
@@ -29,7 +29,7 @@#include "cpregs.h" #include "exec/helper-proto.h" -#define HELPER_H "helper.h" +#define HELPER_H "tcg/helper.h.inc"#include "exec/helper-info.c.inc" #undef HELPER_H
target/avr/translate.c +1 -1
@@ -30,7 +30,7 @@#include "exec/log.h" #include "exec/translator.h" -#define HELPER_H "helper.h" +#define HELPER_H "tcg/helper.h.inc"#include "exec/helper-info.c.inc" #undef HELPER_H
target/cris/translate.c +1 -1
@@ -37,7 +37,7 @@#include "exec/helper-gen.h" #include "exec/log.h" -#define HELPER_H "helper.h" +#define HELPER_H "tcg/helper.h.inc"#include "exec/helper-info.c.inc" #undef HELPER_H
target/hexagon/translate.c +1 -1
@@ -33,7 +33,7 @@#include "genptr.h" #include "printinsn.h" -#define HELPER_H "helper.h" +#define HELPER_H "tcg/helper.h.inc"#include "exec/helper-info.c.inc" #undef HELPER_H
target/hppa/translate.c +1 -1
@@ -29,7 +29,7 @@#include "exec/translator.h" #include "exec/log.h" -#define HELPER_H "helper.h" +#define HELPER_H "tcg/helper.h.inc"#include "exec/helper-info.c.inc" #undef HELPER_H
target/i386/tcg/translate.c +1 -1
@@ -34,7 +34,7 @@#include "exec/log.h" -#define HELPER_H "helper.h" +#define HELPER_H "tcg/helper.h.inc"#include "exec/helper-info.c.inc" #undef HELPER_H
target/loongarch/translate.c +1 -1
@@ -23,7 +23,7 @@TCGv cpu_gpr[32 ], cpu_pc;static TCGv cpu_lladdr, cpu_llval; -#define HELPER_H "helper.h" +#define HELPER_H "tcg/helper.h.inc"#include "exec/helper-info.c.inc" #undef HELPER_H
target/m68k/translate.c +1 -1
@@ -34,7 +34,7 @@#include "exec/log.h" #include "fpu/softfloat.h" -#define HELPER_H "helper.h" +#define HELPER_H "tcg/helper.h.inc"#include "exec/helper-info.c.inc" #undef HELPER_H
target/microblaze/translate.c +1 -1
@@ -31,7 +31,7 @@#include "exec/log.h" -#define HELPER_H "helper.h" +#define HELPER_H "tcg/helper.h.inc"#include "exec/helper-info.c.inc" #undef HELPER_H
target/mips/tcg/translate.c +1 -1
@@ -32,7 +32,7 @@#include "disas/disas.h" #include "fpu_helper.h" -#define HELPER_H "helper.h" +#define HELPER_H "tcg/helper.h.inc"#include "exec/helper-info.c.inc" #undef HELPER_H
target/nios2/translate.c +1 -1
@@ -34,7 +34,7 @@#include "qemu/qemu-print.h" #include "semihosting/semihost.h" -#define HELPER_H "helper.h" +#define HELPER_H "tcg/helper.h.inc"#include "exec/helper-info.c.inc" #undef HELPER_H
target/openrisc/translate.c +1 -1
@@ -34,7 +34,7 @@#include "exec/log.h" -#define HELPER_H "helper.h" +#define HELPER_H "tcg/helper.h.inc"#include "exec/helper-info.c.inc" #undef HELPER_H
target/ppc/translate.c +1 -1
@@ -41,7 +41,7 @@#include "qemu/qemu-print.h" #include "qapi/error.h" -#define HELPER_H "helper.h" +#define HELPER_H "tcg/helper.h.inc"#include "exec/helper-info.c.inc" #undef HELPER_H
target/riscv/translate.c +1 -1
@@ -33,7 +33,7 @@#include "instmap.h" #include "internals.h" -#define HELPER_H "helper.h" +#define HELPER_H "tcg/helper.h.inc"#include "exec/helper-info.c.inc" #undef HELPER_H
target/rx/translate.c +1 -1
@@ -28,7 +28,7 @@#include "exec/translator.h" #include "exec/log.h" -#define HELPER_H "helper.h" +#define HELPER_H "tcg/helper.h.inc"#include "exec/helper-info.c.inc" #undef HELPER_H
target/s390x/tcg/translate.c +1 -1
@@ -45,7 +45,7 @@#include "exec/log.h" #include "qemu/atomic128.h" -#define HELPER_H "helper.h" +#define HELPER_H "tcg/helper.h.inc"#include "exec/helper-info.c.inc" #undef HELPER_H
target/sh4/translate.c +1 -1
@@ -29,7 +29,7 @@#include "exec/log.h" #include "qemu/qemu-print.h" -#define HELPER_H "helper.h" +#define HELPER_H "tcg/helper.h.inc"#include "exec/helper-info.c.inc" #undef HELPER_H
target/sparc/translate.c +1 -1
@@ -33,7 +33,7 @@#include "exec/log.h" #include "asi.h" -#define HELPER_H "helper.h" +#define HELPER_H "tcg/helper.h.inc"#include "exec/helper-info.c.inc" #undef HELPER_H
target/tricore/translate.c +1 -1
@@ -33,7 +33,7 @@#include "exec/translator.h" #include "exec/log.h" -#define HELPER_H "helper.h" +#define HELPER_H "tcg/helper.h.inc"#include "exec/helper-info.c.inc" #undef HELPER_H
target/xtensa/translate.c +1 -1
@@ -45,7 +45,7 @@#include "exec/log.h" -#define HELPER_H "helper.h" +#define HELPER_H "tcg/helper.h.inc"#include "exec/helper-info.c.inc" #undef HELPER_H
Signature · 1 line
2.38.1
Re: [PATCH v2 5/5] target: Bulk rename 'helper.h' -> 'helper.h.inc' for all targets
Quoted 7 lines · Philippe Mathieu-Daudé
Since commit
139c1837db("meson: rename included C source files to .c.inc"), QEMU standard procedure for included C files is to use *.c.inc.Besides, since commit
6a0057aa22("docs/devel: make a statement about includes") this is documented as the Coding Style:
Quoted 6 lines
If you do use template header files they should be named with the ``.c.inc`` or ``.h.inc`` suffix to make it clear they are being included for expansion.
Therefore rename the included '
helper.h' as 'helper.h.inc' for all targets (
Missing:
"moving the headers which are not in the 'tcg/' subdirectory there and"
Quoted 87 lines
updating the documentation).
Unfortunately since the
HELPER_Hpath definition is used by all targets, we have to do all changes in a single bulk commit.Mechanical change doing:
$ for t_a in target/*; do \ if test -f ${t_a}/helper.h; then \ mkdir -p ${t_a}/tcg; \ git mv ${t_a}/helper.h ${t_a}/tcg/helper.h.inc; \ fi; \ done $ sed -i \ -e 's#define HELPER_H "helper.h"#define HELPER_H "tcg/helper.h.inc"#' \ $(git grep -l 'define HELPER_H')then manually updating files in
include/exec/and docs/.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- include/exec/helper-gen.h | 2 +- include/exec/helper-proto.h | 2 +- target/alpha/{helper.h => tcg/helper.h.inc} | 0 target/arm/{helper.h => tcg/helper.h.inc} | 0 target/avr/{helper.h => tcg/helper.h.inc} | 0 target/cris/{helper.h => tcg/helper.h.inc} | 0 target/hexagon/{helper.h => tcg/helper.h.inc} | 0 target/hppa/{helper.h => tcg/helper.h.inc} | 0 target/i386/{helper.h => tcg/helper.h.inc} | 0 target/loongarch/{helper.h => tcg/helper.h.inc} | 0 target/m68k/{helper.h => tcg/helper.h.inc} | 0 target/microblaze/{helper.h => tcg/helper.h.inc} | 0 target/mips/{helper.h => tcg/helper.h.inc} | 0 target/nios2/{helper.h => tcg/helper.h.inc} | 0 target/openrisc/{helper.h => tcg/helper.h.inc} | 0 target/ppc/{helper.h => tcg/helper.h.inc} | 0 target/riscv/{helper.h => tcg/helper.h.inc} | 0 target/rx/{helper.h => tcg/helper.h.inc} | 0 target/s390x/{helper.h => tcg/helper.h.inc} | 0 target/sh4/{helper.h => tcg/helper.h.inc} | 0 target/sparc/{helper.h => tcg/helper.h.inc} | 0 target/tricore/{helper.h => tcg/helper.h.inc} | 0 target/xtensa/{helper.h => tcg/helper.h.inc} | 0 target/alpha/translate.c | 2 +- target/arm/tcg/translate.c | 2 +- target/avr/translate.c | 2 +- target/cris/translate.c | 2 +- target/hexagon/translate.c | 2 +- target/hppa/translate.c | 2 +- target/i386/tcg/translate.c | 2 +- target/loongarch/translate.c | 2 +- target/m68k/translate.c | 2 +- target/microblaze/translate.c | 2 +- target/mips/tcg/translate.c | 2 +- target/nios2/translate.c | 2 +- target/openrisc/translate.c | 2 +- target/ppc/translate.c | 2 +- target/riscv/translate.c | 2 +- target/rx/translate.c | 2 +- target/s390x/tcg/translate.c | 2 +- target/sh4/translate.c | 2 +- target/sparc/translate.c | 2 +- target/tricore/translate.c | 2 +- target/xtensa/translate.c | 2 +- 44 files changed, 23 insertions(+), 23 deletions(-)rename
target/alpha/{helper.h=> tcg/helper.h.inc} (100%) renametarget/arm/{helper.h=> tcg/helper.h.inc} (100%) renametarget/avr/{helper.h=> tcg/helper.h.inc} (100%) renametarget/cris/{helper.h=> tcg/helper.h.inc} (100%) renametarget/hexagon/{helper.h=> tcg/helper.h.inc} (100%) renametarget/hppa/{helper.h=> tcg/helper.h.inc} (100%) renametarget/i386/{helper.h=> tcg/helper.h.inc} (100%) renametarget/loongarch/{helper.h=> tcg/helper.h.inc} (100%) renametarget/m68k/{helper.h=> tcg/helper.h.inc} (100%) renametarget/microblaze/{helper.h=> tcg/helper.h.inc} (100%) renametarget/mips/{helper.h=> tcg/helper.h.inc} (100%) renametarget/nios2/{helper.h=> tcg/helper.h.inc} (100%) renametarget/openrisc/{helper.h=> tcg/helper.h.inc} (100%) renametarget/ppc/{helper.h=> tcg/helper.h.inc} (100%) renametarget/riscv/{helper.h=> tcg/helper.h.inc} (100%) renametarget/rx/{helper.h=> tcg/helper.h.inc} (100%) renametarget/s390x/{helper.h=> tcg/helper.h.inc} (100%) renametarget/sh4/{helper.h=> tcg/helper.h.inc} (100%) renametarget/sparc/{helper.h=> tcg/helper.h.inc} (100%) renametarget/tricore/{helper.h=> tcg/helper.h.inc} (100%) renametarget/xtensa/{helper.h=> tcg/helper.h.inc} (100%)