This is an archive of the discontinued LLVM Phabricator instance.

scudo: Remove the THREADLOCAL macro.
ClosedPublic

Authored by pcc on Sep 10 2020, 12:39 PM.

Details

Summary

Replace all remaining uses with thread_local, which is a C++11
standard feature.

Depends on D87420

Diff Detail

Event Timeline

pcc created this revision.Sep 10 2020, 12:39 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 10 2020, 12:39 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript
pcc requested review of this revision.Sep 10 2020, 12:39 PM

I think that I one point in time I tried thread_local but a compiler (can't remember which one) was complaining about the constructors not being trivial or something to that extent.
This is fairly blurry at this point, so I am sorry if this is not very helpful, but I just want to make sure this would work on all platforms with gcc/clang.

pcc added a comment.Sep 10 2020, 6:56 PM

This was tested with clang but I also tried g++ 9.3.0 and it compiled there. Beyond that I reckon we should just rely on bots.

cryptoad accepted this revision.Sep 10 2020, 7:06 PM
This revision is now accepted and ready to land.Sep 10 2020, 7:06 PM
This revision was landed with ongoing or failed builds.Sep 10 2020, 7:16 PM
This revision was automatically updated to reflect the committed changes.

I think that I one point in time I tried thread_local but a compiler (can't remember which one) was complaining about the constructors not being trivial or something to that extent.
This is fairly blurry at this point, so I am sorry if this is not very helpful, but I just want to make sure this would work on all platforms with gcc/clang.

For reference, I hit something similar at the beginning of this year with LLVM_THREAD_LOCAL on MacOS: https://reviews.llvm.org/D71059#1806509 Maybe it was similar to that.

This was tested with clang but I also tried g++ 9.3.0 and it compiled there. Beyond that I reckon we should just rely on bots.

Agreed.