diff options
author | Steve Ellcey <sje@cup.hp.com> | 2010-11-01 20:38:40 +0000 |
---|---|---|
committer | Steve Ellcey <sje@gcc.gnu.org> | 2010-11-01 20:38:40 +0000 |
commit | 7894073c2f67f53e1c8da85d2c92d71701eff9fb (patch) | |
tree | 937962dd4880503e37b45f84152c4320ca66c78d /gcc/libgcov.c | |
parent | 8f07a2aa357fd67ca7ef1e640424bc605c6cec31 (diff) | |
download | gcc-7894073c2f67f53e1c8da85d2c92d71701eff9fb.zip gcc-7894073c2f67f53e1c8da85d2c92d71701eff9fb.tar.gz gcc-7894073c2f67f53e1c8da85d2c92d71701eff9fb.tar.bz2 |
defaults.h (TARGET_VTABLE_USES_DESCRIPTORS): Move under ifdef GCC_INSN_FLAGS_H.
2010-11-01 Steve Ellcey <sje@cup.hp.com>
* defaults.h (TARGET_VTABLE_USES_DESCRIPTORS): Move under ifdef
GCC_INSN_FLAGS_H.
* libgcov.c (__gcov_indirect_call_profiler): Set
VTABLE_USES_DESCRIPTORS if TARGET_VTABLE_USES_DESCRIPTORS is
defined and use in place of TARGET_VTABLE_USES_DESCRIPTORS.
From-SVN: r166145
Diffstat (limited to 'gcc/libgcov.c')
-rw-r--r-- | gcc/libgcov.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/gcc/libgcov.c b/gcc/libgcov.c index 07f27db..e89e7e6 100644 --- a/gcc/libgcov.c +++ b/gcc/libgcov.c @@ -798,6 +798,24 @@ __gcov_one_value_profiler (gcov_type *counters, gcov_type value) #endif #ifdef L_gcov_indirect_call_profiler + +/* By default, the C++ compiler will use function addresses in the + vtable entries. Setting TARGET_VTABLE_USES_DESCRIPTORS to nonzero + tells the compiler to use function descriptors instead. The value + of this macro says how many words wide the descriptor is (normally 2), + but it may be dependent on target flags. Since we do not have access + to the target flags here we just check to see if it is set and use + that to set VTABLE_USES_DESCRIPTORS to 0 or 1. + + It is assumed that the address of a function descriptor may be treated + as a pointer to a function. */ + +#ifdef TARGET_VTABLE_USES_DESCRIPTORS +#define VTABLE_USES_DESCRIPTORS 1 +#else +#define VTABLE_USES_DESCRIPTORS 0 +#endif + /* Tries to determine the most common value among its inputs. */ void __gcov_indirect_call_profiler (gcov_type* counter, gcov_type value, @@ -807,7 +825,7 @@ __gcov_indirect_call_profiler (gcov_type* counter, gcov_type value, function may have multiple descriptors and we need to dereference the descriptors to see if they point to the same function. */ if (cur_func == callee_func - || (TARGET_VTABLE_USES_DESCRIPTORS && callee_func + || (VTABLE_USES_DESCRIPTORS && callee_func && *(void **) cur_func == *(void **) callee_func)) __gcov_one_value_profiler_body (counter, value); } |