summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/llvm/ADT/ScopedHashTable.h6
-rw-r--r--include/llvm/ADT/StringMap.h6
-rw-r--r--include/llvm/Support/Allocator.h6
3 files changed, 4 insertions, 14 deletions
diff --git a/include/llvm/ADT/ScopedHashTable.h b/include/llvm/ADT/ScopedHashTable.h
index ae16c9c137..3cc7738df8 100644
--- a/include/llvm/ADT/ScopedHashTable.h
+++ b/include/llvm/ADT/ScopedHashTable.h
@@ -167,10 +167,8 @@ public:
/// Access to the allocator.
- typedef typename ReferenceAdder<AllocatorTy>::result AllocatorRefTy;
- typedef typename ReferenceAdder<const AllocatorTy>::result AllocatorCRefTy;
- AllocatorRefTy getAllocator() { return Allocator; }
- AllocatorCRefTy getAllocator() const { return Allocator; }
+ AllocatorTy &getAllocator() { return Allocator; }
+ const AllocatorTy &getAllocator() const { return Allocator; }
bool count(const K &Key) const {
return TopLevelMap.count(Key);
diff --git a/include/llvm/ADT/StringMap.h b/include/llvm/ADT/StringMap.h
index f7f940944c..a966977ea5 100644
--- a/include/llvm/ADT/StringMap.h
+++ b/include/llvm/ADT/StringMap.h
@@ -246,10 +246,8 @@ public:
clear();
}
- typedef typename ReferenceAdder<AllocatorTy>::result AllocatorRefTy;
- typedef typename ReferenceAdder<const AllocatorTy>::result AllocatorCRefTy;
- AllocatorRefTy getAllocator() { return Allocator; }
- AllocatorCRefTy getAllocator() const { return Allocator; }
+ AllocatorTy &getAllocator() { return Allocator; }
+ const AllocatorTy &getAllocator() const { return Allocator; }
typedef const char* key_type;
typedef ValueTy mapped_type;
diff --git a/include/llvm/Support/Allocator.h b/include/llvm/Support/Allocator.h
index 774363fb49..7a7e4c0a13 100644
--- a/include/llvm/Support/Allocator.h
+++ b/include/llvm/Support/Allocator.h
@@ -32,12 +32,6 @@
#include <cstdlib>
namespace llvm {
-template <typename T> struct ReferenceAdder {
- typedef T &result;
-};
-template <typename T> struct ReferenceAdder<T &> {
- typedef T result;
-};
/// \brief CRTP base class providing obvious overloads for the core \c
/// Allocate() methods of LLVM-style allocators.