[PATCH] Change llvm::sys::Mutex implementation to use STL-provided mutexes.

Zachary Turner zturner at google.com
Thu May 29 13:33:40 PDT 2014


Hi rnk,

Change llvm::sys::Mutex implementation to use std::mutex and std::recursive_mutex.

This patch deletes the platform specific mutex implementations, and delegates to the underlying STL implementation.  Because STL mutex and recursive_mutex are implemented as separate classes, it is no longer possible to specify as a runtime param whether a recursive mutex is desired, and instead the decision must be made at compile time.

As part of this refactor, the ScopedLock class is deleted in favor of MutexGuard, which provides equivalent functionality.

http://reviews.llvm.org/D3960

Files:
  include/llvm/ExecutionEngine/ExecutionEngine.h
  include/llvm/IR/ValueMap.h
  include/llvm/Support/Mutex.h
  include/llvm/Support/MutexGuard.h
  lib/CodeGen/PseudoSourceValue.cpp
  lib/CodeGen/SelectionDAG/SelectionDAG.cpp
  lib/ExecutionEngine/ExecutionEngine.cpp
  lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
  lib/ExecutionEngine/JIT/JIT.cpp
  lib/ExecutionEngine/JIT/JITEmitter.cpp
  lib/ExecutionEngine/RuntimeDyld/GDBRegistrar.cpp
  lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h
  lib/IR/LeakDetector.cpp
  lib/IR/LegacyPassManager.cpp
  lib/Support/CMakeLists.txt
  lib/Support/CrashRecoveryContext.cpp
  lib/Support/DynamicLibrary.cpp
  lib/Support/Mutex.cpp
  lib/Support/PluginLoader.cpp
  lib/Support/Statistic.cpp
  lib/Support/Threading.cpp
  lib/Support/Timer.cpp
  lib/Support/Unix/Mutex.inc
  lib/Support/Windows/DynamicLibrary.inc
  lib/Support/Windows/Mutex.inc
  lib/Target/NVPTX/NVPTXUtilities.cpp
  unittests/IR/ValueMapTest.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D3960.9930.patch
Type: text/x-patch
Size: 36887 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140529/33932e60/attachment.bin>


More information about the llvm-commits mailing list