diff options
Diffstat (limited to 'libgcc/libgcov-util.c')
-rw-r--r-- | libgcc/libgcov-util.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/libgcc/libgcov-util.c b/libgcc/libgcov-util.c index e46ae06..38d434a 100644 --- a/libgcc/libgcov-util.c +++ b/libgcc/libgcov-util.c @@ -746,6 +746,25 @@ __gcov_single_counter_op (gcov_type *counters, unsigned n_counters, } } +/* Performing FN upon indirect-call profile counters. */ + +static void +__gcov_icall_topn_counter_op (gcov_type *counters, unsigned n_counters, + counter_op_fn fn, void *data1, void *data2) +{ + unsigned i; + + gcc_assert (!(n_counters % GCOV_ICALL_TOPN_NCOUNTS)); + for (i = 0; i < n_counters; i += GCOV_ICALL_TOPN_NCOUNTS) + { + unsigned j; + gcov_type *value_array = &counters[i + 1]; + + for (j = 0; j < GCOV_ICALL_TOPN_NCOUNTS - 1; j += 2) + value_array[j + 1] = fn (value_array[j + 1], data1, data2); + } +} + /* Scaling the counter value V by multiplying *(float*) DATA1. */ static gcov_type |