This is an archive of the discontinued LLVM Phabricator instance.

[libc] Use the constexpr constructor to initialize exit handlers mutex.
ClosedPublic

Authored by sivachandra on Mar 9 2022, 1:53 PM.

Diff Detail

Event Timeline

sivachandra created this revision.Mar 9 2022, 1:53 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMar 9 2022, 1:53 PM
sivachandra requested review of this revision.Mar 9 2022, 1:53 PM
abrachet accepted this revision.Mar 9 2022, 2:08 PM
abrachet added inline comments.
libc/src/stdlib/CMakeLists.txt
280

Why is this necessary?

This revision is now accepted and ready to land.Mar 9 2022, 2:08 PM
michaelrj added inline comments.Mar 9 2022, 2:13 PM
libc/src/stdlib/atexit.cpp
18

this seems like it won't work if linux/mutex.h isn't included, should this be locked down by host OS?

Remove an optimization setting which is not required just yet.

libc/src/stdlib/CMakeLists.txt
280

This is actually required for a follow up change. Removed it now.

libc/src/stdlib/atexit.cpp
18

At that level, it was already that way. For, the functions __llvm_libc::mtx_lock etc are only available for the linux target. The way to look at this is that, the code in this file does not depend or use an OS specific piece directly - threads/mutex.h is the abstraction layer.

sivachandra edited the summary of this revision. (Show Details)Mar 9 2022, 5:10 PM