]> Git Repo - qemu.git/commit
tcg: convert tb->cflags reads to tb_cflags(tb)
authorEmilio G. Cota <[email protected]>
Wed, 19 Jul 2017 00:46:52 +0000 (20:46 -0400)
committerRichard Henderson <[email protected]>
Tue, 24 Oct 2017 20:53:41 +0000 (13:53 -0700)
commitc5a49c63fa26e8825ad101dfe86339ae4c216539
treec41e1a7064e88f65292a3b09684123f9f499617e
parentcdfef1715c779eb528d633e8b76cbc8a10e71ac8
tcg: convert tb->cflags reads to tb_cflags(tb)

Convert all existing readers of tb->cflags to tb_cflags, so that we
use atomic_read and therefore avoid undefined behaviour in C11.

Note that the remaining setters/getters of the field are protected
by tb_lock, and therefore do not need conversion.

Luckily all readers access the field via 'tb->cflags' (so no foo.cflags,
bar->cflags in the code base), which makes the conversion easily
scriptable:

FILES=$(git grep 'tb->cflags' target include/exec/gen-icount.h \
 accel/tcg/translator.c | cut -f1 -d':' | sort | uniq)

perl -pi -e 's/([^.>])tb->cflags/$1tb_cflags(tb)/g' $FILES
perl -pi -e 's/([a-z->.]*)(->|\.)tb->cflags/tb_cflags($1$2tb)/g' $FILES

Then manually fixed the few errors that checkpatch reported.

Compile-tested for all targets.

Suggested-by: Richard Henderson <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: Emilio G. Cota <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
24 files changed:
accel/tcg/translator.c
include/exec/gen-icount.h
target/alpha/translate.c
target/arm/translate-a64.c
target/arm/translate.c
target/cris/translate.c
target/hppa/translate.c
target/i386/translate.c
target/lm32/translate.c
target/m68k/translate.c
target/microblaze/translate.c
target/mips/translate.c
target/moxie/translate.c
target/nios2/translate.c
target/openrisc/translate.c
target/ppc/translate.c
target/ppc/translate_init.c
target/s390x/translate.c
target/sh4/translate.c
target/sparc/translate.c
target/tilegx/translate.c
target/tricore/translate.c
target/unicore32/translate.c
target/xtensa/translate.c
This page took 0.03709 seconds and 4 git commands to generate.