[llvm] r198374 - Remove StringMapEntryInitializer support.

David Blaikie dblaikie at gmail.com
Thu Jan 2 15:28:39 PST 2014


Author: dblaikie
Date: Thu Jan  2 17:28:39 2014
New Revision: 198374

URL: http://llvm.org/viewvc/llvm-project?rev=198374&view=rev
Log:
Remove StringMapEntryInitializer support.

It was never specialized so let's just remove that unused
configurability and always do the default.

Modified:
    llvm/trunk/include/llvm/ADT/StringMap.h
    llvm/trunk/unittests/ADT/StringMapTest.cpp

Modified: llvm/trunk/include/llvm/ADT/StringMap.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/StringMap.h?rev=198374&r1=198373&r2=198374&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/StringMap.h (original)
+++ llvm/trunk/include/llvm/ADT/StringMap.h Thu Jan  2 17:28:39 2014
@@ -26,19 +26,6 @@ namespace llvm {
   template<typename ValueTy>
   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<typename ValueTy>
-class StringMapEntryInitializer {
-public:
-  template <typename InitTy>
-  static void Initialize(StringMapEntry<ValueTy> &T, InitTy InitVal) {
-    T.second = InitVal;
-  }
-};
-
-
 /// StringMapEntryBase - Shared base class of StringMapEntry instances.
 class StringMapEntryBase {
   unsigned StrLen;
@@ -161,15 +148,12 @@ public:
       static_cast<StringMapEntry*>(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<char*>(NewItem->getKeyData());
     memcpy(StrBuffer, KeyStart, KeyLength);
     StrBuffer[KeyLength] = 0;  // Null terminate for convenience of clients.
-
-    // Initialize the value if the client wants to.
-    StringMapEntryInitializer<ValueTy>::Initialize(*NewItem, InitVal);
     return NewItem;
   }
 

Modified: llvm/trunk/unittests/ADT/StringMapTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ADT/StringMapTest.cpp?rev=198374&r1=198373&r2=198374&view=diff
==============================================================================
--- llvm/trunk/unittests/ADT/StringMapTest.cpp (original)
+++ llvm/trunk/unittests/ADT/StringMapTest.cpp Thu Jan  2 17:28:39 2014
@@ -183,23 +183,6 @@ TEST_F(StringMapTest, IterationTest) {
   }
 }
 
-} // end anonymous namespace
-
-namespace llvm {
-
-template <>
-class StringMapEntryInitializer<uint32_t> {
-public:
-  template <typename InitTy>
-  static void Initialize(StringMapEntry<uint32_t> &T, InitTy InitVal) {
-    T.second = InitVal;
-  }
-};
-
-} // end llvm namespace
-
-namespace {
-
 // Test StringMapEntry::Create() method.
 TEST_F(StringMapTest, StringMapEntryTest) {
   StringMap<uint32_t>::value_type* entry =





More information about the llvm-commits mailing list