[sanitizer coverage] write the pc-table at the process exit
authorKostya Serebryany <kcc@google.com>
Tue, 21 Sep 2021 00:58:50 +0000 (17:58 -0700)
committerKostya Serebryany <kcc@google.com>
Tue, 21 Sep 2021 16:09:25 +0000 (09:09 -0700)
commit11c533e1ea38381726ed04ab65937a03fbfb3e19
treed281ff59b40cf0e6f3e8dfd4d9da4a89e15a196d
parent5131037ea96f9e2bc863557ba6d6dc63f46a94ab
[sanitizer coverage] write the pc-table at the process exit

The current code writes the pc-table at the process startup,
which may happen before the common_flags() are initialized.
Move writing to the process end.
This is consistent with how we write the counters and avoids the problem with the uninitalized flags.
Add prints if verbosity>=1.

Reviewed By: kostik

Differential Revision: https://reviews.llvm.org/D110119
compiler-rt/lib/sanitizer_common/sanitizer_coverage_libcdep_new.cpp
compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_inline8bit_counter_default_impl.cpp