diff options
Diffstat (limited to 'include/llvm/IR/ValueMap.h')
-rw-r--r-- | include/llvm/IR/ValueMap.h | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/include/llvm/IR/ValueMap.h b/include/llvm/IR/ValueMap.h index 6a79b1d387f3..fb5440d5efe8 100644 --- a/include/llvm/IR/ValueMap.h +++ b/include/llvm/IR/ValueMap.h @@ -33,11 +33,11 @@ #include "llvm/IR/ValueHandle.h" #include "llvm/Support/Casting.h" #include "llvm/Support/Mutex.h" -#include "llvm/Support/UniqueLock.h" #include <algorithm> #include <cassert> #include <cstddef> #include <iterator> +#include <mutex> #include <type_traits> #include <utility> @@ -93,7 +93,6 @@ class ValueMap { MapT Map; Optional<MDMapT> MDMap; ExtraData Data; - bool MayMapMetadata = true; public: using key_type = KeyT; @@ -120,10 +119,6 @@ public: } Optional<MDMapT> &getMDMap() { return MDMap; } - bool mayMapMetadata() const { return MayMapMetadata; } - void enableMapMetadata() { MayMapMetadata = true; } - void disableMapMetadata() { MayMapMetadata = false; } - /// Get the mapped metadata, if it's in the map. Optional<Metadata *> getMappedMD(const Metadata *MD) const { if (!MDMap) @@ -266,9 +261,9 @@ public: // Make a copy that won't get changed even when *this is destroyed. ValueMapCallbackVH Copy(*this); typename Config::mutex_type *M = Config::getMutex(Copy.Map->Data); - unique_lock<typename Config::mutex_type> Guard; + std::unique_lock<typename Config::mutex_type> Guard; if (M) - Guard = unique_lock<typename Config::mutex_type>(*M); + Guard = std::unique_lock<typename Config::mutex_type>(*M); Config::onDelete(Copy.Map->Data, Copy.Unwrap()); // May destroy *this. Copy.Map->Map.erase(Copy); // Definitely destroys *this. } @@ -279,9 +274,9 @@ public: // Make a copy that won't get changed even when *this is destroyed. ValueMapCallbackVH Copy(*this); typename Config::mutex_type *M = Config::getMutex(Copy.Map->Data); - unique_lock<typename Config::mutex_type> Guard; + std::unique_lock<typename Config::mutex_type> Guard; if (M) - Guard = unique_lock<typename Config::mutex_type>(*M); + Guard = std::unique_lock<typename Config::mutex_type>(*M); KeyT typed_new_key = cast<KeySansPointerT>(new_key); // Can destroy *this: |