From a11df460ace96f61b3f0d7320d7681e37d407d5a Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Thu, 2 Jan 2014 23:28:39 +0000 Subject: [PATCH] Remove StringMapEntryInitializer support. It was never specialized so let's just remove that unused configurability and always do the default. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198374 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ADT/StringMap.h | 18 +----------------- unittests/ADT/StringMapTest.cpp | 17 ----------------- 2 files changed, 1 insertion(+), 34 deletions(-) diff --git a/include/llvm/ADT/StringMap.h b/include/llvm/ADT/StringMap.h index f22ce80df72..4a32b601959 100644 --- a/include/llvm/ADT/StringMap.h +++ b/include/llvm/ADT/StringMap.h @@ -26,19 +26,6 @@ namespace llvm { template class StringMapEntry; -/// StringMapEntryInitializer - This datatype can be partially specialized for -/// various datatypes in a stringmap to allow them to be initialized when an -/// entry is default constructed for the map. -template -class StringMapEntryInitializer { -public: - template - static void Initialize(StringMapEntry &T, InitTy InitVal) { - T.second = InitVal; - } -}; - - /// StringMapEntryBase - Shared base class of StringMapEntry instances. class StringMapEntryBase { unsigned StrLen; @@ -161,15 +148,12 @@ public: static_cast(Allocator.Allocate(AllocSize,Alignment)); // Default construct the value. - new (NewItem) StringMapEntry(KeyLength); + new (NewItem) StringMapEntry(KeyLength, InitVal); // Copy the string information. char *StrBuffer = const_cast(NewItem->getKeyData()); memcpy(StrBuffer, KeyStart, KeyLength); StrBuffer[KeyLength] = 0; // Null terminate for convenience of clients. - - // Initialize the value if the client wants to. - StringMapEntryInitializer::Initialize(*NewItem, InitVal); return NewItem; } diff --git a/unittests/ADT/StringMapTest.cpp b/unittests/ADT/StringMapTest.cpp index 5bb65cbd7aa..2ab09b56064 100644 --- a/unittests/ADT/StringMapTest.cpp +++ b/unittests/ADT/StringMapTest.cpp @@ -183,23 +183,6 @@ TEST_F(StringMapTest, IterationTest) { } } -} // end anonymous namespace - -namespace llvm { - -template <> -class StringMapEntryInitializer { -public: - template - static void Initialize(StringMapEntry &T, InitTy InitVal) { - T.second = InitVal; - } -}; - -} // end llvm namespace - -namespace { - // Test StringMapEntry::Create() method. TEST_F(StringMapTest, StringMapEntryTest) { StringMap::value_type* entry = -- 2.11.0