diff options
author | sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> | 2007-06-05 20:48:54 +0000 |
---|---|---|
committer | sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> | 2007-06-05 20:48:54 +0000 |
commit | 620dd26b9be301aeff63760fc27b6ca4be481a6a (patch) | |
tree | 7f865e68d6554d3b4bc0e49eb8f51dcce41ff96f /cachegrind | |
parent | a7802967336adb950dcfb71f152759e45ea16e4b (diff) | |
download | valgrind-620dd26b9be301aeff63760fc27b6ca4be481a6a.tar.gz |
Apparently 'index' shadows a global decl on some targets; therefore rename.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6759 a5019735-40e9-0310-863c-91ae7b9d1cf9
Diffstat (limited to 'cachegrind')
-rw-r--r-- | cachegrind/cg_branchpred.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/cachegrind/cg_branchpred.c b/cachegrind/cg_branchpred.c index 8343cb743..e7a262023 100644 --- a/cachegrind/cg_branchpred.c +++ b/cachegrind/cg_branchpred.c @@ -88,7 +88,7 @@ static UChar counters[N_COUNTERS]; /* Counter array; presumably auto-zeroed */ static ULong do_cond_branch_predict ( Addr instr_addr, Word takenW ) { - UWord index; + UWord indx; Bool predicted_taken, actually_taken, mispredict; const UWord hist_mask = (1 << N_HIST_BITS) - 1; @@ -99,12 +99,12 @@ static ULong do_cond_branch_predict ( Addr instr_addr, Word takenW ) tl_assert(hist_bits <= hist_mask); tl_assert(iadd_bits <= iadd_mask); - index = (hist_bits << N_IADD_BITS) | iadd_bits; - tl_assert(index < N_COUNTERS); - if (0) VG_(printf)("index = %d\n", (Int)index); + indx = (hist_bits << N_IADD_BITS) | iadd_bits; + tl_assert(indx < N_COUNTERS); + if (0) VG_(printf)("index = %d\n", (Int)indx); tl_assert(takenW <= 1); - predicted_taken = counters[ index ] >= 2; + predicted_taken = counters[ indx ] >= 2; actually_taken = takenW > 0; mispredict = (actually_taken && (!predicted_taken)) @@ -114,14 +114,14 @@ static ULong do_cond_branch_predict ( Addr instr_addr, Word takenW ) shift_register |= (actually_taken ? 1 : 0); if (actually_taken) { - if (counters[index] < 3) - counters[index]++; + if (counters[indx] < 3) + counters[indx]++; } else { - if (counters[index] > 0) - counters[index]--; + if (counters[indx] > 0) + counters[indx]--; } - tl_assert(counters[index] <= 3); + tl_assert(counters[indx] <= 3); return mispredict ? 1 : 0; } @@ -138,12 +138,12 @@ static Addr btac[N_BTAC]; /* BTAC; presumably auto-zeroed */ static ULong do_ind_branch_predict ( Addr instr_addr, Addr actual ) { Bool mispredict; - const UWord mask = (1 << N_BTAC_BITS) - 1; - UWord index = (instr_addr >> N_IADDR_LO_ZERO_BITS) - & mask; - tl_assert(index < N_BTAC); - mispredict = btac[index] != actual; - btac[index] = actual; + const UWord mask = (1 << N_BTAC_BITS) - 1; + UWord indx = (instr_addr >> N_IADDR_LO_ZERO_BITS) + & mask; + tl_assert(indx < N_BTAC); + mispredict = btac[indx] != actual; + btac[indx] = actual; return mispredict ? 1 : 0; } |