Allocator: Remove ReferenceAdder hack.
authorBenjamin Kramer <benny.kra@googlemail.com>
Fri, 18 Apr 2014 14:54:51 +0000 (14:54 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Fri, 18 Apr 2014 14:54:51 +0000 (14:54 +0000)
This was a workaround for compilers that had issues with reference
collapsing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206612 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/ScopedHashTable.h
include/llvm/ADT/StringMap.h
include/llvm/Support/Allocator.h

index ae16c9c137bc8ec05ca4100a65adc40fefd64bb8..3cc7738df8aa909747ff7b1649fa837876ea146b 100644 (file)
@@ -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);
index f7f940944cfcb56f566e1185e71ebcddeb3f6027..a966977ea57712dd5f0aa6f4d23f20d0f2f8330d 100644 (file)
@@ -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;
index 774363fb49121b109bbcaa629ecf2e5fc5f3df2f..7a7e4c0a13e2ee1f5052f619a7f69ac50d3991e0 100644 (file)
 #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.