Skip to content

[GCDAProfiling] Suppress -Wprio-ctor-dtor for GCC>=9 and remove unuse… #73

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 3 additions & 16 deletions compiler-rt/lib/profile/GCDAProfiling.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,22 +210,6 @@ static void write_64bit_value(uint64_t i) {
write_32bit_value(hi);
}

static uint32_t length_of_string(const char *s) {
return (strlen(s) / 4) + 1;
}

// Remove when we support libgcov 9 current_working_directory.
#if !defined(_MSC_VER) && defined(__clang__)
__attribute__((unused))
#endif
static void
write_string(const char *s) {
uint32_t len = length_of_string(s);
write_32bit_value(len);
write_bytes(s, strlen(s));
write_bytes("\0\0\0\0", 4 - (strlen(s) % 4));
}

static uint32_t read_32bit_value() {
uint32_t val;

Expand Down Expand Up @@ -632,6 +616,9 @@ void llvm_writeout_files(void) {
// __attribute__((destructor)) and destructors whose priorities are greater than
// 100 run before this function and can thus be tracked. The priority is
// compatible with GCC 7 onwards.
#if __GNUC__ >= 9
#pragma GCC diagnostic ignored "-Wprio-ctor-dtor"
#endif
__attribute__((destructor(100)))
#endif
static void llvm_writeout_and_clear(void) {
Expand Down