Skip to content

Commit

Permalink
tcg: Rename tcg-target.c to tcg-target.inc.c
Browse files Browse the repository at this point in the history
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.

Reviewed-by: Eric Blake <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
  • Loading branch information
pm215 authored and rth7680 committed Feb 23, 2016
1 parent d2dc406 commit ce15110
Show file tree
Hide file tree
Showing 14 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion qemu-tech.texi
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions tcg/README
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 4 additions & 3 deletions tcg/tcg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tcg/tcg.h
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,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];
Expand Down
4 changes: 2 additions & 2 deletions tcg/tci/README
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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
Expand Down
File renamed without changes.

0 comments on commit ce15110

Please sign in to comment.