HomePhabricator

[gcov] Move llvm_writeout_files from atexit to a static destructor

Authored by MaskRay on Jul 1 2020, 4:40 PM.

Description

[gcov] Move llvm_writeout_files from atexit to a static destructor

atexit registered functions run earlier so __attribute__((destructor))
annotated functions cannot be tracked.

Set a priority of 100 (compatible with GCC 7 onwards) to track
destructors and destructors whose priorities are greater than 100.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=7970

Reviewed By: calixte, marco-c

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