tcg: Rename tcg-target.c to tcg-target.inc.c
cover tcg: Rename tcg-target.c to tcg-target.inc.c
This patchset renames the arch-specific tcg-target.c files to tcg-target.inc.c, to better indicate the fact that they are not standalone source files but are just #included from another .c file.
Having done that we can teach clean-includes about the .inc.c convention, and then undo some unnecessary #includes that it added earlier.
thanks
-- PMM
Peter Maydell (3):
tcg: Rename tcg-target.c to tcg-target.inc.c scripts/clean-includes: Ignore .inc.c files
tcg: Remove unnecessary osdep.h includes from tcg-target.inc.c
qemu-tech.texi | 2 +-
scripts/clean-includes | 5 +++++
tcg/README | 5 +++--
tcg/aarch64/{tcg-target.c => tcg-target.inc.c} | 1 -
tcg/arm/{tcg-target.c => tcg-target.inc.c} | 1 -
tcg/i386/{tcg-target.c => tcg-target.inc.c} | 1 -
tcg/ia64/{tcg-target.c => tcg-target.inc.c} | 0
tcg/mips/{tcg-target.c => tcg-target.inc.c} | 1 -
tcg/ppc/{tcg-target.c => tcg-target.inc.c} | 1 -
tcg/s390/{tcg-target.c => tcg-target.inc.c} | 1 -
tcg/sparc/{tcg-target.c => tcg-target.inc.c} | 1 -
tcg/tcg.c | 7 ++++---
tcg/tcg.h | 2 +-
tcg/tci/README | 4 ++--
tcg/tci/{tcg-target.c => tcg-target.inc.c} | 1 -
15 files changed, 16 insertions(+), 17 deletions(-)
rename tcg/aarch64/{tcg-target.c => tcg-target.inc.c} (99%)
rename tcg/arm/{tcg-target.c => tcg-target.inc.c} (99%)
rename tcg/i386/{tcg-target.c => tcg-target.inc.c} (99%)
rename tcg/ia64/{tcg-target.c => tcg-target.inc.c} (100%)
rename tcg/mips/{tcg-target.c => tcg-target.inc.c} (99%)
rename tcg/ppc/{tcg-target.c => tcg-target.inc.c} (99%)
rename tcg/s390/{tcg-target.c => tcg-target.inc.c} (99%)
rename tcg/sparc/{tcg-target.c => tcg-target.inc.c} (99%)
rename tcg/tci/{tcg-target.c => tcg-target.inc.c} (99%)Signature · 1 line
1.9.1
PATCH 1/3 tcg: Rename tcg-target.c to tcg-target.inc.c
Rename the per-architecture tcg-target.c files to tcg-target.inc.c. This makes it clearer that they are not intended to be standalone C files, but are instead #included into another source file.
---
qemu-tech.texi | 2 +-
tcg/README | 5 +++--
tcg/aarch64/{tcg-target.c => tcg-target.inc.c} | 0
tcg/arm/{tcg-target.c => tcg-target.inc.c} | 0
tcg/i386/{tcg-target.c => tcg-target.inc.c} | 0
tcg/ia64/{tcg-target.c => tcg-target.inc.c} | 0
tcg/mips/{tcg-target.c => tcg-target.inc.c} | 0
tcg/ppc/{tcg-target.c => tcg-target.inc.c} | 0
tcg/s390/{tcg-target.c => tcg-target.inc.c} | 0
tcg/sparc/{tcg-target.c => tcg-target.inc.c} | 0
tcg/tcg.c | 7 ++++---
tcg/tcg.h | 2 +-
tcg/tci/README | 4 ++--
tcg/tci/{tcg-target.c => tcg-target.inc.c} | 0
14 files changed, 11 insertions(+), 9 deletions(-)
rename tcg/aarch64/{tcg-target.c => tcg-target.inc.c} (100%)
rename tcg/arm/{tcg-target.c => tcg-target.inc.c} (100%)
rename tcg/i386/{tcg-target.c => tcg-target.inc.c} (100%)
rename tcg/ia64/{tcg-target.c => tcg-target.inc.c} (100%)
rename tcg/mips/{tcg-target.c => tcg-target.inc.c} (100%)
rename tcg/ppc/{tcg-target.c => tcg-target.inc.c} (100%)
rename tcg/s390/{tcg-target.c => tcg-target.inc.c} (100%)
rename tcg/sparc/{tcg-target.c => tcg-target.inc.c} (100%)
rename tcg/tci/{tcg-target.c => tcg-target.inc.c} (100%)qemu-tech.texi +1 -1
@@ -385,7 +385,7 @@ ops (see @code{target-i386/translate.c}). Some optimizations can be performed at this stage, including liveness analysis and trivial constant expression evaluation. TCG ops are then implemented in the host CPU back end, also known as TCG target (see -@code{tcg/i386/tcg-target.c}). For more information, please take a +@code{tcg/i386/tcg-target.inc.c}). For more information, please take a look at @code{tcg/README}. @node Condition code optimisations
tcg/README +3 -2
@@ -460,8 +460,9 @@ function tcg_gen_xxx(args). 4) Backend -tcg-target.h contains the target specific definitions. tcg-target.c -contains the target specific code. +tcg-target.h contains the target specific definitions. tcg-target.inc.c +contains the target specific code; it is #included by tcg/tcg.c, rather +than being a standalone C file. 4.1) Assumptions
tcg/aarch64/tcg-target.inc.c renamed from tcg/aarch64/tcg-target.c +0 -0
tcg/arm/tcg-target.inc.c renamed from tcg/arm/tcg-target.c +0 -0
tcg/i386/tcg-target.inc.c renamed from tcg/i386/tcg-target.c +0 -0
tcg/ia64/tcg-target.inc.c renamed from tcg/ia64/tcg-target.c +0 -0
tcg/mips/tcg-target.inc.c renamed from tcg/mips/tcg-target.c +0 -0
tcg/ppc/tcg-target.inc.c renamed from tcg/ppc/tcg-target.c +0 -0
tcg/s390/tcg-target.inc.c renamed from tcg/s390/tcg-target.c +0 -0
tcg/sparc/tcg-target.inc.c renamed from tcg/sparc/tcg-target.c +0 -0
tcg/tcg.c +4 -3
@@ -62,7 +62,8 @@#include "elf.h" #include "exec/log.h" -/* Forward declarations for functions declared in tcg-target.c and used here. */ +/* Forward declarations for functions declared in tcg-target.inc.c and +used here. */ static void tcg_target_init (TCGContext *s);static void tcg_target_qemu_prologue (TCGContext *s); static void patch_reloc(tcg_insn_unit *code_ptr, int type,
@@ -96,7 +97,7 @@ static void tcg_register_jit_int(void *buf, size_t size, size_t debug_frame_size) __attribute__((unused)); -/* Forward declarations for functions declared and used in tcg-target.c. */ +/* Forward declarations for functions declared and used in tcg-target.inc.c. */ static int target_parse_constraint (TCGArgConstraint *ct,const char **pct_str);static void tcg_out_ld (TCGContext *s,TCGType type,TCGReg ret,TCGReg arg1,intptr_t arg2);
@@ -250,7 +251,7 @@ TCGLabel *gen_new_label(void)return l; } -#include "tcg-target.c" +#include "tcg-target.inc.c" /* pool based memory allocation */ void *tcg_malloc_internal (TCGContext *s,int size)
tcg/tcg.h +1 -1
@@ -566,7 +566,7 @@ struct TCGContext {TBContext tb_ctx; -/* The TCGBackendData structure is private to tcg-target.c. */ +/* The TCGBackendData structure is private to tcg-target.inc.c. */ struct TCGBackendData *be;TCGTempSet free_temps[TCG_TYPE_COUNT *2 ];
tcg/tci/README +2 -2
@@ -21,7 +21,7 @@ This is what TCI (Tiny Code Interpreter) does. 2) Implementation Like each TCG host frontend, TCI implements the code generator in -tcg-target.c, tcg-target.h. Both files are in directory tcg/tci. +tcg-target.inc.c, tcg-target.h. Both files are in directory tcg/tci. The additional file tcg/tci.c adds the interpreter.
@@ -123,7 +123,7 @@ u1 = linux-user-test works would also improve speed for hosts which support byte alignment). * A better disassembler for the pseudo code would be nice (a very primitive - disassembler is included in tcg-target.c). + disassembler is included in tcg-target.inc.c). * It might be useful to have a runtime option which selects the native TCG or TCI, so QEMU would have to include two TCGs. Today, selecting TCI
tcg/tci/tcg-target.inc.c renamed from tcg/tci/tcg-target.c +0 -0
Signature · 1 line
1.9.1
PATCH 2/3 scripts/clean-includes: Ignore .inc.c files
In reply to Peter MaydellIgnore files which have a .inc.c extension -- these are not headers but they are not standalone C source files either, so we can't make any automated decisions about what #include directives they should have.
--- scripts/clean-includes | 5 +++++ 1 file changed, 5 insertions(+)
scripts/clean-includes +5 -0
@@ -94,6 +94,11 @@ EOT for f in "$@"; do case "$f" in + *.inc.c) + # These aren't standalone C source files + echo "SKIPPING $f (not a standalone source file)" + continue + ;; *.c) MODE=c ;;
Signature · 1 line
1.9.1
Re: [Qemu-devel] [PATCH 2/3] scripts/clean-includes: Ignore .inc.c files
Quoted 9 lines · Peter Maydell
Ignore files which have a
.inc.cextension -- these are not headers but they are not standalone C source files either, so we can't make any automated decisions about what #include directives they should have.Signed-off-by Peter Maydell <[email protected]>--- scripts/clean-includes | 5 +++++ 1 file changed, 5 insertions(+)
Quoted 18 lines
scripts/clean-includes +5
-0@@ -94,6 +94,11 @@ EOT for f in "$@"; do case "$f" in + *.inc.c) + # These aren't standalone C source files + echo "SKIPPING $f (not a standalone source file)" + continue + ;; *.c) MODE=c ;;
Signature · 2 lines
Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
PATCH 3/3 tcg: Remove unnecessary osdep.h includes from tcg-target.inc.c
In reply to Peter MaydellCommit 757e725b58c57d added a number of #include "qemu/osdep.h" files to the tcg-target.c files (as they were named at the time). These are unnecessary because these files are not standalone C files, and the tcg/tcg.c file which includes them will have already included osdep.h on their behalf. Remove the unneeded include directives.
--- tcg/aarch64/tcg-target.inc.c | 1 - tcg/arm/tcg-target.inc.c | 1 - tcg/i386/tcg-target.inc.c | 1 - tcg/mips/tcg-target.inc.c | 1 - tcg/ppc/tcg-target.inc.c | 1 - tcg/s390/tcg-target.inc.c | 1 - tcg/sparc/tcg-target.inc.c | 1 - tcg/tci/tcg-target.inc.c | 1 - 8 files changed, 8 deletions(-)
tcg/aarch64/tcg-target.inc.c +0 -1
@@ -10,7 +10,6 @@* See the COPYING file in the top-level directory for details. */ -#include "qemu/osdep.h" #include "tcg-be-ldst.h" #include "qemu/bitops.h"
tcg/arm/tcg-target.inc.c +0 -1
@@ -22,7 +22,6 @@* THE SOFTWARE. */ -#include "qemu/osdep.h" #include "elf.h" #include "tcg-be-ldst.h"
tcg/i386/tcg-target.inc.c +0 -1
@@ -22,7 +22,6 @@* THE SOFTWARE. */ -#include "qemu/osdep.h" #include "tcg-be-ldst.h" #ifndef NDEBUG
tcg/mips/tcg-target.inc.c +0 -1
@@ -24,7 +24,6 @@* THE SOFTWARE. */ -#include "qemu/osdep.h" #include "tcg-be-ldst.h" #ifdef HOST_WORDS_BIGENDIAN
tcg/ppc/tcg-target.inc.c +0 -1
@@ -22,7 +22,6 @@* THE SOFTWARE. */ -#include "qemu/osdep.h" #include "tcg-be-ldst.h" #if defined _CALL_DARWIN || defined __APPLE__
tcg/s390/tcg-target.inc.c +0 -1
@@ -24,7 +24,6 @@* THE SOFTWARE. */ -#include "qemu/osdep.h" #include "tcg-be-ldst.h" /* We only support generating code for 64-bit mode. */
tcg/sparc/tcg-target.inc.c +0 -1
@@ -22,7 +22,6 @@* THE SOFTWARE. */ -#include "qemu/osdep.h" #include "tcg-be-null.h" #ifndef NDEBUG
tcg/tci/tcg-target.inc.c +0 -1
@@ -22,7 +22,6 @@* THE SOFTWARE. */ -#include "qemu/osdep.h" #include "tcg-be-null.h" /* TODO list:
Signature · 1 line
1.9.1
Quoted 9 lines · Peter Maydell
This patchset renames the arch-specific
tcg-target.cfiles totcg-target.inc.c, to better indicate the fact that they are not standalone source files but are just #included from another .c file.Having done that we can teach clean-includes about the
.inc.cconvention, and then undo some unnecessary #includes that it added earlier.
Quoted 7 lines
thanks
-- PMMPeter Maydell (3):
tcg: Renametcg-target.ctotcg-target.inc.cscripts/clean-includes: Ignore.inc.cfiles
tcg: Remove unnecessaryosdep.hincludes fromtcg-target.inc.c
also, for this series and for "post-include-cleanup followups":
Signature · 2 lines
Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Quoted 4 lines · Peter Maydell
Peter Maydell (3):
tcg: Renametcg-target.ctotcg-target.inc.cscripts/clean-includes: Ignore.inc.cfiles
tcg: Remove unnecessaryosdep.hincludes fromtcg-target.inc.c
r~
Quoted 7 lines · Richard Henderson
Quoted 4 lines · Peter Maydell
Peter Maydell (3):
tcg: Renametcg-target.ctotcg-target.inc.cscripts/clean-includes: Ignore.inc.cfiles
tcg: Remove unnecessaryosdep.hincludes fromtcg-target.inc.cReviewed-by Richard Henderson <[email protected]>
Thanks. I'm assuming you'll prefer to take these via the tcg tree to avoid conflicts with anything else you have pending.
thanks
-- PMM
Quoted 7 lines · Peter Maydell
Quoted 6 lines · Richard Henderson
Quoted 4 lines · Peter Maydell
Peter Maydell (3):
tcg: Renametcg-target.ctotcg-target.inc.cscripts/clean-includes: Ignore.inc.cfiles
tcg: Remove unnecessaryosdep.hincludes fromtcg-target.inc.c
Quoted 5 lines
Quoted 1 line
Reviewed-by Richard Henderson <[email protected]>Thanks. I'm assuming you'll prefer to take these via the tcg tree to avoid conflicts with anything else you have pending.
Sure. I'm about to rebase and resubmit that, so this will be in.
r~