From: Benjamin Kramer Date: Fri, 18 Apr 2014 14:54:51 +0000 (+0000) Subject: Allocator: Remove ReferenceAdder hack. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d781e40b6a3fe4a0dfcf9b1e4100c8664b2f3918;p=oota-llvm.git Allocator: Remove ReferenceAdder hack. 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 --- diff --git a/include/llvm/ADT/ScopedHashTable.h b/include/llvm/ADT/ScopedHashTable.h index ae16c9c137b..3cc7738df8a 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::result AllocatorRefTy; - typedef typename ReferenceAdder::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 f7f940944cf..a966977ea57 100644 --- a/include/llvm/ADT/StringMap.h +++ b/include/llvm/ADT/StringMap.h @@ -246,10 +246,8 @@ public: clear(); } - typedef typename ReferenceAdder::result AllocatorRefTy; - typedef typename ReferenceAdder::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 774363fb491..7a7e4c0a13e 100644 --- a/include/llvm/Support/Allocator.h +++ b/include/llvm/Support/Allocator.h @@ -32,12 +32,6 @@ #include namespace llvm { -template struct ReferenceAdder { - typedef T &result; -}; -template struct ReferenceAdder { - typedef T result; -}; /// \brief CRTP base class providing obvious overloads for the core \c /// Allocate() methods of LLVM-style allocators.