[PATCH] D45454: Make __gcov_flush visible outside a shared library

Chih-Hung Hsieh via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 25 10:12:44 PDT 2018


chh added a comment.

In https://reviews.llvm.org/D45454#1142197, @marco-c wrote:

> In https://reviews.llvm.org/D45454#1070884, @belleyb wrote:
>
> > @chh I had a chance to try out your proposed changes. It's not causing us any trouble. In fact, `__gcov_flush()` is not even used at all (at least in LLVM 5.0.1).. I can recompile llvm, compiler_rt and clang and re-run all the tests with `__gcov_flush` commented out! No problem.
> >
> > I would suggest adding a bit more documentation to `__gcov_flush()`, thus describing what those "special cases" are...
>
>
> __gcov_flush is only used if you actually call it (it's needed for example if you want to profile only part of your program).
>
> In GCC, __gcov_flush is not hidden, so perhaps we should do the same to keep the same behavior? I've also submitted https://reviews.llvm.org/D48538, which is making __gcov_flush flush counters for all shared libraries (like GCC does, with the same caveat: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83879).


I have no problem keeping these functions compatible with GCC.
My earlier proposal and David's comment in the mailing list seemed to be lost and not showing here.
So, let me summarize the case here. This change should make `__gcov_flush` not hidden as before in GCC,
but earlier change made it hidden as well as other `llvm_gov_*` functions.
Could we have both `__gov_flush` and `llvm_gov_flush` functions, one unhidden and one hidden?


https://reviews.llvm.org/D45454





More information about the llvm-commits mailing list