[PATCH] D138423: [bolt] Use llvm::sys::RWMutex instead of std::shared_timed_mutex

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 21 05:52:27 PST 2022


thakis created this revision.
thakis added reviewers: bolt, rafaelauler.
Herald added a reviewer: rafauler.
Herald added subscribers: treapster, ayermolo.
Herald added a reviewer: Amir.
Herald added a reviewer: maksfb.
Herald added a project: All.
thakis requested review of this revision.
Herald added a subscriber: yota9.

This has the following advantages:

- std::shared_timed_mutex is macOS 10.12+ only. llvm::sys::RWMutex automatically switches to a different implementation internally when targeting older macOS versions.
- bolt only needs std::shared_mutex, not std::shared_timed_mutex. llvm::sys::RWMutex automatically uses std::shared_mutex internally where available.

std::shared_mutex and RWMutex have the same API, so no code changes
other than types and includes are needed.


https://reviews.llvm.org/D138423

Files:
  bolt/include/bolt/Core/BinaryContext.h
  bolt/include/bolt/Core/BinaryFunction.h
  bolt/include/bolt/Passes/Aligner.h
  bolt/include/bolt/Passes/Instrumentation.h
  bolt/lib/Core/BinaryBasicBlock.cpp
  bolt/lib/Core/BinaryContext.cpp
  bolt/lib/Core/Exceptions.cpp
  bolt/lib/Core/ParallelUtilities.cpp
  bolt/lib/Passes/Aligner.cpp
  bolt/lib/Passes/Instrumentation.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D138423.476869.patch
Type: text/x-patch
Size: 10459 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221121/786ff4f2/attachment.bin>


More information about the llvm-commits mailing list