optimize: only write to state when clearing optimizer data
commitd193a14a2c94c9c4877ab100c31ec174dc78644c
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 11 Jan 2013 23:42:51 +0000 (11 15:42 -0800)
committerBlue Swirl <blauwirbel@gmail.com>
Sat, 19 Jan 2013 10:13:13 +0000 (19 10:13 +0000)
treef39a3131bceda10d6f2a2ccda3435f6fd7e36a94
parent75f0585f1718c575716021d11bfeb695129f785d
optimize: only write to state when clearing optimizer data

The next patch will add to the TCG optimizer a field that should be
non-zero in the default case.  Thus, replace the memset of the
temps array with a loop.  Only the state field has to be up-to-date,
because others are not used except if the state is TCG_TEMP_COPY
or TCG_TEMP_CONST.

[rth: Extracted the loop to a function.]

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
tcg/optimize.c