diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2019-10-23 17:51:42 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2019-10-23 17:51:42 +0000 |
commit | 1d5ae1026e831016fc29fd927877c86af904481f (patch) | |
tree | 2cdfd12620fcfa5d9e4a0389f85368e8e36f63f9 /include/llvm/IR/ValueMap.h | |
parent | e6d1592492a3a379186bfb02bd0f4eda0669c0d5 (diff) |
Notes
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: |