Make __gcov_flush flush counters for all shared libraries
authorMarco Castelluccio <mcastelluccio@mozilla.com>
Thu, 5 Jul 2018 15:52:59 +0000 (15:52 +0000)
committerMarco Castelluccio <mcastelluccio@mozilla.com>
Thu, 5 Jul 2018 15:52:59 +0000 (15:52 +0000)
commit32d18beb8c8300f901e36d04ac5fff278d23fb01
tree6acc65091132cbfe178b2e16d6c9defd4bfe351c
parentcb54964f808bd4383938948b0ebeb224d918d1bf
Make __gcov_flush flush counters for all shared libraries

Summary:
This will make the behavior of __gcov_flush match the GCC behavior.

I would like to rename __gcov_flush to __llvm_gcov_flush (in case of programs linking to libraries built with different compilers), but I guess we can't for compatibility reasons.

Reviewers: davidxl

Reviewed By: davidxl

Subscribers: samsonov, vitalybuka, pcc, kcc, junbuml, glider, fhahn, eugenis, dvyukov, davidxl, srhines, chh, llvm-commits, #sanitizers

Differential Revision: https://reviews.llvm.org/D48538

llvm-svn: 336365
20 files changed:
compiler-rt/lib/profile/GCDAProfiling.c
compiler-rt/test/profile/Inputs/instrprof-dlopen-dlclose-main.c
compiler-rt/test/profile/Inputs/instrprof-dlopen-dlclose-main.c.gcov [new file with mode: 0644]
compiler-rt/test/profile/Inputs/instrprof-dlopen-dlclose-main_three-libs.c.gcov [new file with mode: 0644]
compiler-rt/test/profile/Inputs/instrprof-dlopen-func.c.gcov [new file with mode: 0644]
compiler-rt/test/profile/Inputs/instrprof-dlopen-func2.c.gcov [new file with mode: 0644]
compiler-rt/test/profile/Inputs/instrprof-dlopen-func3.c [new file with mode: 0644]
compiler-rt/test/profile/Inputs/instrprof-dlopen-func3.c.gcov [new file with mode: 0644]
compiler-rt/test/profile/Inputs/instrprof-shared-lib.c.gcov [new file with mode: 0644]
compiler-rt/test/profile/Inputs/instrprof-shared-lib_called-twice.c.gcov [new file with mode: 0644]
compiler-rt/test/profile/Inputs/instrprof-shared-lib_in-loop.c.gcov [new file with mode: 0644]
compiler-rt/test/profile/Inputs/instrprof-shared-main-gcov-flush.c [new file with mode: 0644]
compiler-rt/test/profile/Inputs/instrprof-shared-main-gcov-flush_no-writeout.c.gcov [new file with mode: 0644]
compiler-rt/test/profile/Inputs/instrprof-shared-main-gcov-flush_shared-call-after.c.gcov [new file with mode: 0644]
compiler-rt/test/profile/Inputs/instrprof-shared-main-gcov-flush_shared-call-before-after.c.gcov [new file with mode: 0644]
compiler-rt/test/profile/Inputs/instrprof-shared-main-gcov-flush_shared-call-before.c.gcov [new file with mode: 0644]
compiler-rt/test/profile/Inputs/instrprof-shared-main.c.gcov [new file with mode: 0644]
compiler-rt/test/profile/instrprof-dlopen-dlclose-gcov.test
compiler-rt/test/profile/instrprof-gcov-two-objects.test [new file with mode: 0644]
compiler-rt/test/profile/instrprof-shared-gcov-flush.test [new file with mode: 0644]