misc: Enforce .[ch].inc extension for re-included .c/.h files
cover misc: Enforce .[ch].inc extension for re-included .c/.h files
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):
bsd-user: Rename elfcore.c -> elfcore.c.inc target/arm: Rename helper template headers as '.h.inc' target/i386: Rename helper template headers as '.h.inc'
target: Rename per-target 'helper.h' -> 'helper.h.inc' tests/tcg/aarch64: Rename bti-crt.inc.c -> bti-crt.c.inc
docs/devel/tcg-ops.rst | 2 +-
include/exec/helper-gen.h | 2 +-
include/exec/helper-proto.h | 2 +-
target/alpha/{helper.h => helper.h.inc} | 0
target/arm/{helper.h => helper.h.inc} | 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
target/avr/{helper.h => helper.h.inc} | 0
target/cris/{helper.h => helper.h.inc} | 0
target/hexagon/{helper.h => helper.h.inc} | 0
target/hppa/{helper.h => helper.h.inc} | 0
target/i386/{helper.h => helper.h.inc} | 6 +++---
target/i386/{ops_sse_header.h => ops_sse_header.h.inc} | 0
...hift_helper_template.h => shift_helper_template.h.inc} | 0
.../{cc_helper_template.h => cc_helper_template.h.inc} | 0
target/loongarch/{helper.h => helper.h.inc} | 0
target/m68k/{helper.h => helper.h.inc} | 0
target/microblaze/{helper.h => helper.h.inc} | 0
target/mips/{helper.h => helper.h.inc} | 0
target/nios2/{helper.h => helper.h.inc} | 0
target/openrisc/{helper.h => helper.h.inc} | 0
target/ppc/{helper.h => helper.h.inc} | 0
target/riscv/{helper.h => helper.h.inc} | 0
target/rx/{helper.h => helper.h.inc} | 0
target/s390x/{helper.h => helper.h.inc} | 0
target/sh4/{helper.h => helper.h.inc} | 0
target/sparc/{helper.h => helper.h.inc} | 0
target/tricore/{helper.h => helper.h.inc} | 0
target/xtensa/{helper.h => helper.h.inc} | 0
bsd-user/elfload.c | 2 +-
target/alpha/translate.c | 2 +-
target/arm/machine.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 +-
bsd-user/{elfcore.c => elfcore.c.inc} | 0
tests/tcg/aarch64/{bti-crt.inc.c => bti-crt.c.inc} | 0
60 files changed, 43 insertions(+), 43 deletions(-)
rename target/alpha/{helper.h => helper.h.inc} (100%)
rename target/arm/{helper.h => helper.h.inc} (99%)
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/avr/{helper.h => helper.h.inc} (100%)
rename target/cris/{helper.h => helper.h.inc} (100%)
rename target/hexagon/{helper.h => helper.h.inc} (100%)
rename target/hppa/{helper.h => helper.h.inc} (100%)
rename target/i386/{helper.h => helper.h.inc} (98%)
rename target/i386/{ops_sse_header.h => ops_sse_header.h.inc} (100%)
rename target/i386/{shift_helper_template.h => shift_helper_template.h.inc} (100%)
rename target/i386/tcg/{cc_helper_template.h => cc_helper_template.h.inc} (100%)
rename target/loongarch/{helper.h => helper.h.inc} (100%)
rename target/m68k/{helper.h => helper.h.inc} (100%)
rename target/microblaze/{helper.h => helper.h.inc} (100%)
rename target/mips/{helper.h => helper.h.inc} (100%)
rename target/nios2/{helper.h => helper.h.inc} (100%)
rename target/openrisc/{helper.h => helper.h.inc} (100%)
rename target/ppc/{helper.h => helper.h.inc} (100%)
rename target/riscv/{helper.h => helper.h.inc} (100%)
rename target/rx/{helper.h => helper.h.inc} (100%)
rename target/s390x/{helper.h => helper.h.inc} (100%)
rename target/sh4/{helper.h => helper.h.inc} (100%)
rename target/sparc/{helper.h => helper.h.inc} (100%)
rename target/tricore/{helper.h => helper.h.inc} (100%)
rename target/xtensa/{helper.h => helper.h.inc} (100%)
rename bsd-user/{elfcore.c => elfcore.c.inc} (100%)
rename tests/tcg/aarch64/{bti-crt.inc.c => bti-crt.c.inc} (100%)Signature · 1 line
2.38.1
PATCH 1/5 bsd-user: Rename elfcore.c -> elfcore.c.inc
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 'elfcore.c' as 'elfcore.c.inc'.
---
bsd-user/elfload.c | 2 +-
bsd-user/{elfcore.c => elfcore.c.inc} | 0
2 files changed, 1 insertion(+), 1 deletion(-)
rename bsd-user/{elfcore.c => elfcore.c.inc} (100%)bsd-user/elfload.c +1 -1
@@ -121,7 +121,7 @@ static void bswap_note(struct elf_note *en) { }#endif /* ! BSWAP_NEEDED */ -#include "elfcore.c" +#include "elfcore.c.inc" /* * 'copy_elf_strings()' copies argument/envelope strings from user
bsd-user/elfcore.c.inc renamed from bsd-user/elfcore.c +0 -0
Signature · 1 line
2.38.1
Re: [PATCH 1/5] bsd-user: Rename elfcore.c -> elfcore.c.inc
Quoted 11 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: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.
Quoted 8 lines
Therefore rename the included '
elfcore.c' as 'elfcore.c.inc'.Signed-off-by Philippe Mathieu-Daudé<[email protected]>--- bsd-user/elfload.c | 2 +- bsd-user/{elfcore.c => elfcore.c.inc} | 0 2 files changed, 1 insertion(+), 1 deletion(-)rename
bsd-user/{elfcore.c=> elfcore.c.inc} (100%)
Assuming Warner doesn't simply want to merge this small file, or compile it separately. It isn't actually included more than once.
r~
Re: [PATCH 1/5] bsd-user: Rename elfcore.c -> elfcore.c.inc
Quoted 21 lines · Richard Henderson
Quoted 11 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: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.
Quoted 8 lines
Therefore rename the included '
elfcore.c' as 'elfcore.c.inc'.Signed-off-by Philippe Mathieu-Daudé<[email protected]>--- bsd-user/elfload.c | 2 +- bsd-user/{elfcore.c => elfcore.c.inc} | 0 2 files changed, 1 insertion(+), 1 deletion(-)rename
bsd-user/{elfcore.c=> elfcore.c.inc} (100%)
Quoted 4 lines
Assuming Warner doesn't simply want to merge this small file, or compile it separately. It
isn't actually included more than once.
I'd much rather inline it in elfload.c I did the include trick as a short-term
hack so I didn't have to upstream ALL of the core dump support to get progress on other things in elfload.c.
So rather than rename it (which will cause some grief to me when I merge things, but not a huge amount), it would be better to just inline what's upstream now and I'll reconcile that when I upstream core dump support.
Warner
Re: [PATCH 1/5] bsd-user: Rename elfcore.c -> elfcore.c.inc
Quoted 29 lines · Warner Losh
On Tue, Jun 6, 2023 at 8:29 AM Richard Henderson <[email protected] <mailto:[email protected]>> wrote:
On 6/6/23 07:12, Philippe Mathieu-Daudé wrote:
> Since commit139c1837db("meson: rename included C source files > to .c.inc"), QEMU standard procedure for included C files is to > use *.c.inc.
>
> Besides, since commit6a0057aa22("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 'elfcore.c' as 'elfcore.c.inc'. >
> Signed-off-by: Philippe Mathieu-Daudé<[email protected]
<mailto:[email protected]>>
> ---
> bsd-user/elfload.c | 2 +-
> bsd-user/{elfcore.c => elfcore.c.inc} | 0
> 2 files changed, 1 insertion(+), 1 deletion(-)
> renamebsd-user/{elfcore.c=> elfcore.c.inc} (100%)Assuming Warner doesn't simply want to merge this small file, or compile it separately. It
isn't actually included more than once.
Quoted 7 lines
I'd much rather inline it in
elfload.cI did the include trick as a short-term hack so I didn't have to upstream ALL of the core dump support to get progress on other things inelfload.c.So rather than rename it (which will cause some grief to me when I merge things, but not a huge amount), it would be better to just inline what's upstream now and I'll reconcile that when I upstream core dump support.
I'll just drop it in favor of yours.
PATCH 2/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
Re: [PATCH 2/5] target/arm: Rename helper template headers as '.h.inc'
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 7 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 templates as '.h.inc'.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>
FYI, after yesterday's tcg pr, we can do more than this. These fragments no longer have to be all included into one common helper.h. Each translate-foo.c can include only the helper-foo.h.inc bits that they need, and the bits need not be visible to the rest of the front end.
It was something that I had in mind when splitting include/exec/helper-gen.h, but the patch set was already large enough.
The renaming to .h.inc would have been the first step, anyway.
r~
Re: [PATCH 2/5] target/arm: Rename helper template headers as '.h.inc'
Quoted 12 lines · Richard Henderson
Quoted 11 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: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.
Quoted 7 lines
Quoted 3 lines
Therefore rename the included templates as '.h.inc'.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Richard Henderson <[email protected]>FYI, after yesterday's tcg pr, we can do more than this. These fragments no longer have to be all included into one common
helper.h. Eachtranslate-foo.ccan include only the helper-foo.h.inc bits that they need, and the bits need not be visible to the rest of the front end.
Don't we need foo fully converted to decodetree first? Otherwise generic translate code can call foo helpers, so needs their prototype declaration.
For example in translate-a64.c handle_msr_i(SVCR) calls gen_helper_set_svcr() which is declared in helper-sme.h.
Quoted 6 lines
It was something that I had in mind when splitting
include/exec/helper-gen.h, but the patch set was already large enough.The renaming to .h.inc would have been the first step, anyway.
r~
Re: [PATCH 2/5] target/arm: Rename helper template headers as '.h.inc'
Quoted 25 lines · Philippe Mathieu-Daudé
Quoted 14 lines · Richard Henderson
Quoted 13 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: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'.
Quoted 8 lines
Quoted 1 line
Signed-off-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Richard Henderson <[email protected]>FYI, after yesterday's tcg pr, we can do more than this. These fragments no longer have to be all included into one common
helper.h. Eachtranslate-foo.ccan include only the helper-foo.h.inc bits that they need, and the bits need not be visible to the rest of the front end.
Quoted 6 lines
Don't we need foo fully converted to decodetree first? Otherwise generic translate code can call foo helpers, so needs their prototype declaration.
For example in
translate-a64.chandle_msr_i(SVCR)callsgen_helper_set_svcr()which is declared inhelper-sme.h.
That's unrelated to decodetree -- the decodetree conversion for that instruction still has code in translate-a64.c which calls gen_helper_set_svcr(), it's just in a different function.
https://patchew.org/QEMU/[email protected]/[email protected]/
thanks
-- PMM
Re: [PATCH 2/5] target/arm: Rename helper template headers as '.h.inc'
In reply to Philippe Mathieu-DaudéQuoted 2 lines · Philippe Mathieu-Daudé
For example in
translate-a64.chandle_msr_i(SVCR)callsgen_helper_set_svcr()which is declared inhelper-sme.h.
The placement in helper-sme.h was not done with consideration as to which compilation units might need to use it, since that wasn't a thing at the time.
r~
PATCH 3/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 rename the included templates as '.h.inc'.
---
target/i386/helper.h | 6 +++---
target/i386/{ops_sse_header.h => ops_sse_header.h.inc} | 0
...hift_helper_template.h => shift_helper_template.h.inc} | 0
.../{cc_helper_template.h => cc_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/{ops_sse_header.h => ops_sse_header.h.inc} (100%)
rename target/i386/{shift_helper_template.h => shift_helper_template.h.inc} (100%)
rename target/i386/tcg/{cc_helper_template.h => cc_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 "ops_sse_header.h.inc" #define SHIFT 1 -#include "ops_sse_header.h" +#include "ops_sse_header.h.inc" #define SHIFT 2 -#include "ops_sse_header.h" +#include "ops_sse_header.h.inc" DEF_HELPER_3(rclb, tl, env, tl, tl)DEF_HELPER_3 (rclw, tl, env, tl, tl)
target/i386/ops_sse_header.h.inc renamed from target/i386/ops_sse_header.h +0 -0
target/i386/shift_helper_template.h.inc renamed from target/i386/shift_helper_template.h +0 -0
target/i386/tcg/cc_helper_template.h.inc renamed from target/i386/tcg/cc_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
Re: [PATCH 3/5] target/i386: Rename helper template headers as '.h.inc'
Quoted 22 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: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'.
Signed-off-by Philippe Mathieu-Daudé<[email protected]>--- target/i386/helper.h | 6 +++--- target/i386/{ops_sse_header.h => ops_sse_header.h.inc} | 0 ...hift_helper_template.h => shift_helper_template.h.inc} | 0 .../{cc_helper_template.h => cc_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(-)
Quoted 3 lines
rename
target/i386/{ops_sse_header.h=> ops_sse_header.h.inc} (100%) renametarget/i386/{shift_helper_template.h=> shift_helper_template.h.inc} (100%) renametarget/i386/tcg/{cc_helper_template.h=> cc_helper_template.h.inc} (100%)
Move to tcg/ at the same time?
Otherwise,
r~
PATCH 4/5 target: Rename per-target 'helper.h' -> 'helper.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 'helper.h' as 'helper.h.inc' for all targets (updating the documentation).
---
docs/devel/tcg-ops.rst | 2 +-
include/exec/helper-gen.h | 2 +-
include/exec/helper-proto.h | 2 +-
target/alpha/{helper.h => helper.h.inc} | 0
target/arm/{helper.h => helper.h.inc} | 0
target/avr/{helper.h => helper.h.inc} | 0
target/cris/{helper.h => helper.h.inc} | 0
target/hexagon/{helper.h => helper.h.inc} | 0
target/hppa/{helper.h => helper.h.inc} | 0
target/i386/{helper.h => helper.h.inc} | 0
target/loongarch/{helper.h => helper.h.inc} | 0
target/m68k/{helper.h => helper.h.inc} | 0
target/microblaze/{helper.h => helper.h.inc} | 0
target/mips/{helper.h => helper.h.inc} | 0
target/nios2/{helper.h => helper.h.inc} | 0
target/openrisc/{helper.h => helper.h.inc} | 0
target/ppc/{helper.h => helper.h.inc} | 0
target/riscv/{helper.h => helper.h.inc} | 0
target/rx/{helper.h => helper.h.inc} | 0
target/s390x/{helper.h => helper.h.inc} | 0
target/sh4/{helper.h => helper.h.inc} | 0
target/sparc/{helper.h => helper.h.inc} | 0
target/tricore/{helper.h => helper.h.inc} | 0
target/xtensa/{helper.h => helper.h.inc} | 0
target/alpha/translate.c | 2 +-
target/arm/machine.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 +-
46 files changed, 25 insertions(+), 25 deletions(-)
rename target/alpha/{helper.h => helper.h.inc} (100%)
rename target/arm/{helper.h => helper.h.inc} (100%)
rename target/avr/{helper.h => helper.h.inc} (100%)
rename target/cris/{helper.h => helper.h.inc} (100%)
rename target/hexagon/{helper.h => helper.h.inc} (100%)
rename target/hppa/{helper.h => helper.h.inc} (100%)
rename target/i386/{helper.h => helper.h.inc} (100%)
rename target/loongarch/{helper.h => helper.h.inc} (100%)
rename target/m68k/{helper.h => helper.h.inc} (100%)
rename target/microblaze/{helper.h => helper.h.inc} (100%)
rename target/mips/{helper.h => helper.h.inc} (100%)
rename target/nios2/{helper.h => helper.h.inc} (100%)
rename target/openrisc/{helper.h => helper.h.inc} (100%)
rename target/ppc/{helper.h => helper.h.inc} (100%)
rename target/riscv/{helper.h => helper.h.inc} (100%)
rename target/rx/{helper.h => helper.h.inc} (100%)
rename target/s390x/{helper.h => helper.h.inc} (100%)
rename target/sh4/{helper.h => helper.h.inc} (100%)
rename target/sparc/{helper.h => helper.h.inc} (100%)
rename target/tricore/{helper.h => helper.h.inc} (100%)
rename target/xtensa/{helper.h => helper.h.inc} (100%)docs/devel/tcg-ops.rst +1 -1
@@ -151,7 +151,7 @@ Types Helpers ======= -Helpers are registered in a guest-specific ``helper.h``, +Helpers are registered in a guest-specific ``helper.h.inc``, which is processed to generate ``tcg_gen_helper_*`` functions. With these functions it is possible to call a function taking i32, i64, i128 or pointer types.
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 "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 "helper.h.inc"#include "exec/helper-proto.h.inc" #undef HELPER_H
target/alpha/helper.h.inc renamed from target/alpha/helper.h +0 -0
target/arm/helper.h.inc renamed from target/arm/helper.h +0 -0
target/avr/helper.h.inc renamed from target/avr/helper.h +0 -0
target/cris/helper.h.inc renamed from target/cris/helper.h +0 -0
target/hexagon/helper.h.inc renamed from target/hexagon/helper.h +0 -0
target/hppa/helper.h.inc renamed from target/hppa/helper.h +0 -0
target/i386/helper.h.inc renamed from target/i386/helper.h +0 -0
target/loongarch/helper.h.inc renamed from target/loongarch/helper.h +0 -0
target/m68k/helper.h.inc renamed from target/m68k/helper.h +0 -0
target/microblaze/helper.h.inc renamed from target/microblaze/helper.h +0 -0
target/mips/helper.h.inc renamed from target/mips/helper.h +0 -0
target/nios2/helper.h.inc renamed from target/nios2/helper.h +0 -0
target/openrisc/helper.h.inc renamed from target/openrisc/helper.h +0 -0
target/ppc/helper.h.inc renamed from target/ppc/helper.h +0 -0
target/riscv/helper.h.inc renamed from target/riscv/helper.h +0 -0
target/rx/helper.h.inc renamed from target/rx/helper.h +0 -0
target/s390x/helper.h.inc renamed from target/s390x/helper.h +0 -0
target/sh4/helper.h.inc renamed from target/sh4/helper.h +0 -0
target/sparc/helper.h.inc renamed from target/sparc/helper.h +0 -0
target/tricore/helper.h.inc renamed from target/tricore/helper.h +0 -0
target/xtensa/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 "helper.h.inc"#include "exec/helper-info.c.inc" #undef HELPER_H
target/arm/machine.c +1 -1
@@ -462,7 +462,7 @@ static bool pmsav7_rnr_needed(void *opaque)CPUARMState *env = &cpu->env;/* For R profile cores pmsav7.rnr is migrated via the cpreg -* "RGNR" definition in helper.h. For M profile we have to +* "RGNR" definition in helper.h.inc. For M profile we have to * migrate it separately. */ return arm_feature (env,ARM_FEATURE_M );
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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "helper.h.inc"#include "exec/helper-info.c.inc" #undef HELPER_H
Signature · 1 line
2.38.1
Re: [PATCH 4/5] target: Rename per-target 'helper.h' -> 'helper.h.inc'
Quoted 11 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: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.
Quoted 6 lines
Therefore rename the included '
helper.h' as 'helper.h.inc' for all targets (updating the documentation).Suggested-by Richard Henderson<[email protected]>Signed-off-by Philippe Mathieu-Daudé<[email protected]>---
A bulk patch like this isn't ideal. Targets that have a tcg/ subdir should have helper.h.inc moved into there. At the end, include/exec/helper-gen.h and include/exec/helper-proto.h become unused and go away.
r~
Re: [PATCH 4/5] target: Rename per-target 'helper.h' -> 'helper.h.inc'
Quoted 12 lines · Richard Henderson
Quoted 11 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: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.
Quoted 8 lines
Quoted 6 lines
Therefore rename the included '
helper.h' as 'helper.h.inc' for all targets (updating the documentation).Suggested-by Richard Henderson<[email protected]>Signed-off-by Philippe Mathieu-Daudé<[email protected]>---
A bulk patch like this isn't ideal.
Unfortunately these headers (declaring HELPER_H path) are used by all targets:
include/exec/helper-gen.h
include/exec/helper-proto.h
So this has to be bulk.
Quoted 1 line
Targets that have a tcg/ subdir should have helper.h.inc moved into there.
OK.
Quoted 1 line
At the end,
include/exec/helper-gen.handinclude/exec/helper-proto.hbecome unused and go away.
Ah, you are suggesting to first inline these helpers in each target, then move. Hmm OK I'll try.
PATCH 5/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
Re: [PATCH 5/5] tests/tcg/aarch64: Rename bti-crt.inc.c -> bti-crt.c.inc
Quoted 13 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: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'.
Quoted 7 lines
Signed-off-by Philippe Mathieu-Daudé<[email protected]>--- 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%)
r~
Re: [PATCH 5/5] tests/tcg/aarch64: Rename bti-crt.inc.c -> bti-crt.c.inc
In reply to Philippe Mathieu-Daudé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 7 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 '
bti-crt.inc.c' as 'bti-crt.c.inc'.Signed-off-by Philippe Mathieu-Daudé <[email protected]>
Signature · 2 lines
Alex Bennée Virtualisation Tech Lead @ Linaro
Quoted 11 lines · Philippe Mathieu-Daudé
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 155
Ahh prescient as I've just added this hack to the loc tool I'm using:
modified src/lib.rs
@@ -338,7 +338,7 @@ pub fn lang_from_ext(filepath: &str) -> Lang {
"at" => AmbientTalk,
"awk" => Awk,
"bat" | "btm" | "cmd" => Batch,
- "c" | "ec" | "pgc" => C,
+ "c" | "ec" | "pgc" | "inc" => C,
"cc" | "cpp" | "cxx" | "c++" | "pcc" => Cpp,
"cfc" => ColdFusionScript,
"cmake" => CMake,while gathering loc stats for the project.
Signature · 2 lines
Alex Bennée Virtualisation Tech Lead @ Linaro